将Spring 3.2应用程序连接到Wildfly 8.2.0

时间:2015-03-09 16:37:17

标签: spring jboss jms hornetq spring-jms

我已经在Tomcat上运行了我的Spring 3.2独立应用程序,我试图在Wildfly 8.2.0上运行HornetQ的独立安装JMS Comunication

下面是我对Wildfly 8.2.0服务器的连接配置:

<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>

但是当我启动服务器并尝试对应该将消息发送到队列的控制器执行REST调用时,我发现了以下错误:

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)

在我的春季应用程序中,我从HornetQ 2.4.0导入了罐子,在阅读Wildfly 8.2.0规格时,我可以看到它包含2.4.5,这可能是问题吗?

我是否遗漏了配置中的内容?

0 个答案:

没有答案