I am testing jms support in Spring Integration and get an exception when I use the outbound-gateway. I have been able to successfully test the inbound and outbound channel adapters.

Here is my config file:
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingC onnectionFactory">
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFacto ry">
<property name="brokerURL" value="vm://localhost" />
</bean>
</property>
<property name="sessionCacheSize" value="10" />
<property name="cacheProducers" value="false" />
</bean>

<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.demo" />
</bean>
<bean id="replyQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.reply" />
</bean>

<sioller id="poller" default="true">
<si:interval-trigger interval="1000" />
</sioller>

<siublish-subscribe-channel id="dataInputChannel"/>
<si:gateway service-interface="com.lmco.jmsexample.Gateway" id="theGateway" default-request-channel="dataInputChannel"/>
<bean class="com.lmco.jmsexample.Dispatcher">
<property name="gateway" ref="theGateway"/>
</bean>

<jms:outbound-gateway request-channel="dataInputChannel"
request-destination="requestQueue"
reply-channel="jmsReplyToStdoutChannel"/>

<si:channel id="jmsReplyToStdoutChannel"/>

<stream:stdout-channel-adapter channel="jmsReplyToStdoutChannel" append-newline="true"/>

Here is the exception I get:
org.springframework.beans.MethodInvocationExceptio n: Property 'gateway' threw exception; nested exception is org.springframework.integration.message.MessageTim eoutException: failed to receive JMS response within timeout of: 5000ms