• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Problem witth NoInitialContextException

 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Screaming fools! It's nothing more than a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic