activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pragadeesh Prakasam (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMQ-4189) PooledConnectionFactory with JmsTemplate results in MalformedParameterizedTypeException
Date Fri, 30 Nov 2012 17:09:59 GMT

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

Pragadeesh Prakasam updated AMQ-4189:
-------------------------------------

    Attachment: jms-local-test.xml
                ConnectionPoolTest.java

Attached are spring xml config file and just a simple junit test. It does not test anything.
You will be able to see the issue when you actually run the test during loading application
context. I have also included the code for singleConnectionFactory (commented out in xml)
which runs successfully. 

Junit4; Spring 3.1 and ActiveMQ 5.7

Stack trace: 
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'jmsPooledConnectionFactory' defined in class path resource [spring/jms-local-test.xml]:
Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
	at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228)
	at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
	... 24 more
Caused by: java.lang.reflect.MalformedParameterizedTypeException
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:35)
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
	at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
	at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
	at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
	at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:50)
	at java.lang.reflect.Method.getGenericReturnType(Method.java:236)
	at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:98)
	at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.java:129)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.isExcludedFromDependencyCheck(AbstractAutowireCapableBeanFactory.java:1269)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.filterPropertyDescriptorsForDependencyCheck(AbstractAutowireCapableBeanFactory.java:1245)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1101)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
	... 37 more

                
> PooledConnectionFactory with JmsTemplate results in MalformedParameterizedTypeException
> ---------------------------------------------------------------------------------------
>
>                 Key: AMQ-4189
>                 URL: https://issues.apache.org/jira/browse/AMQ-4189
>             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: ConnectionPoolTest.java, 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: http://www.atlassian.com/software/jira

Mime
View raw message