Weblogic12c deployment EJB ambiguous error

我们两清 提交于 2019-12-11 09:36:19

问题


I'm trying to deploy the application in Weblogic 12c. During deployment, I'm getting the below error

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.

Code:

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;

... }

I'm making a call to the EJB from the web application project:

ClientClass.java

public class ClientClass{ ....

@EJB(beanName = "BeanClassService")

private IBeanClassService beanclass;

..... }

The code was working fine in weblogic10 but now in weblogic 12 exception occurs. Please help in resolving this issue.


回答1:


BeanClass is not an IBeanClassService, so even by basic java convention, you cannot assign a IBeanClass object to that variable there, let alone inject an EJB into that spot. What you should have is

  @EJB(beanName = "BeanClass")

  private IBeanClass beanclass;



回答2:


i have the same problem the solution was:

<dependency>
    <groupId>bo.sigep.modulo</groupId>
    <artifactId>moduloSigep-ejb</artifactId>
    <version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

in the war pom maven the key is provided regards



来源:https://stackoverflow.com/questions/25282983/weblogic12c-deployment-ejb-ambiguous-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!