Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem witth NoInitialContextException

 
Micheal John
Ranch Hand
Posts: 344
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am started learning EJB from HFEJB for the exam: I have a tought time with the first sample example on sesion bean:

Why I am getting this error? How to resolve it?



My Folder structure:








 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to pass two properties to the InitialContext, viz., Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL.
You can refer to the sample client at the following location:Writing an ejb client
 
Micheal John
Ranch Hand
Posts: 344
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Nitesh...
I am wondering how come the authors of Head First EJB not mentioned anything about this and whether without the properties on InitialContext it will work(optional)?
 
Gowher Naik
Ranch Hand
Posts: 643
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For me it is working without properties on InitialContext.
I am using j2sdkee1.3.1 and jdk1.3.1_19
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think that without the properties the initial context can be created.
You can see the Initial context javadocs for the details. Probably, you have the properties available in some property file in the classpath.
 
Micheal John
Ranch Hand
Posts: 344
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi gowher,

Can you send me the link where you downloaded the J2EE1.3 server. I have searched but couldn't get that, so i have downloaded the J2EE server 8.0.. i think it's 1.4 and installed it.. If I have 1.3, then it will be nice..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic