在用mye和tomcat开发时,遇到了下面问题:严重: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDisptcher
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:249)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2010-3-24 7:26:40 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-3-24 7:26:40 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors
2010-3-24 7:26:40 org.apache.coyote.http11.Http11Protocol start-----------------------------------------------------------------------------------------------三天过去了,找遍了互联网,一点能让我欣慰的解决办法都没有,望高手指点

解决方案 »

  1.   

    java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDisptcher
    ,没有配置这个过滤器
      

  2.   

    http://zhidao.baidu.com/question/107758162楼主看看这里的
      

  3.   

    http://zhidao.baidu.com/question/117917277
    看看这里的
      

  4.   

    这是我的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">
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDisptcher
    </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
    -------------------------------------------------------------------------------
    这是我的struts.xml配置
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

    <struts>
    <package name="fsw" namespace="/" extends="struts-default">
    <action name="hello" class="str.action.HelloAction">
    <result name="success">/hello.jsp</result>
    </action>
    </package>
    </struts>
    ----------------------------------------------------------------------------
    这是我的HelloAction.java
    package str.action;import com.opensymphony.xwork2.ActionSupport;public class HelloAction extends ActionSupport {
    private String msg = "Hello World";

    public String getMsg() {
    return msg;
    } public void setMsg(String msg) {
    this.msg = msg;
    } public String execute() throws Exception { return ActionSupport.SUCCESS;
    }}
    ----------------------------------------------
    这是我的hello.jsp
    <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head><title>Welcome</title></head>
    <body>
    <h1><s:property value="msg" /></h1>
    </body>
    </html>
    -------------------------------------------------
    index.jsp
    <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
    <html>
      <head>
        <title>My JSP 'index.jsp' starting page</title>
      </head>
      
      <body>
        <h1><a href="hello.action">进入</a></h1>
      </body>
    </html>
      

  5.   

    五个jar包我都有了,都是一起下的,也不会有错啊
      

  6.   

    用netbeans开发的时候,想装个struts2插件,却提示要装XML文本编辑器,找了几天了没找到
      

  7.   

    java.lang.ClassNotFoundException:struts2的包没导入
      

  8.   

    我重新导入了下jar包,还是这个 问题
      

  9.   

    LZ,你用struts几啊,我怎么看到你需要导入import com.opensymphony.xwork2.ActionSupport;这类
      

  10.   

    java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDisptcher<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>
      

  11.   

    是struts2的啊
    这个类一直都在struts2-core的jar包中,它却总是报错,重启重装都不行
      

  12.   

    这是action对actionsupport的继承,所以吧,都是按照 李兴华那个视频写的
      

  13.   

    这个问题搞不好就只能退回到用struts1做了
      

  14.   

    傻,jre版本太高了也不行的是吧?在建project的时候,提示:
    compiler compliance level of project helloworld should be 1.4,your current workspace default is 6.0.do you want to use a custom setting for your project?
      

  15.   

    急也没办法啊,只可惜我的struts2没法用,没法工作了
      

  16.   

    用的struts2.几?
    2.1和2.0的filter配置不同
    另外一个就是你用的netbeans?
    查看下你的编译部署选项,可能没把struts包部署过去
      

  17.   

    就放lib 下啊
    如果jar放错位置,在代码中会提示导入错误
      

  18.   

    我的环境“
    struts-2.0.14
    eclipse 
    myeclipse 8.0GA
    tomcat 6.0
    jdk 1.6.0_14