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

What is NoInitialContextException?  RSS feed

 
Yingie Pitts
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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?
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • 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
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!