activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher G. Stach II (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AMQ-1147) Spring AspectJ autoproxying breaks ActiveMQManagedConnectionFactory injection
Date Fri, 02 Feb 2007 14:24:02 GMT

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

Christopher G. Stach II updated AMQ-1147:
-----------------------------------------

    Attachment: AMQ-1147.patch

This patch takes care of the issue.  It's really messy because I had to add Javadocs all over
to get Eclipse to compile the files.  ( My project settings require Javadocs, comments in
empty blocks, no unnecessary else blocks, etc., but I was too tired to change them.)  Here's
basically what I had to do:

* Extract interfaces for ActiveMQActivationSpec and ActiveMQResourceAdapter
* AMQRAImpl: Fix a couple AMQActivationSpec  equality checks
* AMQRAImpl: Use method calls on the AMQRA interface instead of field access in equals
* AMQMCF: Added instanceof check in setResourceAdapter


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