Packaging ejb3 swing client
Posted
by soontobeared
on Stack Overflow
See other posts from Stack Overflow
or by soontobeared
Published on 2010-06-06T00:54:55Z
Indexed on
2010/06/06
1:02 UTC
Read the original article
Hit count: 495
Hi,
I get the "java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac tory" error while running my packaged ejb3 swing client jar. Here's the stack trace.
G:\Courses\OSUMC\Installables\June 5\New>java -jar MetaDB-Client.jar
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
rg.jnp.interfaces.NamingContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at net.massmatrix.metadb.ui.facade.BaseEJBFacade.getInitialContext(BaseE
JBFacade.java:26)
at net.massmatrix.metadb.ui.facade.UserManagerFacade.getUserManager(User
ManagerFacade.java:24)
at net.massmatrix.metadb.ui.facade.UserManagerFacade.isUserNameAvailable
(UserManagerFacade.java:44)
at net.massmatrix.metadb.ui.MainFrame.main(MainFrame.java:269)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac
tory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
... 8 more
Exception in thread "main" java.lang.NullPointerException
at net.massmatrix.metadb.ui.facade.UserManagerFacade.isUserNameAvailable
(UserManagerFacade.java:44)
at net.massmatrix.metadb.ui.MainFrame.main(MainFrame.java:269)
Here are my packaged swing client Jar contents:-
MetaDB-Client.jar
\lib - contains all jboss\client jars
\net\.. - contains class files(from both client and server)
META-INF
MANIFEST.MF
jndi.properties
Here's my jndi.properties:-
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099
Here's my MANIFEST.MF:-
Manifest-Version: 1.0
Main-Class: net.massmatrix.metadb.ui.MainFrame
Class-Path: lib/*
Command used to create the jar:-
jar cfm MetaDB-Client.jar MANIFEST.MF net\* lib\* jndi.properties
What else am i missing ?
Thanks.
© Stack Overflow or respective owner