本地接口报错很正常啊!!
因为你的测试代码,跟jboss上的ejb组件不是在同一个虚拟机啊!!

解决方案 »

  1.   

    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    props.setProperty("java.naming.provider.url", "localhost:1099");
    props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
            //上面的代码用于访问JBOSS服务器
    InitialContext ict=new InitialContext(props);
                       HelloBeanLocal hello = (HelloBeanLocal)ict.lookup("HelloBean/local");
     System.out.println(hello.add(1, 1));jndi.properties不配置且,不同JVM时.试下上面的代码
      

  2.   

    @Local 有没有改为 @Remote?