Websphere 7和EJB 2.1 - 未指定JNDI名称
问题描述:
环境 - WAS 7.0和EJB 2.1Websphere 7和EJB 2.1 - 未指定JNDI名称
我有一个带有jar jar文件的EAR。它有一些我想要转换为本地EJB的远程EJB(EJB 2.1)。因此,我不得不按照我的理解修改ejb-jar.xml。
我修改EJB-JAR的XML文件如下:
<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
....
...
<session id="Manager">
<ejb-name>Manager</ejb-name>
<home>com.aa.bb.ManagerHome</home>
<remote>com.aa.bb.ManagerRemote</remote>
<ejb-class>com.aa.bb.Manager</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-local-ref id="EJBLocalRef_1139997836094">
<ejb-ref-name>ejb/ManagerLocalHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.aa.bb.ManagerLocalHome</local-home>
<local>com.aa.bb.ManagerLocal</local>
<ejb-link>Manager</ejb-link>
</ejb-local-ref>
,并新添加标签为本地EJB组件。
我的绑定文件如下 -
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1107442316219">
<ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
.....
.....
<ejbBindings xmi:id="EnterpriseBeanBinding_1142021363669" jndiName="ejb/ManagerLocalHome">
<enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Manager"/>
<resRefBindings xmi:id="ResourceRefBinding_1315855161720" jndiName="OraDataSource">
<bindingResourceRef href="META-INF/ejb-jar.xml#ResourceRef_1142023723001"/>
</resRefBindings>
</ejbBindings>
在EAR文件我得到以下错误的部署 -
com.ibm.websphere.management.application.client.AppDeploymentException: ADMA0014E:验证失败。 ADMA0007E:任务将EJB引用映射到企业bean时发生验证错误。
未指定Java命名和目录接口(JNDI)名称作为具有EJB名称管理器的模块ZZZZZ中的引用绑定ejb/ManagerLocalHome。
任何想法为什么它会抱怨JNDI时,它已被定义? 我错过了什么吗?
答
它看起来像jndiName应该绑定文件中的jndiName =“ejb/Manager”,它开始为我工作。 不得不运行它rhought rmic,但查找现在工作。