You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Ioannis Canellos (JIRA)" <ji...@apache.org> on 2010/08/12 13:18:47 UTC

[jira] Created: (SMXCOMP-789) Bean Endpoint does not properly handle CGLIB enhanced beans (Crosscutting issue)

Bean Endpoint does not properly handle CGLIB enhanced beans (Crosscutting issue)
--------------------------------------------------------------------------------

                 Key: SMXCOMP-789
                 URL: https://issues.apache.org/activemq/browse/SMXCOMP-789
             Project: ServiceMix Components
          Issue Type: Bug
          Components: servicemix-bean
    Affects Versions: servicemix-bean-2010.01, servicemix-bean-2009.02, servicemix-bean-2009.01, servicemix-bean-2008.01
            Reporter: Ioannis Canellos


If I pass to the bean endpoint a bean that is enhanced by cglib (e.g. a bean annotated with spring's @Transactional annotation), then the Delivery Channel is not properly injected to the bean.

After digging a lot I realized that the root of the problem is in the combination of CGLIB & Reflection, which can cause tons of issues and apparently that have not been taken into consideration on the bean endpoint. 

This issue probably affects other service mix components too (I've also encountered similar behavior in camel). I think that either a global solution needs to be applied or a section needs to be added in the documentation.

I am attaching a patch that contains a unit test that reproduces this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SMXCOMP-789) Bean Endpoint does not properly handle CGLIB enhanced beans (Crosscutting issue)

Posted by "Ioannis Canellos (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SMXCOMP-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ioannis Canellos updated SMXCOMP-789:
-------------------------------------

    Attachment: cglib-bean-issue.txt

The patch can be applied in the trunk of the bean endpoint.

This patch adds a test case of a bean endpoint that is passed a @Transactional annotated MessageExhcangeListener. The endpoint is properly initialized, but when a message is sent to the endpoint it results in NPE due to the fact that the DeliveryChannel is not properly injected to the bean.

> Bean Endpoint does not properly handle CGLIB enhanced beans (Crosscutting issue)
> --------------------------------------------------------------------------------
>
>                 Key: SMXCOMP-789
>                 URL: https://issues.apache.org/activemq/browse/SMXCOMP-789
>             Project: ServiceMix Components
>          Issue Type: Bug
>          Components: servicemix-bean
>    Affects Versions: servicemix-bean-2008.01, servicemix-bean-2009.01, servicemix-bean-2009.02, servicemix-bean-2010.01
>            Reporter: Ioannis Canellos
>         Attachments: cglib-bean-issue.txt
>
>
> If I pass to the bean endpoint a bean that is enhanced by cglib (e.g. a bean annotated with spring's @Transactional annotation), then the Delivery Channel is not properly injected to the bean.
> After digging a lot I realized that the root of the problem is in the combination of CGLIB & Reflection, which can cause tons of issues and apparently that have not been taken into consideration on the bean endpoint. 
> This issue probably affects other service mix components too (I've also encountered similar behavior in camel). I think that either a global solution needs to be applied or a section needs to be added in the documentation.
> I am attaching a patch that contains a unit test that reproduces this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.