2011-3-21 17:32:09 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/BBBO]
2011-3-21 17:32:09 org.apache.catalina.core.StandardContext stop
信息: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/BBBO] has not been started
2011-3-21 17:32:10 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-default.xml]
2011-3-21 17:32:10 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-plugin.xml]
2011-3-21 17:32:10 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts.xml]
2011-3-21 17:32:10 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM locale
2011-3-21 17:32:10 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Action class [java.HelloWorld] not found - action - file:/D:/workspace/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/BBBO/WEB-INF/classes/struts.xml:7:60

at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
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:3693)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
2011-3-21 17:32:10 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2011-3-21 17:32:10 org.apache.catalina.core.StandardContext start
严重: Context [/BBBO] startup failed due to previous errors
HelloWorld.java文件
package java;/**
 *
 * @author Meyyappan Muthuraman
 */public class HelloWorld {    private String message;    private String userName;
    
    public HelloWorld() {
    }    public String execute() {
        setMessage("Hello " + getUserName());
        return "SUCCESS";
    }    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }    /**
     * @param message the message to set
     */
    public void setMessage(String message) {
        this.message = message;
    }    /**
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }}
struts.xml文件<!DOCTYPE struts PUBLIC 
    "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN" 
    "http://struts.apache.org/dtds/struts-2.1.7.dtd"> <struts>
    <package name="default" extends="struts-default">
        <action name="HelloWorld" class="java.HelloWorld" >
            <result name="SUCCESS">/success.jsp</result>
        </action>
    </package>
</struts>web.xml文件<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <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>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>index.jsp文件<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Hello World</title>
    </head>
    <body>
        <s:form action="HelloWorld" method="post">
            <s:textfield name="userName" label="User Name" />
            <s:submit />
        </s:form>
    </body>
</html>

解决方案 »

  1.   

    文件结构
    BBBO-|
         |src-|
              |java-|
                     HelloWorld.java
              |struts.xml 
         ...
         |WebRoot-|
                  |WEB-INF-|
                           |web.xml  
                  |index.jsp 
      

  2.   

    自己定义的类的包名不能以   java或者javax 名字 开头,java规范中明确说明了这里涉及到类加载器的一些话题,你改成其他包名 
      

  3.   

     <filter-name>struts2</filter-name>
    该成 <filter-name>struts</filter-name>
      

  4.   

    还是错误
    2011-3-21 18:08:39 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
    警告: No configuration found for the specified action: 'HelloWorld' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
    2011-3-21 18:08:39 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
    警告: No configuration found for the specified action: 'HelloWorld' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
      

  5.   

    你的action没有继承ActionSupport类。