Topic
  • 2 replies
  • Latest Post - ‏2011-05-26T16:18:12Z by SystemAdmin
SystemAdmin
SystemAdmin
462 Posts

Pinned topic Problem with CDI Injection

‏2011-05-22T21:58:20Z |
Hello,
I am getting the following exception at applicaton start. It occurs in my class WebListenerUtils implementing the @WebListener annotation (to be notified of sessionCreated and sessionDestroyed events). This class needs to inject an object of class ApplicationUtils which implements @Named and @ApplicationScoped annotations (The web listener invokes a method in the application scope class whenever a session is created/destroyed)
(The app works OK in Glassfish v3)
5/22/11 23:53:49:615 CEST 0000001e InjectInjecti E CWOWB0102E: A JCDI error has occurred: com.servengine.util.ApplicationUtils_$$_javassist_2 incompatible with javassist.util.proxy.ProxyObject
5/22/11 23:53:49:617 CEST 0000001e webapp E com.ibm.ws.webcontainer.webapp.WebApp loadLifecycleListeners SRVE0322E: The http://com.servengine.util.WebListenerUtils listener class was found, but a resource injection failure has occurred.
com.ibm.wsspi.injectionengine.InjectionException: The null factory encountered a problem getting the object instance java.lang.Object@313e4cbbinding object
at com.ibm.ws.webbeans.services.InjectInjectionBinding.errorHandling(InjectInjectionBinding.java:141)
at com.ibm.ws.webbeans.services.InjectInjectionBinding.getInjectionObject(InjectInjectionBinding.java:103)
at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectableObject(InjectionBinding.java:945)
at com.ibm.wsspi.injectionengine.InjectionTarget.inject(InjectionTarget.java:106)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.inject(AbstractInjectionEngine.java:821)

...
Caused by: java.lang.ClassCastException: com.servengine.util.ApplicationUtils_$$_javassist_2 incompatible with javassist.util.proxy.ProxyObject
at org.apache.webbeans.proxy.JavassistProxyFactory.createNormalScopedBeanProxy(JavassistProxyFactory.java:209)
at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:870)
at org.apache.webbeans.container.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:777)
at com.ibm.ws.webbeans.services.IBMBeanManagerImpl.getInjectableReference(IBMBeanManagerImpl.java:172)
at com.ibm.ws.webbeans.services.InjectInjectionObjectFactory.getInjectableReference(InjectInjectionObjectFactory.java:236)
at com.ibm.ws.webbeans.services.InjectInjectionObjectFactory.getObjectInstance(InjectInjectionObjectFactory.java:140)
at com.ibm.ws.webbeans.services.InjectInjectionBinding.getInjectionObject(InjectInjectionBinding.java:100)

Thanks for any ideas or workarrounds.
Updated on 2011-05-26T16:18:12Z at 2011-05-26T16:18:12Z by SystemAdmin
  • RohitK
    RohitK
    38 Posts

    Re: Problem with CDI Injection

    ‏2011-05-26T15:12:25Z  
    Ignacio,

    The only thing I can think of is that maybe the application scope is not active when this injection is done.

    Can you rerun the scenario to obtain a trace for CDI by specifying JCDI=all:com.ibm.ws.webbeans*=all:org.apache.webbeans*=all
    as the trace string.

    See Reference:http://publib.boulder.ibm.com/infocenter/wasinfo/beta/index.jsp
    If you can send us the application that will be even better.

    --Thanks,
    Rohit Kelapure
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: Problem with CDI Injection

    ‏2011-05-26T16:18:12Z  
    • RohitK
    • ‏2011-05-26T15:12:25Z
    Ignacio,

    The only thing I can think of is that maybe the application scope is not active when this injection is done.

    Can you rerun the scenario to obtain a trace for CDI by specifying JCDI=all:com.ibm.ws.webbeans*=all:org.apache.webbeans*=all
    as the trace string.

    See Reference:http://publib.boulder.ibm.com/infocenter/wasinfo/beta/index.jsp
    If you can send us the application that will be even better.

    --Thanks,
    Rohit Kelapure
    Sorry Rohit,
    just noticed I wrote and uploaded my message to the other CDI thread. Please find app and sources there.

    Thanks again,
    Ignacio