Announcement Announcement Module
Collapse
No announcement yet.
Spring Security problem with DispatcherServlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Security problem with DispatcherServlet

    Hello
    I wrote spring application and now i need add spring security dependencies ...

    so in pom.xml i add:
    PHP Code:

      
    <dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-config</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-core</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-web</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency
    my properties : <org.springframework.version>3.1.1.RELEASE</org.springframework.version>

    But if i add this and i try run maven :
    mvn clean package -U
    i have got error :
    PHP Code:
    cannot access org.springframework.context.EnvironmentAware
    [ERROR] class file for org.springframework.context.EnvironmentAware not found 
    but if i delete this dependency so everything is fine my command : mvn clean package -U run


    so where is the problem ??

    my all spring dependencies :
    PHP Code:
    <dependency>
          <
    groupId>org.springframework</groupId>
          <
    artifactId>spring-core</artifactId>
          <
    version>${org.springframework.version}</version>
          <
    type>jar</type>
          <
    scope>compile</scope>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-config</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-core</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework.security</groupId>
            <
    artifactId>spring-security-web</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>
        
        
        <
    dependency>
            <
    groupId>org.springframework</groupId>
            <
    artifactId>spring-web</artifactId>
            <
    version>${org.springframework.version}</version>
            <
    type>jar</type>
            <
    scope>compile</scope>
        </
    dependency>
        
        <
    dependency>
            <
    groupId>org.springframework</groupId>
            <
    artifactId>spring-beans</artifactId>
            <
    version>${org.springframework.version}</version>
        </
    dependency>            
        
        <
    dependency>
            <
    groupId>org.springframework</groupId>
            <
    artifactId>spring-webmvc</artifactId>
            <
    version>${org.springframework.version}</version>
            <
    type>jar</type>
            <
    scope>compile</scope>
        </
    dependency
    Last edited by lukasw44; Jul 14th, 2012, 10:06 AM.

  • #2
    Spring security has a dependency on spring 3.0 and as such it will also pull in those dependencies. You haven't explicitly declared spring-context so it might be overridden. You can use a dependencyManagement tag to circumvent this.

    Comment

    Working...
    X