Package javax.naming

Examples of javax.naming.NoInitialContextException


            } else {
                return new DelegateContext(context, provider);
            }
        } else {
            if (provider == null) {
                throw new NoInitialContextException("We could not find an InitialContextFactory to use");
            } else {
                return new DelegateContext(context, provider);
            }
        }
    }
View Full Code Here


        if (rebind) {
            if (contextProvider == null || !contextProvider.isValid()) {
                contextProvider = ContextHelper.getContextProvider(bundleContext, env);
            }
            if (contextProvider == null) {
                throw new NoInitialContextException();
            } else {
                return contextProvider.context;
            }
        } else {
            throw new NoInitialContextException();
        }
    }
View Full Code Here

     
      BundleContext context = Utils.getBundleContext(environment, InitialContext.class.getName());     
      if (context == null) {
          context = Utils.getBundleContext(environment, InitialDirContext.class.getName());
          if (context == null) {
              throw new NoInitialContextException("Unable to determine caller's BundleContext");
          }
      }
           
      return ContextHelper.getInitialContext(context, environment);
  }
View Full Code Here

   
      BundleContext context = Utils.getBundleContext(environment, InitialContext.class.getName());     
      if (context == null) {
          context = Utils.getBundleContext(environment, InitialDirContext.class.getName());
          if (context == null) {
              throw new NoInitialContextException("Unable to determine caller's BundleContext");
          }
      }
           
      return ContextHelper.getInitialContext(context, environment);
  }
View Full Code Here

        } else {
          String contextFactoryClass = (String) environment.get(Context.INITIAL_CONTEXT_FACTORY);
          if (contextFactoryClass == null) {
            return new DelegateContext(context, environment);
          } else {
            throw new NoInitialContextException("We could not find a provider for the InitialContextFactory " + contextFactoryClass);
          }
        }
    }
View Full Code Here

    }
   
    protected DirContext checkAndCast(Context ctx) throws NamingException {
        if (!(ctx instanceof DirContext)) {
            if (ctx == null) {
                throw new NoInitialContextException();
            } else {
                throw new NotContextException(
                    "Not an instance of DirContext");
            }
        }
View Full Code Here

   
    @Override
    protected LdapContext checkAndCast(Context ctx) throws NamingException {
        if (!(ctx instanceof LdapContext)) {
            if (ctx == null) {
                throw new NoInitialContextException();
            } else {
                throw new NotContextException("Not an instance of LdapContext");
            }
        }
View Full Code Here

   
    @Override
    protected EventDirContext checkAndCast(Context ctx) throws NamingException {
        if (!(ctx instanceof EventDirContext)) {
            if (ctx == null) {
                throw new NoInitialContextException();
            } else {
                throw new NotContextException(
                    "Not an instance of EventDirContext");
            }
        }
View Full Code Here

    }
   
    protected EventContext checkAndCast(Context ctx) throws NamingException {
        if (!(ctx instanceof EventContext)) {
            if (ctx == null) {
                throw new NoInitialContextException();
            } else {
                throw new NotContextException(
                    "Not an instance of EventContext");
            }
        }
View Full Code Here

            // throw NamingException
            throw e;
        } catch (Exception e) {
            // failed, throw NoInitialContextException
            // jndi.20=Failed to create InitialContext using factory specified in hashtable {0}
            NamingException nex = new NoInitialContextException(
                    Messages.getString("jndi.20", h))//$NON-NLS-1$
            nex.setRootCause(e);
            throw nex;
        }
    }
View Full Code Here

TOP

Related Classes of javax.naming.NoInitialContextException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.