Package javax.naming

Examples of javax.naming.NoInitialContextException


     
      Utils.augmentEnvironment(environment);
   
      BundleContext context = Utils.getBundleContext(environment, InitialContext.class);     
      if (context == null) {
            throw new NoInitialContextException(Utils.MESSAGES.getMessage("cannot.find.callers.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(Utils.MESSAGES.getMessage("no.initial.context.factory", contextFactoryClass));
          }
        }
    }
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.getContext();
            }
        } else {
            throw new NoInitialContextException();
        }
    }
View Full Code Here

      InitialContextThread thread = new InitialContextThread(loader);
      thread.start();
      try {
        thread.join();
      } catch (InterruptedException ex) {
        throw new NoInitialContextException("Initial context thread interrupted: " + ex.getMessage());
      }
      c = thread.getContext();
      if (c == null)
        throw thread.getException();
    } catch (ClassNotFoundException ex) {
      throw new NoInitialContextException("Class " + className + " not found");
    }
    return c;
  }
View Full Code Here

            String className = (String) env.get(Context.INITIAL_CONTEXT_FACTORY);
            if (className != null) {
                try {
                    factory = (InitialContextFactory) Class.forName(className).newInstance();
                } catch (Exception e) {
                    NoInitialContextException ne = new NoInitialContextException("Cannot instantiate class: " + className);
                    ne.setRootCause(e);
                    throw ne;
                }
            }
        }
        if (factory == null) {
            NoInitialContextException ne = new NoInitialContextException(
                "Need to specify class name in environment or system " +
                "property, or as an applet parameter, or in an " +
                "application resource file:  " +
                Context.INITIAL_CONTEXT_FACTORY);
            throw ne;
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(Utils.MESSAGES.getMessage("no.initial.context.factory", contextFactoryClass));
          }
        }
    }
View Full Code Here

                catch (Exception e) {
                    if (className.startsWith("weblogic.jndi")) {
                        logger.log(Level.INFO, FALL_BACK_INITIAL_CONTEXT_FACTORY,
                                "com.sun.enterprise.naming.impl.SerialInitContextFactory");
                    } else {
                        NoInitialContextException ne =
                                new NoInitialContextException("Cannot instantiate class: " + className);
                        ne.setRootCause(e);
                        throw ne;
                    }
                }
            }
        }
View Full Code Here

    }

    if (icf == null) {

      // TODO nls enable this.
      NamingException e3 = new NoInitialContextException("We could not find an InitialContextFactory to use");
     
      throw e3;
    }

    Context ctx = icf.getInitialContext(env);
View Full Code Here

                throw e4;
            }
        }

        if (icf == null) {
            NamingException e3 = new NoInitialContextException("We could not find an InitialContextFactory to use");

            throw e3;
        }

        Context ctx = icf.getInitialContext(env);
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.