Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Initialcontext problem!!

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i was trying the HF EJB advicebean example in chap.1.
everything was going fine till the last step,when I ran the AdviceClient,this was what i got:
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
Please help me out.
Thanx in advance.
 
Ranch Hand
Posts: 498
Eclipse IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I don't have HF EJB, but the error occur because you doesn't have the right properties, or classpath settings for your client.
Try to create a jndi.properties file whit the following arguments:


And put it in the classpath of your client app.

Note that this example is for JBoss, you have to provide the right values for Initial Factory and Connection URL for the conteiner that you are using, also you need the jar that contain the class for Initial Factory in your client classpath.

There are other ways to pass that values, like command Line option -D and, in your code, passing as an argument for your Initial Context

Regards,
[ June 14, 2004: Message edited by: Marcelo Sousa Ancelmo ]
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you also define your properties within your code, and put that as a parameter on when you instantiate your initial context?

Properties myProp = ...
// set values
your new InitialContext(myProp);

--Dale--
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic