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 NoInitialContextException 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 "NoInitialContextException" Watch "NoInitialContextException" New topic


kishore nerella

Joined: Jul 17, 2007
Posts: 15
Hello guys
I'm trying to do simple Stateless SessionBean using MyEclipse and jboss.

But while deploying it is giving javax.naming.NoInitialContextException.

Please help me.
Here is the code.

package sample.ejb;
import javax.ejb.*;
import javax.naming.*;

import sample.interfaces.*;

import java.util.*;
public class HelloClient
public static void main(String args[])
Hashtable ht=new Hashtable();
ht.put(Context.PROVIDER_URL, "localhost:8080");
ht.put("java.naming.factory.url.pkgs", "org.jboss.naming");
Context ctx=new InitialContext(ht);
HelloHome home=(HelloHome)ctx.lookup("roses");
Hello h1=home.create();
String str=h1.sayHello("kishore");
catch(Exception e)
I agree. Here's the link:
subject: NoInitialContextException
It's not a secret anymore!