Results 1 to 2 of 2

Thread: Spring Security problem with DispatcherServlet

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Default 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 at 10:06 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •