我在MyTestEB
项目中有2个ejb(s),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中部署我的应用程序时,我收到了错误(错误代码段):
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)
答案 0 :(得分:1)
<jndi-name>...</jndi-name>
你可以在这里详细介绍
resource-description from Oracle Doc
这里提到了ejb-jar.xml中可以提到的完整列表
docs.oracle.com/cd/E23943_01/web.1111/e13719/ejb_jar_ref.htm#i1114706