0

我正在使用与 spring integration 2.1.3 和 spring 3.0.5 集成的 activemq 3.7 和 activemq pool 3.7 库。当我尝试像这样定义connectionFactory时,出现以下异常

<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory">
        <bean class="org.apache.activemq.pool.PooledConnectionFactory"
            destroy-method="stop">
            <property name="connectionFactory">
                <bean class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
                    <constructor-arg name="brokerURL" value="${jms.broker.url}" />
                </bean>
            </property>
        </bean>
    </property>
    <property name="sessionCacheSize" value="10" />
    <property name="cacheProducers" value="false" />
</bean>

这是一个例外:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource 
[META-INF/integration-context.xml]: 
Cannot create inner bean 'org.apache.activemq.pool.PooledConnectionFactory#1445748' 
of type [org.apache.activemq.pool.PooledConnectionFactory] 
while setting bean property 'targetConnectionFactory'; nested exception is 
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.apache.activemq.pool.PooledConnectionFactory#1445748' 
defined in class path resource [META-INF/integration-context.xml]: 
Initialization of bean failed; 
nested exception is java.lang.reflect.MalformedParameterizedTypeException

如果我使用 ActiveMQConnectionFactory 而不是 PooledConnectionFactory 一切都部署得很好但我有性能我有性能问题。

4

2 回答 2

0

第一:你能显示堆栈跟踪的其余部分以及“jms.broker.url”属性的值吗?

第二:如果您使用 Spring 的“缓存”CF 进行包装,则实际上没有必要使用“池化”CF

于 2012-11-30T17:43:28.037 回答
0

Spring 使用无界通配符方法抛出异常:

public ObjectPoolFactory<?> getPoolFactory() {
    return null;
}

虽然还没有找到解决方案。

于 2013-06-28T08:37:21.917 回答