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
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.
|