This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Problem witth NoInitialContextException  RSS feed

 
Ranch Hand
Posts: 344
  • 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:








 
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • 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
  • 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)?
 
Ranch Hand
Posts: 643
  • 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
  • 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
  • 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..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!