• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI problem

 
Peter Braun
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm still learning from K&B's Head First EJB book. Thanks to Valentin Tanase's advice I solved my previous problem and managed to deploy my first session bean.
Unfortunately I have run into a JNDI problem. I made a client to test my bean, but when I try to run it I got an exception:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

My code looks like this:


I suppose some InitialContext parameter is missing but the book's example has no paramater and I have no idea what to do.

I'm using the J2EE 1.4 SDK with it's bundled Sun Java System Application Server.

Could you help me please?

Thanks in advance.
Peter
 
Peter Braun
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After a day's search I have solved my problem. Maybe somebody is interested , so I write it to here.

I have to give 2 jars for the client like this:


appserv-rt.jar is needed because it contains a file called jndi.properties which contains defaults settings for Sun's application server. And I suppose it contains classes which are also required.
j2ee.jar is required too besause client use classes from it.

Now it`s working.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!