Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
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
 
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.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic