• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help : NoInitialContextException (Any Help from Authors of HFE ??)  RSS feed

 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am studying EJB using Head First by Kathy & Bert. It is fundoo book. It nicely goes to the deeper level of eachdeployment process. BUT, I donot understand why the authors have not mentioned about passing the parameters while creating InitialContext Object in FIRST chapter of the book.
I followed all the steps as per the book, but on running the AdviceClient I am getting error as

D:\Projects\advice>java -cp .;AdviceAppClient.jar AdviceClient
javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: 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:33)
at AdviceClient.main(AdviceClient.java:26)

Can authors please guide me in this ?

Thanks a Lot in Advance
Sachin
 
Sachin Joshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sachya Joshi:
hi,
I am studying EJB using Head First by Kathy & Bert. It is fundoo book. It nicely goes to the deeper level of eachdeployment process. BUT, I donot understand why the authors have not mentioned about passing the parameters while creating InitialContext Object in FIRST chapter of the book.
I followed all the steps as per the book, but on running the AdviceClient I am getting error as

D:\Projects\advice>java -cp .;AdviceAppClient.jar AdviceClient
javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: 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:33)
at AdviceClient.main(AdviceClient.java:26)

Can authors please guide me in this ?

Thanks a Lot in Advance
Sachin


HI,
My problem is solved. This forum helped me to narrow down my problem cause as CLASSPATH error. After solving that, I got a famous CORBA.BAD_OPERATION error. But, there was enough help on
http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html to solve that.
Thanks to the HF EJB Authors for keeping this update on the site.

Sachin
 
Lnr Foley
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you be more specific? What was the Classpath error - what were you missing? I'm getting the same problem, though in my case, i have %classpath% in the -cp field.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!