Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic


kishore nerella
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic