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

First Bean issue

 
Tony Bateman
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just managed to successfully deploy my first bean on my local server, which was the example in the "Head First EJB" book.

I am trying to create a client application that uses this been (as in the book), but I am trying to use Eclipse to do so.

Whenever I run my client code, I get a NoInitialContextException after these lines:


Could anybody help me with this? Apologies if this is the inappropriate forum to post such a basic question.

Kind Regards,

Tony.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check http://forum.java.sun.com/thread.jspa?threadID=765320&tstart=0 and especially my reply (#3):


Instead supply the following startup arguments to the JVM:

-Dorg.omg.CORBA.ORBInitialHost=${ORBhost}"
-Dorg.omg.CORBA.ORBInitialPort=${ORBport}"



where ORBhost and ORBport are the settings for your server ("myserver", "3700" in your example).

You will also need j2ee.jar and appserv-rt.jar on the classpath when running the client.


 
Tony Bateman
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks, I followed the threads and understand a bit more now. Problem is, I don't seem to have a copy of appserv-rt.jar on my system. I assume it should have come with the J2EE server download.

Any idea why that .jar is missing?

Kind Regards,

Tony.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use another vendor's appserver that file will be called something else.
JBoss for example calls it jboss-client.jar, Orion calls it orionclient.jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic