[weld-issues] [JBoss JIRA] (WELD-1110) Should be able to Decorate EJB

Marko Lukša (JIRA) jira-events at lists.jboss.org
Fri Apr 20 08:56:18 EDT 2012


    [ https://issues.jboss.org/browse/WELD-1110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12686044#comment-12686044 ] 

Marko Lukša commented on WELD-1110:
-----------------------------------

Aslak, your test has an error. You need to introduce an interface and have both {{MessageSender}} and {{MessageDecorator}} implement that interface. The CDI spec says "The set of decorated types of a decorator includes all bean types of the managed bean which are Java interfaces, except for java.io.Serializable. The decorator bean class and its superclasses are not decorated types of the decorator.".

I fixed the test and the error(s) were gone, but the decorator still wasn't invoked. After moving the web service into a separate class and injecting the session bean into it, the decorator was invoked and everything worked as it should.


                
> Should be able to Decorate EJB
> ------------------------------
>
>                 Key: WELD-1110
>                 URL: https://issues.jboss.org/browse/WELD-1110
>             Project: Weld
>          Issue Type: Bug
>          Components: Interceptors and Decorators
>    Affects Versions: 1.1.5.Final
>            Reporter: Aslak Knutsen
>            Assignee: Marko Lukša
>
> Should be possible to Decorate a EJB
> {code}
> Caused by: org.jboss.weld.exceptions.CreationException: WELD-000079 Could not find the EJB in JNDI:  class de.jax.demo.rest.MessageEndpoint$Proxy$_$$_Weld$Proxy$
> 	at org.jboss.weld.bean.SessionBean.create(SessionBean.java:306) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at de.jax.demo.rest.MessageEndpoint$Proxy$_$$_WeldClientProxy.listAll(MessageEndpoint$Proxy$_$$_WeldClientProxy.java) [classes:]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_147-icedtea]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_147-icedtea]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_147-icedtea]
> 	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_147-icedtea]
> 	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
> 	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
> 	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
> 	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
> 	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
> 	... 23 more
> Caused by: java.lang.NullPointerException
> 	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:672) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.proxy.DecorationHelper.createMethodHandler(DecorationHelper.java:81) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.proxy.DecorationHelper.getNextDelegate(DecorationHelper.java:94) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.SessionBean.applyDecorators(SessionBean.java:319) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	at org.jboss.weld.bean.SessionBean.create(SessionBean.java:298) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
> 	... 36 more
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the weld-issues mailing list