Results 1 to 2 of 2
  1. #1
    hawkeye is offline Member
    Join Date
    Aug 2007
    Posts
    1
    Rep Power
    0

    Default java.lang.NoClassDefFoundError: com.ibm.ws.orb.GlobalORBFactory

    Hi All,

    I was trying to lookup ejb from standalone java client but keep getting the following exceptions:

    javax.naming.NamingException: Failed to initialize the ORB. Root exception is java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java :327)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitia lContextInternal(WsnInitCtxFactory.java:366)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnIn itCtx.java:112)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull (WsnInitCtx.java:422)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCt x.java:143)
    at javax.naming.InitialContext.lookup(InitialContext. java:361)
    at testing.ClientTestRMI.test(ClientTestRMI.java:46)
    at testing.ClientTestRMI.main(ClientTestRMI.java:26)
    Caused by: java.lang.NoClassDefFoundError: com.ibm.ws.orb.GlobalORBFactory
    at com.ibm.ejs.oa.EJSORBImpl.class$(EJSORBImpl.java:1 71)
    at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl .java:171)
    at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientOR BImpl.java:98)
    at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientOR BImpl.java:74)
    at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386)
    ... 13 more

    ===================
    Below is the code snippet:

    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory ");
    env.put(Context.PROVIDER_URL, "iiop://w01b25ye.ubssngpb.net:2809");

    env.put("org.omg.CORBA.ORBClass","com.ibm.rmi.iiop .ORB");
    env.put("org.omg.CORBA.ORBSingletonClass","com.ibm .rmi.corba.ORBSingleton");
    env.put("javax.rmi.CORBA.UtilClass","com.ibm.rmi.j avax.rmi.CORBA.Util");
    env.put("javax.rmi.CORBA.StubClass","com.ibm.rmi.j avax.rmi.CORBA.StubDelegateImpl");
    env.put("javax.rmi.CORBA.PortableRemoteObjectClass ","com.ibm.rmi.javax.rmi.PortableRemoteObject" );
    env.put("java.naming.factory.url.pkgs","com.ibm.ws .naming");

    try {
    Context initialContext = new InitialContext(env);
    if (initialContext != null) {
    System.out.println("Context Obtained.");

    Object homeObject = initialContext.lookup("ejb/CommonSFBean");
    CommonSFHome ccHome = (CommonSFHome)
    javax.rmi.PortableRemoteObject.narrow(homeObject, CommonSFHome.class);
    CommonSF bc = ccHome.create();

    if (bc != null) {
    System.out.println("CommonSF Obtained.");
    }
    }
    } catch (Exception e) {
    e.printStackTrace();
    }

    }

  2. #2
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    6

    Default Jar classpath mismatch

    Hi,
    This exception is not related to code anywhere. This is caused because of
    1) The required jar may not be added in classpath.
    2) Classpath provided may be wrong or
    3) the jars may not be properly deployed

    Hope this may help you out... :)

Similar Threads

  1. Replies: 2
    Last Post: 01-20-2014, 07:45 AM
  2. Replies: 2
    Last Post: 07-21-2012, 01:15 AM
  3. java.lang.NoClassDefFoundError
    By J_a_y in forum New To Java
    Replies: 2
    Last Post: 08-07-2007, 11:51 AM
  4. java.lang.NoClassDefFoundError
    By fred in forum Advanced Java
    Replies: 3
    Last Post: 08-01-2007, 05:00 PM
  5. Replies: 2
    Last Post: 08-01-2007, 05:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •