• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InitialContext.lookup(Unknown Source)

 
Allan Stone
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying the example from HFEJB (AdviceBean).
I've deployed it successfully on Sun Application Server, but when I was trying to run the AdviceClient, I got the exceptions as below:
_____________________________________________________________________
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
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at HFEJB.ch1.AdviceClient.go(AdviceClient.java:28)
at HFEJB.ch1.AdviceClient.main(AdviceClient.java:19)
______________________________________________________________________

Can anyone tell me what's the problem?

Thx in advance.
 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your app server actually running?If so , then maybe this http://www.osjava.org/simple-jndi/FAQ.html

jeff mutonho
 
Allan Stone
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff,

Thanks for the reply. The App Server is sure running OK. I guess the problem is I don't have a jndi.properties file in my classpath.

But where can I find one for my application?
[ November 22, 2005: Message edited by: Allan Li ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic