Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error:javax.naming.NoInitialContextException: Need to specify class name

871355Jul 12 2011 — edited Jul 12 2011
Hello,

I am getting the following 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
I have the following
                InitialContext  ctx = new InitialContext();
                String datasource = (DataSource)ctx.lookup(name);
The above is called as a method from my public static void method.

Any idea how can I resolve this error
This post has been answered by Timo Hahn on Jul 12 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2011
Added on Jul 12 2011
15 comments
13,694 views