Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss, EJB problem

 
Aju Josep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to put the EJB client jar in your classpath of course.
 
Aju Josep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try keeping the foll. jar in your class path, so that ur client application can pick it up...
 
Aju Josep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JBoss forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic