aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes  javax.naming.NoInitialContextException although jndi.properties in classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark " javax.naming.NoInitialContextException although jndi.properties in classpath" Watch " javax.naming.NoInitialContextException although jndi.properties in classpath" New topic
Author

javax.naming.NoInitialContextException although jndi.properties in classpath

Pasquale Imbemba
Greenhorn

Joined: Feb 08, 2012
Posts: 5

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

Joined: Feb 08, 2012
Posts: 5

Solution: The jndi.properties go into the root of the src folder.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.naming.NoInitialContextException although jndi.properties in classpath