在发布的时候出现下面错误:
2010-5-20 7:29:08 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-5-20 7:29:08 org.apache.catalina.core.StandardContext start
严重: Context [/Struts2Demo] startup failed due to previous errors
运行的时候错误提示
The requested resource (/Struts2Demo/) is not available.
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.struts.dispatcher.FilterDispatcher</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>还有就是在hello.jsp中显示
Multiple annotations found at this line:
- Unknown tag (s:property).
- Undefined attribute name (value).
hello.jsp代码如下:
[code=jsp]
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
  <head>
    
    <title>My JSP 'hello.jsp' starting page</title>
  </head>
  <body> 
    <s:property value="msg"/>
  </body>
</html>[/code]

解决方案 »

  1.   

    首先你要明白404是什么错路404是请求错误 找不到路径文件 你查找下你的action跳转路径你然是jsp页面斜杠开始的URL 表示 是 服务器 的根 目录。
    你可以搜索一下 tag 库在哪里,纠正一下 uri 
      

  2.   

    能不能说详细点,我不怎么会弄。uri不都是/struts-tags么?
      

  3.   

    首先你总需要有 action吧不能直接访问hello.jsp吧
      

  4.   

    1首先确定有struts2的标签库模块(jar,tld)
    2startup failed due to previous errors可能(遇到过,忘了咋解决的了)是jar包冲突,这个不解决,tomcat正常不了
      

  5.   

    org.apache.struts.dispatcher.FilterDispatcher我记得这是strut2较老的filter。再有就看看xml的schema版本
      

  6.   

    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="mldn" namespace="/" extends="struts-default">
    <action name="hello" class="org.lxh.struts2.demo.HelloAction">
    <result name="success">/hello.jsp</result>
    </action>
    </package>
    </struts>
      

  7.   

    打开struts2的jar包,看看是不是存在这个FilterDispatcher,还是有新的代替。那个jar包忘了。。好像在xworks下,要不就是strut2core
      

  8.   

    再有就是查tomcat的日志(catalina啥的)了,你研究研究,一劳永逸,这种问题还很多,研究研究没坏处
      

  9.   

    404是客户端请求了不存在的页面你服务器端的配置问题,具体细心找找吧另外java区分大小写     需要一致的地方别写错了
      

  10.   

            <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
    </filter>
    我想知道你那mapping那里怎么有个/在
      

  11.   

    你是请求hello.action出错吗
    http://localhost:8080/Struts2Demo/hello.action
      

  12.   

    看样子是URL错误
    http://localhost:8080/Struts2/hello
      

  13.   

     <filter>
            <filter-name>struts</filter-name>
            <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        </filter>
      

  14.   

    问一下LZ,你配置了servlet没,好像看你的xml里面没得servlet啊,你那里只有个过滤器,你action都没有配置啊,你怎么能访问了,<url-pattern>*.do</url-pattern>没这个你用什么访问!!!!
      

  15.   

    错误原因:  
    认为是由于jdk1.5 与 tomcat5.0之间的关于 TransformerFactoryImpl 类的冲突造成的。
    tomcat-5.0.28\common\endorsed下有两个jar包:xercesImpl.jar和xml-apis.jar,其中的类 javax.xml.transform.TransformerFactory 与jdk1.5中的类org.apache.xalan.processor.TransformerFactoryImpl其实是同一个类。
    in tomcat java is called with the following argument:
    -Djava.endorsed.dirs="X:\my_app\Portal\tomcat\common\endorsed"
    In this directory you find two jar files: xercesImpl.jar and xml-apis.jar needed by tomcat and that must be loaded before all xmsl stuff present in the jdk (1.4 naming problem). And in the file xml-apis.jar the TransformerFactoryImpl is set to "org.apache.xalan.processor.TransformerFactoryImpl".
    解决办法:
    1. 将xml-apis.jar移出endorsed文件夹。
    2. 用xalan系列jar包替换原来的xercesImpl.jar和xml-apis.jar。
      xalan系列jar包:serializer.jar、xalan.jar、xercesImpl.jar和xml-apis.jar。
    3. For other application, just check this file or dom3-xml-apis.jar in your class path.
    如果你不会这样做,就使用1.4的JDK和tomcat5.0
    或者JDK1.5 tomcat5.5 这2种类型才是匹配的