Q: Spring Jms - Lost Context i'm writing webapp that uses few workers. I decide to use JMS ActiveMQ to communication between them. My problem is that when i change workers configuration to java (when config was in xml i couldn't run jar) i have problem when message returns to webapp :
[org.springframework.jms.listener.DefaultMessageListenerContainer#4-3] WARN  o.s.j.l.DefaultMessageListenerContainer - Execution of JMS message listener failed, and no ErrorHandler has been set.
java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

Earlier i had configuration like this (in xml):
<jms:listener-container>
            <jms:listener destination="sample.reply" ref="sampleMessageListener" />
</jms:listener-container>

All worked correctly and then in my workers i change it to config like this:
@Bean
    public static DefaultMessageListenerContainer configureListener() {
            DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
            container.setDestinationName("xxxxx.xxxxx");
            container.setMessageListener(context.getBean("someBean"));
            container
                            .setConnectionFactory(context.getBean(ConnectionFactory.class));
            container.setConcurrency("5-10");
            return container;
    }

This also works but when i send message back to webapp i see problem with lost context.
