我有 2 个模块:ejb 和 war,以及包含它们的 Ear 模块。模块构建成功,但是当我尝试将 Ear 部署到 glassfish 时,收到此错误:
glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=17;_ThreadName=Thread-2;|Exception while deploying the app [EarModule] : Invalid ejb jar [BackEnd-1.0-SNAPSHOT.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.|#]
我真的不知道该怎么办,我发现了很多像我这样的问题,但没有解决。
最佳答案
我明白了,出了什么问题。问题出在运行配置中,我正在使用 Intellij Idea,并且在运行配置中,在运行我的耳朵模块之前进行了构建和制作。我删除了它,并在 Maven 安装后成功部署。
关于glassfish - 无效的 ejb jar : it contains zero ejb.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15333410/