严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
提示不存在,但是用 ApplicationContext context= new ClassPathXmlApplicationContext("applicationContext.xml");可以提取到
applicationContext.xml是放在src源文件夹下面的,web.xml里的配置是
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
也试过classpath:applicationContext.xml,也不行
另外在jsp中使用了struts标签后,运行时会在后台输出web.xml里的内容
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<async-supported>false</async-supported>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<async-supported>false</async-supported>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
<cookie-config>
</cookie-config>
</session-config>
<mime-mapping>
<extension>fh7</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>fh5</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xhvml</extension>
<mime-type>application/xv+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>fh4</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>x3db</extension>
<mime-type>model/x3d+binary</mime-type>
</mime-mapping>
还有很多类似这样的内容,因为太长不截取了,现在发现如果不使用struts2标签就不会输出这些,希望高手能告诉我是怎么回事
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
提示不存在,但是用 ApplicationContext context= new ClassPathXmlApplicationContext("applicationContext.xml");可以提取到
applicationContext.xml是放在src源文件夹下面的,web.xml里的配置是
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
也试过classpath:applicationContext.xml,也不行
另外在jsp中使用了struts标签后,运行时会在后台输出web.xml里的内容
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<async-supported>false</async-supported>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<async-supported>false</async-supported>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
<cookie-config>
</cookie-config>
</session-config>
<mime-mapping>
<extension>fh7</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>fh5</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xhvml</extension>
<mime-type>application/xv+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>fh4</extension>
<mime-type>image/x-freehand</mime-type>
</mime-mapping>
<mime-mapping>
<extension>x3db</extension>
<mime-type>model/x3d+binary</mime-type>
</mime-mapping>
还有很多类似这样的内容,因为太长不截取了,现在发现如果不使用struts2标签就不会输出这些,希望高手能告诉我是怎么回事