我查了半天,网上都说是web.xml的问题,下面是我的web.xml:<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<!-- 添加Spring Listener支持 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener><!-- struts2 支持 -->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    
<!-- 提供对hibernate延迟加载的支持 -->
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>lazyLoadingFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping><!-- welcome setting -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
其中问题就出现struts2那一段,只要我把那一段去掉就正常启动,一加上就报错:
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-8-17 18:37:18 org.apache.catalina.core.StandardContext start
严重: Context [/compass1] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
我的struts是struts2.0.14,导入的lib包是下载包里的Blank.war工程的实例里面的lib,struts.xml中配置的是Spring接管action,应该没问题:
<struts>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="product" extends="struts-default" namespace="/product">

<action name="insert" class="productBean" method="insert">
<result>/product/insertOk.jsp</result>
</action>

</package>

</struts>其中的productBean已经在spring中配置过了。先谢谢各位了,我已经没分了...抱歉了....

解决方案 »

  1.   

    我错了....忘了加struts-spring-plugin.jar了.....楼下赶紧来个人我要结贴啊
      

  2.   

       <url-pattern>/*.do </url-pattern> 或
       <url-pattern>/do/* </url-pattern>
      

  3.   

    我也老是遇到LZ的问题,开始是在寝室自己的电脑上运行就没错,但是将自己电脑上的project拷到学校机房去然后导入myeclipse的工作区,就要报上面的错:严重: Error filterStart!每次都是这样,整得我很郁闷,每次实验都做不成!希望高手出来帮忙解决下啊!