Intégration Spring JMS (listener) ActiveMQ
Bonjour
Je développe une application web Gwt/spring et je souhaite configurer un listener JMS sur ActiveMQueue à fin d'intégrer un flux.
quand je démarre mon serveur (tomcat ou jetty) j'obtient l'erreur suivante si-dessous
et si j’utilise la même configuration du listener sur un projet java normal, tous ce passe très bien :)
mais pas en mode web
conf:
spring 3
tomcat 7
Gwt2.4
Code:
1 2 3 4 5 6
|
schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/jms/spring-jms-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:96)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) |
Code:
1 2 3 4 5 6 7 8
|
comexception.TechnicalException: com.exception.TechnicalException: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring/jms-service.xml]
Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 32 in XML document from class path resource [spring/jms-service.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jms:listener-container'.
at com.server.InitConfigurationServlet.init(InitConfigurationServlet.java:30)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) |
voila comment j'ai procédé :
jms-spring.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
....
<bean id="amqConnectionFactoryTest" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="tcp://localhost:61616?wireFormat.maxInactivityDuration=0" />
</bean>
<!-- Destination dans ActiveMQ -->
<bean id="destinationTest" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.test" />
</bean>
<bean id="simpleMessageListener"
class="com.services.contrat.impl.ContratAssuListener" />
<jms:listener-container container-type="default"
connection-factory="amqConnectionFactoryTest" acknowledge="auto">
<jms:listener id="monListener" destination="queue.test"
ref="simpleMessageListener" method="onMessage" />
</jms:listener-container> |