activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AMQ-1147) Spring AspectJ autoproxying breaks ActiveMQManagedConnectionFactory injection
Date Wed, 07 Mar 2007 14:13:21 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

james strachan resolved AMQ-1147.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2.0

Patch applied with thanks! I made a minor change to keep the implementation class names of
the activation spec & resource adapter the same - to avoid breaking anyones RA/RAR configurations
- so called the 2 interfaces MessageActivationSpec and MessageResourceAdapter (not the worlds
best names, but I'd rather avoid breaking things)

> Spring AspectJ autoproxying breaks ActiveMQManagedConnectionFactory injection
> -----------------------------------------------------------------------------
>
>                 Key: AMQ-1147
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1147
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>            Reporter: Christopher G. Stach II
>            Priority: Blocker
>             Fix For: 4.2.0
>
>         Attachments: AMQ-1147.patch
>
>
> The cast to the concrete class at ActiveMQManagedConnectionFactory:50 fails:
>     public void setResourceAdapter(ResourceAdapter adapter) throws ResourceException
{
>         this.adapter = (ActiveMQResourceAdapter) adapter;
> org.springframework.beans.TypeMismatchException: Failed to convert property value of
type [$Proxy63] to required type [javax.resource.spi.ResourceAdapter] for property 'resourceAdapter';
nested exception is java.lang.ClassCastException: $Proxy63 cannot be cast to org.apache.activemq.ra.ActiveMQResourceAdapter
> Caused by: java.lang.ClassCastException: $Proxy63 cannot be cast to org.apache.activemq.ra.ActiveMQResourceAdapter
>     at org.apache.activemq.ra.ActiveMQManagedConnectionFactory.setResourceAdapter(ActiveMQManagedConnectionFactory.java:50)
>     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 org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:786)
> [...]
> Spring (2.0.3 build 66) config:
> 	<aop:aspectj-autoproxy />
> 	<aop:spring-configured />
> 	<bean id="jms.managedConnectionFactory" class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
> 		<property name="resourceAdapter">
> 			<ref local="jms.resourceAdapter" />
> 		</property>
> 	</bean>
> 	<bean id="jms.resourceAdapter" class="org.apache.activemq.ra.ActiveMQResourceAdapter">
> 		<property name="serverUrl">
> 			<value>${amq.serverUrl}</value>
> 		</property>
> 	</bean>
> There's probably a workaround for this, but it's still annoying.

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


Mime
View raw message