File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes  javax.naming.NoInitialContextException although in classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark " javax.naming.NoInitialContextException although in classpath" Watch " javax.naming.NoInitialContextException although in classpath" New topic

javax.naming.NoInitialContextException although in classpath

Pasquale Imbemba

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 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 at the project's root should be resolved.

How do I get file config to work?

Thanks in advance!

Pasquale Imbemba

Joined: Feb 08, 2012
Posts: 5

Solution: The go into the root of the src folder.
I agree. Here's the link:
subject: javax.naming.NoInitialContextException although in classpath
It's not a secret anymore!