[英]Weblogic12c deployment EJB ambiguous error
I'm trying to deploy the application in Weblogic 12c. 我正在尝试在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 IBeanClass.java
@Local
public interface IBeanClass {}
BeanClass.java BeanClass.java
@Stateless(name = "BeanClass")
@PermitAll
public class BeanClass implements IBeanClass { ...... }
IBeanClassService.java IBeanClassService.java
@Local
public interface IBeanClassService { ......... }
BeanClassService.java 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: 我正在从Web应用程序项目中调用EJB:
ClientClass.java 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. 该代码在weblogic10中工作正常,但现在在weblogic 12中发生异常。 Please help in resolving this issue.
请帮助解决此问题。
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. BeanClass
不是IBeanClassService
,因此即使按照基本的Java约定,也无法将IBeanClass
对象分配给该变量,更不用说将EJB注入该位置了。 What you should have is 你应该拥有的是
@EJB(beanName = "BeanClass")
private IBeanClass beanclass;
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 在战争pom maven中,提供关键的问候
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.