Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

What is NoInitialContextException?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I imported an EAR file to JDeveloper and tried to run the Application Client JAR file within it, but I got this error:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
Does anyone know what caused this?
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Yingie
Please tell us what is your client code, what you have in the client jar file if possible. That will help us to identify correct issue.
In general NoIntialContext means, the code is trying to create InitialContext for JNDI connection but it doesn't find it. This exception could happen due to various reasons,
- the INITIAL_CONTEXT_FACTORY was not found
etc..
Refer to J2EE 1.4 API to see what they have to say about this exception...
Regards
Maulin
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get the same error.
My EJB has a pair of local and remote interfaces.
I can connect to the remote Interfaces successfully but when it comes to local ones i get that error.
Because they are local i do not use initial context factory.
My code looks like,

in the class path i added some jars like the stubs of the ejb although i think they are not needed.
However i still get the same error message any ideas?
reply
    Bookmark Topic Watch Topic
  • New Topic