This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception while running Sessionbean" Watch "Exception while running Sessionbean" New topic
Author

Exception while running Sessionbean

Yogesh Yadav
Greenhorn

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(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:292)
at javax.naming.InitialContext.lookup(InitialContext.java:359)

Thanks
Yogesh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

"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.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yogesh Yadav
Greenhorn

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

Thanks
Chandima Janakantha
Greenhorn

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: http://aspose.com/file-tools
 
subject: Exception while running Sessionbean
 
Similar Threads
Exception while running Session Bean
problem with WSAD5.1
javax.naming.NoInitialContextException while Running the client
NoInitialContextException
Runtime Exception - could not connect to EJB server