Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-381

Proxied EJBs as Injection point, wrong interface chosen

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate Issue
    • 1.0.0.GA
    • 1.0.1.CR1
    • Resolution
    • None

    Description

      Based on the forum post, The following EJB cannot be injected into clients:

      @DAO
      @Local(ResultDAOBean.class)
      @Stateless
      public ResultDAO extends AbstractDAO<Result> implements ResultDAOBean

      Happens the same with/without @Local

      The problem comes in when AbstractDAO implements something (e.g. AbstractDAOBean<E>) or ResultDAOBean extends an interfacet (e.g.AbstractDAOBean<E>). The interface AbstractDAOBean isn't marked as an EJB itnerface, and only one of these two would implement/extend it (ideally, ResultDAOBean).

      The injection point results in the following exception:

      Caused by: java.lang.IllegalStateException: Unable to convert ejbRef for ejb ResultDAO to a business object of type interface AbstractDAOBean
      at com.sun.ejb.containers.EjbContainerServicesImpl.getBusinessObject(EjbContainerServicesImpl.java:104)
      at org.glassfish.weld.ejb.SessionObjectReferenceImpl.getBusinessObject(SessionObjectReferenceImpl.java:60)
      at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:121)
      at jpa.dao.EvaluationDAOBean_$$javassist_110.getEM(EvaluationDAOBean$$_javassist_110.java)
      at NewSessionBean.init(NewSessionBean.java:30)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1006)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:61)
      at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:109)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCallback(SystemInterceptorProxy.java:133)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:115)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:961)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:61)
      at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:390)
      at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:373)
      at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:518)
      ... 38 more

      Attachments

        Issue Links

          Activity

            People

              pmuiratbleepbleep Pete Muir
              meetoblivion_jira John Ament (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: