我正在尝试在Weblogic 12c中部署该应用程序。在部署期间,我收到以下错误
weblogic.management.DeploymentException: weblogic.application.naming.ReferenceResolutionException: [J2EE:160092]Error: The ejb-link "BeanClass" declared in the ejb-ref or ejb-local-ref "...BeanClassService/beanClass" in the module "....EJB.jar" is ambiguous. Qualify this ejb-link to remove the ambiguity.
代码:
IBeanClass.java
@Local
public interface IBeanClass {}
BeanClass.java
@Stateless(name = "BeanClass")
@PermitAll
public class BeanClass implements IBeanClass { ...... }
IBeanClassService.java
@Local
public interface IBeanClassService { ......... }
BeanClassService.java
@Stateless(name = "BeanClassService")
public class BeanClassService implements IBeanClassService {
@EJB(beanName = "BeanClass")
private IBeanClassService beanclass;
... }
我正在从Web应用程序项目调用EJB:
ClientClass.java
public class ClientClass{ ....
@EJB(beanName = "BeanClassService")
private IBeanClassService beanclass;
..... }
代码在weblogic10中工作正常但现在在weblogic 12中发生异常。请帮助解决这个问题。
答案 0 :(得分:1)
BeanClass
不是IBeanClassService
,因此即使是基本的java约定,也不能在那里为该变量分配IBeanClass
对象,更不用说将EJB注入该位置了。你应该拥有的是
@EJB(beanName = "BeanClass")
private IBeanClass beanclass;
答案 1 :(得分:0)
解决方案有同样的问题:
<dependency>
<groupId>bo.sigep.modulo</groupId>
<artifactId>moduloSigep-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
战争中的pom maven
密钥是提供的
问候