Weblogic12c部署EJB模糊错误 [英] Weblogic12c deployment EJB ambiguous error

查看:189
本文介绍了Weblogic12c部署EJB模糊错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Weblogic 12c中部署应用程序。在部署期间,我收到以下错误

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.

代码:

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;

... }

我正在调用EJB从web应用程序项目:

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

ClientClass.java

public class ClientClass{ ....

@EJB(beanName = "BeanClassService")

private IBeanClassService beanclass;

..... }

代码在weblogic10中正常工作但是现在在weblogic 12中发生异常。请帮助解决这个问题。

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

推荐答案

BeanClass 不是 IBeanClassService ,所以即使是通过基本的java惯例,也不能为该变量分配一个 IBeanClass 对象,更不用说注入一个EJB进入那个地方你应该有的是

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;

这篇关于Weblogic12c部署EJB模糊错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆