楼主你没把问题说清楚啊,
看到这个at example.session.stateless.HelloClient.main(HelloClient.java:22)
你是准备用一个java类(HelloClient)来测试你的slsb吗。如果是这样你要提供一个jndi.properties的配置文件。
一般放在src目录下
这里是一个jndi.properties文件的内容:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099把最后一项localhost改成你jboss的ip地址。
然后在代码里:
       Properties env=new Properties();
      env.load(getClass().getResourceAsStream("/jndi.properties"));
     ejbContext= new InitialContext(env);
然后你就可以用ejbContext去lookup EJB组件了