Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

JNDI problem

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic