整合SSH报错

来源:百度知道 编辑:UC知道 时间:2024/09/25 05:51:32
java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!
估计是什么错误呢?
这个我也能看懂啦
我在web。xml加了格这

<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

是和监听器冲突了吗

IllegalStateException:环境没有处于请求操作所要求的适当状态下。
不能初始化环境,因为已经有一个application-context存在,检查你的web.xml文件看是否定义了多个ContextLoader.

<!-- Spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext*.xml
</param-value>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Struts -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-