aspose file tools*
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
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: 60992
    
  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.
 
jQuery in Action, 2nd edition
 
subject: Exception while running Sessionbean