2016-10-21 56 views
0

我有一个部署在WebLogic Server版本12.1.2.0.0中的Spring MVC应用程序。 但是当我部署到WL我有这样的问题:WLS版本中的weblogic.application.ModuleException版本:12.1.2.0.0

 weblogic.application.ModuleException: org.xml.sax.SAXParseException; lineNumber: 22; columnNumber: 68; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:global-method-security'.:org.xml.sax.SAXParseException:cvc-complex-type.2.4.c: The mat 
ching wildcard is strict, but no declaration can be found for element 'security:global-method-security'. 

这里我的applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:mvc="http://www.springframework.org/schema/mvc" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:jee="http://www.springframework.org/schema/jee" 
     xmlns:security="http://www.springframework.org/schema/security" 

     xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
     http://www.springframework.org/schema/aop 
     http://www.springframework.org/schema/aop/spring-aop-2.5.xsd 
     http://www.springframework.org/schema/jee 
     http://www.springframework.org/schema/jee/spring-jee-2.5.xsd 
     http://www.springframework.org/schema/mvc 
     http://www.springframework.org/schema/mvc/spring-mvc.xsd 
     http://www.springframework.org/schema/security 
     http://www.springframework.org/schema/security/spring-security-4.0.xsd"> 


     <security:global-method-security secured-annotations="enabled" /> 

     <security:http auto-config="true"> 
      <security:csrf/>  
      <security:intercept-url pattern="/**" access="permitAll" /> 
     </security:http> 

     <security:authentication-manager/> 

和我的pom.xml

<dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-core</artifactId> 
      <version>4.0.2.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-web</artifactId> 
      <version>4.0.2.RELEASE</version> 
     </dependency> 

回答

0

您应该添加spring-security-config依赖。

<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config --> 
<dependency> 
    <groupId>org.springframework.security</groupId> 
    <artifactId>spring-security-config</artifactId> 
    <version>4.0.1.RELEASE</version> 
</dependency>