Spring mvc MVC项目串扰
我在SpringSTS3.1.0中使用EclipseJuno。我在同一个工作区中有两个mvc项目。其中一个项目可以发送和接收jms消息。它使用Spring JmsMessagListener bean来接收消息。bean映射到具有onMessage方法的侦听器类。当我在VMWare tc服务器上运行不带jms的项目时,每5秒控制台中就会收到以下消息: 警告:org.springframework.jms.listener.DefaultMessageListenerContainer-无法刷新目标“mht.alert.queue”的jms连接-在5000毫秒内重试。原因:无法连接到代理URL:tcp://localhost:61616. 原因:java.net.ConnectException:连接超时:连接 该项目似乎正在尝试连接到我的activemq代理,该代理没有运行,因为我没有运行内置jms的项目。我不明白为什么会这样。我已经包含了这两个项目的web.xml文件。希望有人能给我一个关于为什么会发生这种情况的线索。这不是一个阻碍,因为我可以忽略这些消息,或者让代理让它们保持沉默,但是最好妥善处理 提前谢谢 以下是没有jms的项目的web.xml文件:Spring mvc MVC项目串扰,spring-mvc,Spring Mvc,我在SpringSTS3.1.0中使用EclipseJuno。我在同一个工作区中有两个mvc项目。其中一个项目可以发送和接收jms消息。它使用Spring JmsMessagListener bean来接收消息。bean映射到具有onMessage方法的侦听器类。当我在VMWare tc服务器上运行不带jms的项目时,每5秒控制台中就会收到以下消息: 警告:org.springframework.jms.listener.DefaultMessageListenerContainer-无法刷新目
<?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>
上下文配置位置
/WEB-INF/spring/root-context.xml
org.springframework.web.context.ContextLoaderListener
appServlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/spring/appServlet/servlet-context.xml
1.
appServlet
/
以下是内置jms的项目的web.xml文件:
<?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>
上下文配置位置
/WEB-INF/spring/root-context.xml,
/WEB-INF/spring/jms-config.xml,
/WEB-INF/spring/security-config.xml,
/WEB-INF/spring/datasource-tx.xml
org.springframework.web.context.ContextLoaderListener
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*
appServlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/spring/appServlet/servlet-context.xml
1.
appServlet
/
下面是我的root-context.xml的内容,而不是注释掉的spring-security.xml
<?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>
您是否绝对确定/WEB-INF/spring/root context.xml
没有JMS配置?请张贴的内容。我仔细检查,它是在那里,但被注释掉了