2010-08-10 33 views

回答

2

當Struts的action servlet由於某種原因無法啓動時, 產生的錯誤可能如上所述。

在我的例子中 - 使用彈簧的彈簧彈簧支撐集成 - 我的web應用程序的 類路徑中缺少必要的彈簧支架(特別是彈簧支撐)。

以下Maven依賴工作:

<properties> 
    <spring.maven.artifact.version> 
     3.0.3.RELEASE 
    </spring.maven.artifact.version> 

    <spring.security.maven.artifact.version> 
     3.0.3.RELEASE 
    </spring.security.maven.artifact.version> 

</properties> 
     <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-asm</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-expression</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-struts</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
     <exclusions> 
      <exclusion> 
       <groupId>struts</groupId> 
       <artifactId>struts</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-core</artifactId> 
     <version>${spring.security.maven.artifact.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-config</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-taglibs</artifactId> 
     <version>${spring.maven.artifact.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>com.springsource.org.apache.commons.codec</artifactId> 
     <version>1.4.0</version> 
    </dependency> 

    <!-- Struts 1.3 framework --> 
    <dependency> 
     <groupId>org.apache.struts</groupId> 
     <artifactId>struts-core</artifactId> 
     <version>1.3.10</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.struts</groupId> 
     <artifactId>struts-taglib</artifactId> 
     <version>1.3.10</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.struts</groupId> 
     <artifactId>struts-el</artifactId> 
     <version>1.3.10</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.struts</groupId> 
     <artifactId>struts-extras</artifactId> 
     <version>1.3.10</version> 
    </dependency> 

    <!-- be sure to include extra struts modules, as needed, 
     especially for used struts-plugins --> 
    <dependency> 
     <groupId>org.apache.struts</groupId> 
     <artifactId>struts-tiles</artifactId> 
     <version>1.3.10</version> 
    </dependency> 

注:如果你不使用彈簧安全,你可以很可能下降彈簧安全相關的依賴性,也排除在彈簧支柱中必須包含最新的struts版本而不是1.2.9