<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.or[code=Java]g/dtds/struts-2.0.dtd">
    <struts>
    
<!--    <constant name="struts.objectFactory" value="spring"/>-->
<include file="struts-default.xml"/>
    <constant name="struts.custom.i18n.resources" value="globalMsges"></constant>
     <package name="person" extends="struts-default">
     <action name="login" class="loginAction">
     <result>/index.jsp</result>
     <result name="input">/pages/login.jsp</result>
     </action>
     </package>
    </struts>
[/code]
这里是struts.xml的配置,我排错就到这里出了问题,在login中的 class 在spring配置文件中(如下)<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"><bean id="loginService" class="com.test.service.impl.LoginServiceImpl"></bean>
<bean id="loginAction" class="com.person.action.LoginAction" scope="prototype">
<property name="loginService">
<ref local="loginService"/>
</property>
</bean>
</beans>
就会报错: 严重: Error filterStart
2009-4-30 13:57:31 org.apache.catalina.core.StandardContext start
严重: Context [/person] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
2009-4-30 13:57:31 org.apache.coyote.http11.Http11BaseProtocol start

解决方案 »

  1.   

    你用的是tomcat吗?tomcat版本低了~~换成5.5或更高的
      

  2.   

    Tomcat 换为高版本的试一下 如果不行你要仔细检查下jar文件是不是有冲突...
      

  3.   

    Error filterStart 看到这个 应该是 Spring 过滤器的问题
    在web.xml设置一下使用Spring的过滤器给所有的地址进行转码就可以了:   
    <filter>  
        <filter-name>Spring character encoding filter</filter-name>  
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>  
        <init-param>  
            <param-name>encoding</param-name>  
            <param-value>GBK</param-value>  
        </init-param>  
    </filter>  
    <filter-mapping>  
        <filter-name>Spring character encoding filter</filter-name>  
        <url-pattern>/*</url-pattern>  
    </filter-mapping>  
      

  4.   

     <constant name="struts.objectFactory" value="spring"/>
    上面那个为什么注释呢
      

  5.   

    可能是web.xml中的配置有问题,建议部署到其它的server上试试,如weblogic、jes等,可能会有更详细的错误信息。
      

  6.   

    你用tomcat 的吗  版本是不是低了
      

  7.   

    应该不是上面朋友说的tomcat 的问题
    应该是你的jdk的版本太低
    你的jdk版本是多少,升级一下版本就可以了
    问题应该能解决
      

  8.   

    使用struts2-spring-plugin1.配置web.xml<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    2.指定对象工厂
    struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory3.配置struts.xml和application.xml