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 Exception while running Sessionbean 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 "Exception while running Sessionbean" Watch "Exception while running Sessionbean" New topic

Exception while running Sessionbean

Yogesh Yadav

Joined: Sep 09, 2006
Posts: 4
hi all,

I am creating a session bean ..and simply i am calling my bean from a standalone class ..and i m getting following exception ,,
I am using WSAD5.1

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
at javax.naming.spi.NamingManager.getInitialContext(
at javax.naming.InitialContext.getDefaultInitCtx(
at javax.naming.InitialContext.getURLOrDefaultInitCtx(
at javax.naming.InitialContext.lookup(

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

"Yogesh", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Be aware that accounts with invalid display names are removed.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
Yogesh Yadav

Joined: Sep 09, 2006
Posts: 4
Hi ,
I have changed my display name .

Chandima Janakantha

Joined: Aug 31, 2006
Posts: 6
To have access to Intial context you need to run within a EJB or Web Module, or else it should be a J2EE Client.

Then to access the beans through local JNDI reference you need to have EJB Reference created and access through java:comp/env/ intial context.
I agree. Here's the link:
subject: Exception while running Sessionbean
It's not a secret anymore!