关于servlet里调用ejb
ejb-jar.xml里的配置
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>EJB1</display-name>
<enterprise-beans>
<session>
<ejb-name>Enterprise2</ejb-name>
<home>ejbservlet.Enterprise2Home</home>
<remote>ejbservlet.Enterprise2</remote>
<ejb-class>ejbservlet.Enterprise2Bean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Enterprise2</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
web.xml中的配置
<web-app>
<display-name>web</display-name>
<ejb-ref>
<ejb-ref-name>ejb/Enterpries2</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>ejbservlet.Enterprise2Home</home>
<remote>ejbservlet.Enterprise2</remote>
<ejb-link>Enterpries2</ejb-link>
</ejb-ref>
</web-app>
试了能有三四十遍了,一次也没成功过,
错误总是这一句:
<2006-3-8 下午09时22分30秒 CST> <Error> <J2EE> <BEA-160131> <Error deploying web: with deployment error Could not load web and nested error weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'Enterpries2' declared in the ejb-ref or ejb-local-ref 'ejb/Enterpries2' in the application module 'web' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.>
请大家帮着看看到底是哪里有问题,
问题点数:100、回复次数:1Top
1 楼doway(john)回复于 2006-03-08 22:55:12 得分 100
<ejb-link>Enterpries2</ejb-link>
这句删掉看看,可能用不着。
Top




