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 EJB Runtime error 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 "EJB Runtime error" Watch "EJB Runtime error" New topic

EJB Runtime error

Rashmee H S

Joined: May 29, 2008
Posts: 6
I am getting this error while running my Ejb application
plese help me......
I done these things in my application

<?xml version="1.0" encoding="UTF-8"?>

and getting "sessionBean/Bean" as My Jndi-name
and in my client application
InitialContext ic=new InitialContext();
Object ref=ic.lookup("sessionBean/remote");
CcountHome home=(CcountHome)PortableRemoteObject.narrow(ref,CcountHome.class);
CcountObject count=home.create();
System.out.println("Upper is"+count.upper(str));
System.out.println("Lowe is"+count.lower(str));
System.out.println("Spaces are";
System.out.println("Characters are";
After compiling if i run this application it will give this 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
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at ejbUsage.UseEjb.main(

Please help me .....................

[ June 06, 2008: Message edited by: Rashmee Hs ]
[ June 06, 2008: Message edited by: Rashmee Hs ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"Rashmee Hs",
Please check your private messages regarding an important administrative matter.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"Rashmee H S",
Please check your private messages.
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
You have to setup your InitialContext properly.

Amit Tank
Linked In
I agree. Here's the link:
subject: EJB Runtime error
It's not a secret anymore!