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.
i have the same problem the solution was:
in the war pom maven the key is provided regards
BeanClass
is not anIBeanClassService
, so even by basic java convention, you cannot assign aIBeanClass
object to that variable there, let alone inject an EJB into that spot. What you should have is