aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes NoInitialContextException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "NoInitialContextException" Watch "NoInitialContextException" New topic
Author

NoInitialContextException

Mathias Andrae
Greenhorn

Joined: Feb 04, 2002
Posts: 23
I am using IBM Websphere as AppServer and Visual Age for Java for coding and deploying.
I have got a client application which runs correctly in the environment of Visual Age.
But when I start the client with Webstart I got that exception:
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.ejb.ns.jndiCNInitialContextFactory...
Whats the problem? Is my classpath wrong?
And where are the missing classes? The class com.ibm.ejb.ns.jndiCNInitialContextFactory is part of visual age. But how I have to configure a simple client-pc for this type of clients?
Please help...
Thanks,
Mathias
Mathias Andrae
Greenhorn

Joined: Feb 04, 2002
Posts: 23
I solved that problem. I forgot the j2ee.jar in the classpath.
but now I got that Exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at org.omg.CORBA.ORB.create_impl(ORB.java:306)
at org.omg.CORBA.ORB.init(ORB.java:345)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:93)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at effectivevaj.adv.ejb.session.HelloWorldClient.getInitialContext(HelloWorldClient.java:32)
at effectivevaj.adv.ejb.session.HelloWorldClient.main(HelloWorldClient.java:42)
Do you know where I find the missing class???
Is there any classpath on the server I have to set???
Ajit Malleri
Greenhorn

Joined: Feb 10, 2002
Posts: 27
Hi,
It seems your client application is unable to get the required classes. Just check whether com/ibm/rmi/iiop/ORB package is in the classpath.

Originally posted by Mathias Andrae:
I solved that problem. I forgot the j2ee.jar in the classpath.
but now I got that Exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at org.omg.CORBA.ORB.create_impl(ORB.java:306)
at org.omg.CORBA.ORB.init(ORB.java:345)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:93)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at effectivevaj.adv.ejb.session.HelloWorldClient.getInitialContext(HelloWorldClient.java:32)
at effectivevaj.adv.ejb.session.HelloWorldClient.main(HelloWorldClient.java:42)
Do you know where I find the missing class???
Is there any classpath on the server I have to set???


SCJP, SCWCD
Mathias Andrae
Greenhorn

Joined: Feb 04, 2002
Posts: 23
Thanks, that helped.
But now I got that problem:
javax.naming.NamingException: Error during resolve [Root exception is java.lang.NullPointerException]
The jndi-name is correct.
Can anybody help???
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,
Please check out jndi name in the EJB properties
option (right click the ejb name)By Default for WAS3.5 the jndi name be in the following format
com/titan/ship/SHIP for SHIP Bean.
Regards,
M.S.Raman.
Mathias Andrae
Greenhorn

Joined: Feb 04, 2002
Posts: 23
thanks, but thats not the problem.
The jndi-name is correct.
Is there any setting I forgot at the client.
Can anybody give me an overview of what is to do at the client to enable access to an ejb-server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoInitialContextException