测试访问ejb报错

ctrlaomao0382
05-03-01 1 180

小弟初使用ejb开发系统
采用的工具为eclipse2.1.3+jboss3.2.5+lomboz2
操作系统为win2000server
在项目中创建一个bmp,然后通过statless session bean调用bmp中的方法添加记录,外部使用一个client调用session bean
调试时程序报错:javax.naming.NameNotFoundException: EquipAccessBean not bound
EquipAccessBean 是我创建的session bean
其中
jboss.xml文件内容如下:
<entity>
<ejb-name>EquippedManage</ejb-name>
<jndi-name>EquippedManageBean</jndi-name>
<local-jndi-name>EquippedManageLocal</local-jndi-name>
<resource-ref>
<res-ref-name>java:/SybaseDS</res-ref-name>
<jndi-name>java:/SybaseDB</jndi-name>
</resource-ref>

</entity>

<session>
<ejb-name>EquipAccess</ejb-name>
<jndi-name>EquipAccessBean</jndi-name>
<local-jndi-name>EquipAccessLocal</local-jndi-name>
<ejb-ref>
<ejb-ref-name>ejb/EquippedManage</ejb-ref-name>
<jndi-name>EquippedManage</jndi-name>
</ejb-ref>

</session>
而ejb-jar.xml内容如下:
<session >
<description><![CDATA[]]></description>

<ejb-name>EquipAccess</ejb-name>

<home>com.harmony.bw.ejb.session.EquipAccessHome</home>
<remote>com.harmony.bw.ejb.session.EquipAccess</remote>
<local-home>com.harmony.bw.ejb.session.EquipAccessLocalHome</local-home>
<local>com.harmony.bw.ejb.session.EquipAccessLocal</local>
<ejb-class>com.harmony.bw.ejb.session.EquipAccessSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

<ejb-ref >
<ejb-ref-name>ejb/EquippedManage</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.harmony.bw.ejb.bmp.EquippedManageHome</home>
<remote>com.harmony.bw.ejb.bmp.EquippedManage</remote>
<ejb-link>EquippedManage</ejb-link>
</ejb-ref>

</session>

<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->

<!-- Entity Beans -->
<entity >
<description><![CDATA[]]></description>

<ejb-name>EquippedManage</ejb-name>

<home>com.harmony.bw.ejb.bmp.EquippedManageHome</home>
<remote>com.harmony.bw.ejb.bmp.EquippedManage</remote>
<local-home>com.harmony.bw.ejb.bmp.EquippedManageLocalHome</local-home>
<local>com.harmony.bw.ejb.bmp.EquippedManageLocal</local>

<ejb-class>com.harmony.bw.ejb.bmp.EquippedManageBMP</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.harmony.bw.ejb.bmp.EquippedManagePK</prim-key-class>
<reentrant>False</reentrant>

<resource-ref >
<res-ref-name>java:/SybaseDS</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

</entity>
请各位前辈帮我会诊一下,错误到底出在那里?谢谢

ctrlaomao0382
2005-03-01 15:53

jboss.xml和ejb-jar.xml无法完全显示,抱歉