环境为
tomcat 6.0 myeclipse 6.0 jdk好像不是1.5
运行项目就是不成功tomcat总是出现问题,以下是报错的部分代码.2009-6-17 20:58:24 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\java\SDK\jdk\bin;D:\Program Files\java\apache-tomcat-6.0.16\bin
2009-6-17 20:58:25 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2009-6-17 20:58:25 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1286 ms
2009-6-17 20:58:25 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-6-17 20:58:25 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.16
2009-6-17 20:58:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2009-6-17 20:58:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2009-6-17 20:58:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2009-6-17 20:58:28 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Document root element "struts", must match DOCTYPE root "web-app". at (null:3:10)
org.xml.sax.SAXParseException: Document root element "struts", must match DOCTYPE root "web-app".

.....
严重: Exception starting filter struts2
Unable to load configuration. - file:/E:/j2ee/struts2/WebRoot/WEB-INF/classes/struts.xml:3:10

.....
2009-6-17 20:58:28 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-6-17 20:58:28 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors
2009-6-17 20:58:29 org.apache.catalina.core.StandardContext addApplicationListener

解决方案 »

  1.   

    web.xml配置文件为
    <!DOCTYPE web-app PUBLIC 
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
    "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> 
      <display-name>Archetype Created Web Application </display-name> 
      
      <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> </web-app> 
      

  2.   

    struts.xml为
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <struts>    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
        <constant name="struts.devMode" value="false" />    <include file="example.xml"/>    <package name="struts2" extends="struts-default">
            <action name="login" class="com.struts2.action.LoginAction">
                <result name="success">/result.jsp</result>
            </action>
        </package>    <!-- Add packages here --></struts>
      

  3.   

    如何把web.xml fileter那一段去掉程序不会出现问题,我怀疑就是web.xml文件中fileter的问题,但是不知道究竟错在哪里,导入相应的包为
      

  4.   

        *  Servlet API 2.4
        * JSP API 2.0
        * Java 5
    struts2的环境要求,貌似你的web.xml遵循的规范是2.3的哟
      

  5.   

    应该是struts.xml配置文件出的错误,贴出来看看。
      

  6.   

    奇了怪了,myeclipse用了一段时间不能正常启动,重新下载安装后,还按照原来的思路重做了一遍,就不再出现上述问题了.真是谢天谢地.连续好几天的郁闷,被偶然解决了