JBOSS NoInitialContextException
harsh.vardhan Jan 27, 2015 12:21 PMI have just started working with NetBeans. I registered jboss AS 6.1 with NetBeans and created a sample application using a tutorial. You can refer to the application creation below if you feel like:
Link to tutorial: http://www.tutorialspoint.com/ejb/ejb_quick_guide.htm
I recieved an error while running my application that NetBeans cannot find NamingContex file:
EXACT ERROR: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
COMPLETE ERROR MESSAGE:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
null
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at com.harsh.test.EJBTester.<init>(EJBTester.java:34)
at com.harsh.test.EJBTester.main(EJBTester.java:43)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
... 5 more
java.lang.NullPointerException
at com.harsh.test.EJBTester.testStatelessEjb(EJBTester.java:56)
at com.harsh.test.EJBTester.main(EJBTester.java:45)
MY POST IS A BIT BIG TO READ BUT I WOULD REALLY APPRECIATE ANY HELP OVER THIS ISSUE....PLEASE HELP! THANK YOU
And is it the server jboss or Netbeans IDE because of which i am@ getting such error??