我从我的独立应用程序中获得以下异常,我尝试使用spring-jms连接到weblogic。它是一个安全的JMS队列(weblogic用户名和密码)。
2016-02-17 11:04:34.701 ERROR 5145 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer:无法刷新目的地的JMS连接&#cceBaseSenderQueue' - 使用FixedBackOff重试{interval = 5000,currentAttempts = 38,maxAttempts = unlimited}。原因:AOP配置似乎无效:尝试在目标[CCE JMS系统模块!CCE基本发件人队列]上调用方法[public abstract javax.jms.Connection javax.jms.ConnectionFactory.createConnection()throws javax.jms.JMSException];嵌套异常是java.lang.IllegalArgumentException:java.lang.ClassCastException@1395540d
我的弹簧配置如下,
<bean id="jndiTemplate1" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://myhost:6301</prop>
</props>
</property>
</bean>
<!-- JMS Destination Resolver -->
<bean id="jmsDestinationResolver1" class="org.springframework.jms.support.destination.JndiDestinationResolver">
<property name="jndiTemplate" ref="jndiTemplate1" />
<property name="cache" value="true" />
</bean>
<!-- JNDI Object Factory Bean -->
<bean id="connectionFactory1" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate1" />
</property>
<property name="jndiName">
<value>cceBaseSenderQueue</value>
</property>
<property name="lookupOnStartup" value="false" />
<property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>
...我的Listener类的java代码如下,
messageListenerContainer = new DefaultMessageListenerContainer();
ConnectionFactory connectionFactory = cbsJmsConfiguration.getJmsConnectionFactory();
LOGGER.info("Connection Factory [{}]", connectionFactory.toString());
messageListenerContainer.setConnectionFactory(connectionFactory);
messageListenerContainer.setDestinationResolver(cbsJmsConfiguration.getJmsDesinationResolver());
messageListenerContainer.setConcurrentConsumers(Constants.ONE_MESSAGE);
LOGGER.info("Destination Name [{}]", jmsQueueName);
messageListenerContainer.setDestinationName(jmsQueueName);
messageListenerContainer.setMessageListener(this);
messageListenerContainer.afterPropertiesSet();
messageListenerContainer.start();
我的知名度中有以下罐子,
JMS-1.1.1.jar 弹簧JMS-4.1.7.RELEASE.jar wljmsclient-10.3.6.0.jar wlthint3client-10.3.6.0.jar
我错过了什么吗?