Discussions
EJB programming & troubleshooting: Weird Problem NamingContextFactory in jar cannot be instatiated
-
Weird Problem NamingContextFactory in jar cannot be instatiated (2 messages)
- Posted by: Ruben Trancoso
- Posted on: June 22 2007 16:44 EDT
import org.jnp.interfaces.NamingContextFactory; class Test { Test() { NamingContextFactory f = new NamingContextFactory(); System.out.println(f); } public static void main(String args[]) { new Test(); }; }; javac -cp jbossall-client.jar Test When trying the same code from within a jar i have: SET CLASSPATH=.;.\jbossall-client.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/jnp/interfaces/NamingContextFactory at client.App.(App.java:18) at client.App.main(App.java:46)Threaded Messages (2)
- Re: Weird Problem NamingContextFactory in jar cannot be instatia by Sanket Raut on June 26 2007 00:48 EDT
- Solved by Ruben Trancoso on June 28 2007 09:13 EDT
-
Re: Weird Problem NamingContextFactory in jar cannot be instatia[ Go to top ]
- Posted by: Sanket Raut
- Posted on: June 26 2007 00:48 EDT
- in response to Ruben Trancoso
import org.jnp.interfaces.NamingContextFactory;
make sure package structure is also same.
class Test
{
Test() {
NamingContextFactory f = new NamingContextFactory();
System.out.println(f);
}
public static void main(String args[]) {
new Test();
};
};
javac -cp jbossall-client.jar Test
When trying the same code from within a jar i have:
SET CLASSPATH=.;.\jbossall-client.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/jnp/interfaces/NamingContextFactory
at client.App.(App.java:18)
at client.App.main(App.java:46) -
Solved[ Go to top ]
- Posted by: Ruben Trancoso
- Posted on: June 28 2007 09:13 EDT
- in response to Ruben Trancoso
The jar manifest needs a 'Class-Path:' attribute with the libs it reference.