Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.naming.NoInitialContextException although jndi.properties in classpath

 
Pasquale Imbemba
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to read the JNDI contents of my JBoss AS 6 running on localhost.

I have a jndi.properties on the root of my JavaProject. The project has uses a user library where it points to the necessary JBoss jars.
This project has just the following class:


When I do run this as Java Application (under eclipse), I get the exception:
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

I've checked the Run configuration for this project. The classpath tab contains the project itself under UserEntries - that makes me think that the jndi.properties at the project's root should be resolved.

How do I get jndi.properties file config to work?

Thanks in advance!


 
Pasquale Imbemba
Greenhorn
Posts: 5
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution: The jndi.properties go into the root of the src folder.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic