我在Jboss 4.2.3中部署了EJB3。我现在如何访问它?我没有在控制台中看到任何JNDI名称或任何内容。下面是EJB部署的堆栈跟踪。

如何编写客户端以访问ExtractorDAOImpl中的方法?

15:38:48,535 INFO [EARDeployer] Init J2EE application: file:/C:/ejbtest/jboss-4.2.3.GA/server/default/deploy/mytestejb.ear15:38:48,804 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer15:38:48,811 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mytestejb.ear,jar=mytestejb-ejb-1.0-SNAPSHOT.jar,name=ExtractorDAOImpl,service=EJB3 with dependencies:15:38:48,848 INFO [EJBContainer] STARTED EJB: com.myorg.mytestejb.dao.ExtractorDAOImpl ejbName: ExtractorDAOImpl15:38:48,889 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer15:38:48,889 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mytestejb.ear,jar=mytestejb-ejb-1.0-SNAPSHOT.jar,name=Extractor,service=EJB3 with dependencies:15:38:48,899 INFO [EJBContainer] STARTED EJB: com.myorg.mytestejb.Extractor ejbName: Extractor15:38:48,938 INFO [EJB3Deployer] Deployed: file:/C:/ejbtest/jboss-4.2.3.GA/server/default/tmp/deploy/tmp19095mytestejb.ear-contents/mytestejb-ejb-1.0-SNAPSHOT.jar15:38:48,946 INFO [EARDeployer] Started J2EE application: file:/C:/ejbtest/jboss-4.2.3.GA/server/default/deploy/mytestejb.ear

最佳答案

我没有在控制台中看到任何JNDI名称或任何内容


在[myServer]:8080 / jmx-console /

1)转到“服务= JNDIView”。

2)调用MBean操作:java.lang.String list()

3)它会向您显示“全局JNDI命名空间”树,您可以在其中看到与ejb关联的JNDI条目。

您将看到如下内容:

+-耳名
| +-myEjbName
| +-本地

对于此示例,用于查找本地接口的JNDI名称为“ EarName / myEjbName / local”

07-24 21:15