【发布时间】:2025-12-13 03:05:02
【问题描述】:
我有 2 个 ejb,MyTestEB 位于 mytest 项目中,TestEB 位于 test 项目中。 mytest项目引用test项目
MyTestEB 中的ejb-jar.xml 文件中的mytest 项目:
<entity id="Entity_TransactionEB">
<description>Transaction Entity Bean</description>
<display-name>Transaction Entity Bean</display-name>
<ejb-name>MyTestEB</ejb-name>
<local-home>
test.transaction.ejb.TransactionLocalHome
</local-home>
<local>
test.transaction.ejb.TransactionLocal
</local>
<ejb-class>
test.transaction.ejb.TransactionBean
</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>
test.transaction.TransactionKey
</prim-key-class>
<reentrant>False</reentrant>
<resource-ref id="ResourceRef_TransactionEB_jdbc">
<res-ref-name>jdbc/DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
test.transaction.ejb.TransactionLocalHome; test.transaction.ejb.TransactionBean 和 test.transaction.TransactionKey 都在 test 项目中
TestEB 中的ejb-jar.xml 文件中的test 项目:
<entity id="Entity_TransactionEB">
<description>Transaction Entity Bean</description>
<display-name>Transaction Entity Bean</display-name>
<ejb-name>TestEB</ejb-name>
<local-home>
test.transaction.ejb.TransactionLocalHome
</local-home>
<local>
test.transaction.ejb.TransactionLocal
</local>
<ejb-class>
test.transaction.ejb.TransactionBean
</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>
test.transaction.TransactionKey
</prim-key-class>
<reentrant>False</reentrant>
<resource-ref id="ResourceRef_TransactionEB_jdbc">
<res-ref-name>jdbc/DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
当我在 Weblogic 中部署我的应用程序时,我收到了错误(错误 sn-p):
Unable to deploy EJB: MyTestEB from mytest-ejb.jar:
[EJB:011072]Unable to bind EJB Local Home Interface to the JNDI name: TestEB.
javax.naming.NameAlreadyBoundException: TestEB is already bound; remaining name ''
at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:357)
【问题讨论】:
标签: java jakarta-ee weblogic