• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't find JNDI context  RSS feed

 
irshad ahmed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying out the example in Chapter 1 of the Head First EJB book. I got everything working except the last step. It is unable to find the JNDI context. I specified the context as "Advisor", both on the server and in my AdviceClient.java file.
This is the error:
C:\projects\advice>java AdviceClient
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 AdviceClient.go(AdviceClient.java:22)
at AdviceClient.main(AdviceClient.java:14)
C:\projects\advice>
Does anyone know what I'm missing?
Thanks,
Irshad Ahmed
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to define
java.naming.factory.initial
specifying one of provider classes.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!