这就是我在jboss 5.x上部署带有远程接口的简单无状态会话bean(slsb)时得到的:
01:52:07,313 INFO [JBossASKernel] Created KernelDeployment for: sandbox-services-1.0-SNAPSHOT.jar
01:52:07,313 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3
01:52:07,314 INFO [JBossASKernel] with dependencies:
01:52:07,314 INFO [JBossASKernel] and demands:
01:52:07,314 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
01:52:07,314 INFO [JBossASKernel] and supplies:
01:52:07,314 INFO [JBossASKernel] Class:com.stackoverflow.q2440956.samples.services.hello.Echo
01:52:07,314 INFO [JBossASKernel] jndi:EchoBean/remote-com.stackoverflow.q2440956.samples.services.hello.Echo
01:52:07,314 INFO [JBossASKernel] jndi:EchoBean/remote
01:52:07,314 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3) to KernelDeployment of: sandbox-services-1.0-SNAPSHOT.jar
01:52:07,315 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@a130d1{name=jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
01:52:07,381 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3
01:52:07,382 INFO [EJBContainer] STARTED EJB: com.stackoverflow.q2440956.samples.services.hello.EchoBean ejbName: EchoBean
01:52:07,412 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
EchoBean/remote - EJB3.x Default Remote Business Interface
EchoBean/remote-com.stackoverflow.q2440956.samples.services.hello.Echo - EJB3.x Remote Business Interface
当我查看您提供的跟踪时,我看不到与远程接口相关的任何内容(您需要进行远程调用),因此,它没有JNDI名称。所以问题是:您的SLSB是否正确地定义和实现了远程接口?
在我的例子中,我的bean的定义如下:
@Stateless
public class EchoBean implements Echo {
...
}
远程接口如下:
@Remote
public interface Echo {
String echo(final String in);
}
你有类似的东西吗?