将Spring 3.2应用程序连接到Wildfly 8.2.0
我已经在Tomcat上运行了我的Spring3.2独立应用程序,并且我正在尝试实现一个JMS通信,以独立安装在Wildfly 8.2.0上运行的HornetQ 下面是我与Wildfly 8.2.0服务器的连接配置:将Spring 3.2应用程序连接到Wildfly 8.2.0,spring,jboss,jms,hornetq,spring-jms,Spring,Jboss,Jms,Hornetq,Spring Jms,我已经在Tomcat上运行了我的Spring3.2独立应用程序,并且我正在尝试实现一个JMS通信,以独立安装在Wildfly 8.2.0上运行的HornetQ 下面是我与Wildfly 8.2.0服务器的连接配置: <bean id="hornetConnectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory"> <constructor-arg name="ha" val
<bean id="hornetConnectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">
<constructor-arg name="ha" value="false" />
<constructor-arg>
<bean class="org.hornetq.api.core.TransportConfiguration">
<constructor-arg
value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" />
<constructor-arg>
<map key-type="java.lang.String" value-type="java.lang.Object">
<!-- HornetQ standalone instance details -->
<entry key="host" value="127.0.0.1"></entry>
<entry key="port" value="8130"></entry>
</map>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<!-- ConnectionFactory Definition -->
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
<constructor-arg ref="hornetConnectionFactory" />
</bean>
<!-- Definition of the JMS incoming and outgoing queues -->
<bean id="incomingDestination" class="org.hornetq.jms.client.HornetQQueue">
<constructor-arg index="0" value="IncomingQueue"/>
</bean>
<bean id="outgoingDestination" class="org.hornetq.jms.client.HornetQQueue">
<constructor-arg index="0" value="OutgoingQueue"/>
</bean>
<!-- Definition of the producer and consumer from queues-->
<bean id="producerTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="defaultDestination" ref="outgoingDestination" />
</bean>
<bean id="consumerTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="defaultDestination" ref="incomingDestination" />
</bean>
在我的spring应用程序中,我从HornetQ 2.4.0导入了JAR,在阅读Wildfly 8.2.0规范时,我可以看到它包含2.4.5,这会是问题吗
配置中有什么遗漏吗?展示hornetConnectionFactory将是一个良好的开端。该异常意味着它无法连接到代理,此时与Spring无关。我不知道为什么,但hornetConnectionFactory在那里,但没有出现。无论如何,问题是hornetq配置与netty连接器和netty接收器设置不正确。一旦我做到了,一切都很顺利。
Mar 09, 2015 4:17:10 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/dataprocessing] threw exception [Request processing failed; nested exception is org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is HornetQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=HQ119013: Timed out waiting to receive cluster topology. Group:null]] with root cause
HornetQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=HQ119013: Timed out waiting to receive cluster topology. Group:null]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:950)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:672)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:115)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:110)
at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:342)
at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:288)
at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526)