我正在使用JBoss AS 5.0.1并且当我尝试调用我的Servlet时收到以下错误。
17:11:48,060 ERROR [STDERR] javax.naming.NameNotFoundException: EJBSvcApp not bound
我已经通过我添加了EJB和Web项目的Above名称创建了一个EAR。 我在Web App的部署程序集中也包含了EJBClient。以下是JBoss日志跟踪。我还在日志中看到一个警告,我不确定它是什么。
17:09:27,962 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@457214762{vfszip:/C:/jboss- 5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
7:09:27,986 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
17:09:33,622 INFO [JBossASKernel] Created KernelDeployment for: EJBSvcEJB.jar
17:09:33,626 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,626 INFO [JBossASKernel] with dependencies:
17:09:33,626 INFO [JBossASKernel] and demands:
17:09:33,627 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
17:09:33,627 INFO [JBossASKernel] and supplies:
17:09:33,627 INFO [JBossASKernel] Class:com.webpage.ejb.Order
17:09:33,627 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3) to KernelDeployment of: EJBSvcEJB.jar
17:09:33,776 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,786 INFO [EJBContainer] STARTED EJB: com.webpage.ejb.OrderBean ejbName: OrderBean
17:09:33,791 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
17:09:33,850 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@6012d7fe{OrderBean}
17:09:33,928 INFO [TomcatDeployment] deploy, ctxPath=/EJBSvcWeb
我创建了一个EJB接口
@Remote()
public interface Order {...
和Bean
@Stateless(name = "OrderBean")
public class OrderBean implements Order { ...
我在My Servlet中进行查找,如下所示
Order o = (Order)(new InitialContext()).lookup("EJBSvcApp/OrderBean/remote");
答案 0 :(得分:0)
我对这部分感到好奇:
[Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
It seems to be that the problem是Jboss AS 5.1.0 GA的错误。
如果我正确理解了帖子,那么问题就产生了,因为你有一个空的META-INF / ejb-jar.xml文件。
我会尝试:
a)删除文件。 (我认为这就够了)。
b)或尝试用下一个填充它:
<ejb-jar version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
</ejb-jar>