MVC Project cross talk
I am using Eclipse Juno with Spring STS 3.1.0. I have 2 mvc projects in
the same workspace. One of the projects can send and receive jms messages.
It uses a Spring JmsMessagListener bean to receive messages. The bean maps
to a listener class with an onMessage method. When I run the project
withoug jms in on the VMWare tc server, I get the following message in the
console every 5 seconds:
WARN : org.springframework.jms.listener.DefaultMessageListenerContainer -
Could not refresh JMS Connection for destination 'mht.alert.queue' -
retrying in 5000 ms. Cause: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.ConnectException: Connection timed
out: connect
The project seems to be attempting to connect to my activemq broker which
is not running since I am not running the project with jms built in. I
don't understand why this should happen. I have included the web.xml files
for the two projects. Hopefully someone can give me a clue as to why this
is happening. It's not a showstopper as I can ignore the messages or bring
up the broker to silence them, however it would be best to deal with it
properly.
Thanks in advance
Here is the web.xml file for the project that does not have jms:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns
/javaee/web-app_3_0.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Here is the web.xml file for the project with jms built in:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml,
/WEB-INF/spring/jms-config.xml,
/WEB-INF/spring/security-config.xml,
/WEB-INF/spring/datasource-tx.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--<start id="filter_security" /> -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<!--<end id="filter_security" />-->
<!--<start id="filter_mapping_security" /> -->
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--<end id="filter_mapping_security" />-->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- This servlet is mapped to all requests at the root level -->
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Here is the contents of my root-context.xml, not that spring-security.xml
is commented out
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<!-- Root Context: defines shared resources visible to all other web
components -->
<!-- Import the datasource-tx.xml file to configure the StudentDao
service and make
it visible to the entire application
-->
<import resource="classpath:datasource-tx.xml" />
<!-- <import resource="spring-security.xml" /> -->
</beans>
No comments:
Post a Comment