小弟现在开始学EJB3.0,环境都配置好了。前面发布的无状态的会话bean也很成功!
jboss里JNDI view 显示如:
BEABean (class: org.jnp.interfaces.NamingContext)
  |   +- remote (proxy: $Proxy89 implements interface com.test.ph.BEA,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
显示发布成功。测试也通过了。
而另外发布的有状态的会话bean,则显示
MyAccountBean (class: org.jnp.interfaces.NamingContext)
  |   +- remote (class: java.lang.Object)
  |   +- remoteStatefulProxyFactory (proxy: $Proxy72 implements interface org.jboss.ejb3.ProxyFactory)implements后没有实现的方法 如:com.test.ph.BEA。而多了一个remoteStatefulProxyFactory .
而我调用这个bean则显示bean不存在。
调用的方法都是:
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");try {
InitialContext ctx = new InitialContext(props);
MyAccount a = (MyAccount)ctx.lookup("MyAccountBean /remote");
out.println(a.SayHello("hello"));
} catch (NamingException e) {
out.println(e.getMessage());
}
就是发布不出来。那位高手救救我啊!