i deployed a stateless bean (simple HelloWorld) in jboss, and checked the jboss console to confirm that the bean was properly deployed. i tried calling the bean from a simple java client. while compiling the client, i get compiler error: "cannot resolve symbol, symbol : class HelloWorldHome" where 'HelloWorldHome' is the name of the home interface. is there any problem with the JNDI lookup of the home interface. I am new to EJB and jboss. Please help. Thanks, Aju
Billybob Marshall
Ranch Hand
Joined: Jan 27, 2004
Posts: 202
posted
0
You have to put the EJB client jar in your classpath of course.
Aju Josep
Greenhorn
Joined: Feb 20, 2004
Posts: 17
posted
0
Thanks BillyBob, but i have read that ejb-client-jars are optional. can u please elaborete more on ejb-client jars and why u need them, and what all things constiture an ejb-client jar. this may sound stupid, but i am very new to ejb.
Billybob Marshall
Ranch Hand
Joined: Jan 27, 2004
Posts: 202
posted
0
All I'm basically saying is that since as you said, you're trying to reference a 'HelloWorldHome' class/interface in your client code, so of course you would have to have a jar (or loose class) containing HelloWorldHome.class in it, and in the correct folder hierarchy according to its package statement. When you built the EJB, part of that process should have created a client JAR. That's the one your client code needs to stick in its classpath.
Aju Josep
Greenhorn
Joined: Feb 20, 2004
Posts: 17
posted
0
yeah, i did that and now i no more get that compiler error. i got u'r point. thanx Billybob. but now i have a new problem when i try to run the client application. i get this following error: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory can u help ? Thanks, Aju.
Vishwa Kumba
Ranch Hand
Joined: Aug 27, 2003
Posts: 1064
posted
0
Try keeping the foll. jar in your class path, so that ur client application can pick it up...
Aju Josep
Greenhorn
Joined: Feb 20, 2004
Posts: 17
posted
0
bingo !!! hey vish, that worked. that was a great tip. u helped me run my first ever EJB. thanx a lot. thanx a lot to u too Billybob....
Vishwa Kumba
Ranch Hand
Joined: Aug 27, 2003
Posts: 1064
posted
0
I am also a novice to JBoss. There are a whole lot of jar files in the JbossDir\client directory. Based on the need, we may have to supply the jar files as required to run the client programs accessing J2EE services on JBoss Server.I am not sure if these jar files are explained in the JBoss documentation...