File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply 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: 2

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: 2

Solution: The jndi.properties go into the root of the src folder.
 
 
subject: javax.naming.NoInitialContextException although jndi.properties in classpath
 
Threads others viewed
Run JNDI example problem
how to test my ejb in jboss
classpath - error messages
javax.naming.NoInitialContextException
Problem in JNDI look up in ejb 3.0