无状态sessionbean调用现有的entitybean时将如何配置ejb-jar.xml和weblogic-ejb-jar.xml?(jb+wl开发)
开发环境是:jbuilder2005+weblogic 8.1
我现做了一个entitybean,并且成功开发和部署了,写了testclient也都没有问题,该entitybean名字叫做:CrabinBean。
现在我又做了一个sessionbean,叫做:TravelAgentBean,stateless,该bean的功能是调用CrabinBean,但是我遇到了一个麻烦,就是在部署的时候,如何把在TravelAgentBean的配置文件中建立其与CrabinBean的关系?我只在ejb-jar.xml中增加了如下内容:
<ejb-ref>
<ejb-ref-name>CarbinRemote</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>carbin.CarbinRemoteHome</home>
<remote>carbin.CarbinRemote</remote>
</ejb-ref>
但是rebuild TravelAgentBean的时候,出现如下错误:
"TravelAgentBean.jar": [J2EE:160119]Appc is unable to process the file 'D:\MyWork\TravelAgentEJB\TravelAgentBean.jar.jar'. The following error occurred:
"TravelAgentBean.jar": In ejb-jar.xml, the EJB 'TravelAgentBean' contains an invalid ejb-ref 'CarbinRemote'. The ejb-ref must either have an ejb-link set or an ejb-reference-description must be added to the weblogic-ejb-jar.xml descriptor for this ejb-ref.
"TravelAgentBean.jar": at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeEJBLinkJNDINames(MBeanDeploymentInfoImpl.java:267)
"TravelAgentBean.jar": at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:236)
...
我的CrabinBean是能成功运行的,现在TravelAgentBean要使用到CrabinBean,那么如何在TravelAgentBean配置,就是这样一个问题。
谢谢各位!