EJB client error
substring May 16, 2003 8:29 AMHello All,
All I am trying to do is to work thru a very simple EJB program to learn the EJB structure. But apparently, it is harder than I thought. It seems all the "simple" EJB examples I found on the Net turn out to be not that simple... at least to a newbie like me.
Okay, I am working on this "simple" EJB project that does not use struts, does not use ant. Just compile and build on the command prompt. The deployment of the jar file to JBoss was successful according to the message displayed on JBoss console. Then there is a simple client class for testing purpose. This client class is compiled and then run in its project folder.
When I run the client class, I got error message as followed:
//message begin-----------------------------------------------
C:\workspace>java -classpath c:\JBoss-3.2.1_tomcat-4.1.24\client\jboss-client.jar;c:\jboss-3.2.1_tomcat-4.1.24\client\jnp-client.jar;. Client "argument"
Exception in thread "main" java.lang.NoClassDefFoundError: javax/net/SocketFactory
at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:41)
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.(Unknown Source)
at Client.main(Client.java:25)
//message end-----------------------------------------------
In the main of Client.java, I have these lines of code:
//code begin-----------------------------------------------
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
//code end-----------------------------------------------
Then if I add jnet.jar to the classpath, I got a different but similar error message:
//message begin---------------------------------------
C:\workspace>java -classpath c:\JBoss-3.2.1_tomcat-4.1.24\cl
ient\jboss-client.jar;c:\jboss-3.2.1_tomcat-4.1.24\client\jnp-client.jar;c:\jboss-3.2.1_tomcat-4.1.24\client\jnet.jar;. Client "argument"
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at org.jnp.interfaces.NamingContext.(NamingContext.java:103)
at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:41)
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.(Unknown Source)
at Client.main(Client.java:25)
//message end--------------------------------------------------
It is getting to be very frustrating. Please help. Thank you very much.