Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 01:59 PM
Member
 
Join Date: Aug 2007
Posts: 1
hawkeye is on a distinguished road
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();
}

}
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-16-2008, 11:56 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 282
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
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...
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.NoClassDefFoundError J_a_y New To Java 2 08-07-2007 12:51 PM
java.lang.NoClassDefFoundError fred Advanced Java 3 08-01-2007 06:00 PM
Exception in thread "main" java.lang.NoClassDefFoundError carl New To Java 2 08-01-2007 06:26 AM
java.lang.NoClassDefFoundError Exception when I invoke to a class outside projectEJB Daniel Enterprise JavaBeans 1 07-06-2007 07:08 AM
java.lang.NoClassDefFoundError: javax/activation/DataSource bbq Advanced Java 1 07-05-2007 05:26 AM


All times are GMT +3. The time now is 02:33 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org