我尝试仅使用部署描述符在 EJB 3.0 中注入依赖项。当我将我的应用程序部署到 Glassfish (v3.1) 时,我得到了这个异常:
java.lang.RuntimeException: Warning : Unable to determine local business vs. remote business designation for EJB 3.0 ref Local ejb-ref name=ejb/Test2,Local 3.x interface =pl.Test2Local,ejb-link=Test2,lookup=,mappedName=,jndi-name=,refType=Session
我不知道我做错了什么。有人可以帮我吗?
ejb-jar.xml 描述符是:
<session>
<ejb-name>Test2</ejb-name>
<remote>pl.Test2Remote</remote>
<local>pl.Test2Local</local>
<ejb-class>pl.Test2</ejb-class>
<session-type>Stateless</session-type>
</session>
<session>
<ejb-name>Test</ejb-name>
<remote>pl.TestRemote</remote>
<local>pl.TestLocal</local>
<ejb-class>pl.Test</ejb-class>
<session-type>Stateless</session-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Test2</ejb-ref-name>
<local>pl.Test2Local</local>
<ejb-link>Test2</ejb-link>
<injection-target>
<injection-target-class>pl.Test</injection-target-class>
<injection-target-name>test2</injection-target-name>
</injection-target>
</ejb-local-ref>
</session>
类pl.Test:
public class Test implements TestRemote, TestLocal {
private Test2Local test2;
public Test() {
}
}