Weblogic无法部署EJB javax.naming.NameAlreadyBoundException
我在Weblogic无法部署EJB javax.naming.NameAlreadyBoundException,java,jakarta-ee,weblogic,Java,Jakarta Ee,Weblogic,我在mytest项目中有两个ejb,MyTestEB,在test项目中有TestEBmytest项目对测试的引用项目 mytest项目中的ejb jar.xml文件中的MyTestEB: <entity id="Entity_TransactionEB"> <description>Transaction Entity Bean</description> <display-name>Transaction Enti
mytest
项目中有两个ejb,MyTestEB
,在test
项目中有TestEB
<代码>mytest项目对测试的引用
项目
mytest
项目中的ejb jar.xml
文件中的MyTestEB
:
<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>
<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中部署应用程序时,出现错误(错误片段):
当有多个实例试图绑定到JNDI树时,会出现“JNDI名称已绑定”。您可以通过打开控制台->域->服务器来检查原因。选择托管服务器并选择JNDI树选项。这将告诉你谁取了这个名字。
您也可以在XML中这样做,将JNDI指定为
…
你可以在这里参考更多关于这方面的信息
这里提到了ejb-jar.xml中可以提到的所有内容
非常感谢,您的回答建议我转到
mytest
项目中的weblogic ejb jar.xml
,并将TestEB
更改为MyTestEB
,这样错误就被修复了。
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)