activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiri Patera (JIRA)" <>
Subject [jira] [Commented] (AMQ-4189) PooledConnectionFactory with JmsTemplate results in MalformedParameterizedTypeException
Date Wed, 05 Dec 2012 14:46:59 GMT


Jiri Patera commented on AMQ-4189:

I can see that the {{activemq-pool}} artifact depends on the {{commons-pool:1.6}} artifact:

[INFO] +- org.apache.activemq:activemq-pool:jar:5.7.0:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] |  +- org.apache.activemq:activemq-core:jar:5.7.0:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:compile
[INFO] |  \- commons-pool:commons-pool:jar:1.6:compile

What happened in our case was that in the project we had the {{commons-pool:1.5.4}} artifact
placed closer to the dependency tree root and, thus, it was winning:


That produces the following dependency tree ({{mvn dependency:tree -Dverbose -Dincludes=:commons-pool:}}):

[INFO] com.gk-software.test:test-b:jar:1.0.0-SNAPSHOT
[INFO] +- org.apache.activemq:activemq-pool:jar:5.7.0:compile
[INFO] |  \- (commons-pool:commons-pool:jar:1.6:compile - omitted for conflict with 1.5.4)
[INFO] \- commons-pool:commons-pool:jar:1.5.4:compile

The problematic method is: 
{{public org.apache.commons.pool.ObjectPoolFactory org.apache.activemq.pool.PooledConnectionFactory.getPoolFactory()}}

Its return type is being inspected by the following method: {{org.springframework.core.GenericTypeResolver.resolveReturnType(Method,

Which in turn calls Java Reflection API: {{method.getGenericReturnType()}}

And this produces the {{java.lang.reflect.MalformedParameterizedTypeException}} exception
in case the {{commons-pool:1.5.4}} is on the classpath instead of the correct {{commons-pool:1.6}}.

So from my point of view this is not an issue of the {{activemq-pool}} artifact, but of a
Maven dependency tree (or classpath) in the user's project.
> PooledConnectionFactory with JmsTemplate results in MalformedParameterizedTypeException
> ---------------------------------------------------------------------------------------
>                 Key: AMQ-4189
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: activemq-pool
>    Affects Versions: 5.7.0
>         Environment: Tomcat 7.0.27
> Spring 3.1.2
>            Reporter: Pragadeesh Prakasam
>         Attachments:, jms-local-test.xml
>   <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
>   <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
>   <!-- Spring JMS Template -->
>   <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
>     <property name="connectionFactory">
>       <!-- lets wrap in a pool to avoid creating a connection per send -->
>       <bean class="org.springframework.jms.connection.SingleConnectionFactory">
>         <property name="targetConnectionFactory">
>           <ref local="jmsFactory" />
>         </property>
>       </bean>
>     </property>
>   </bean>
> here if we use org.apache.activemq.pool.PooledConnectionFactory  instead of org.springframework.jms.connection.SingleConnectionFactory,

> we are receiving org.springframework.beans.factory.BeanCreationException: Initialization
of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException

> We got this when we upgraded from ActiveMQ 5.4 to 5.7

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message