Announcement Announcement Module
Collapse
No announcement yet.
Spring security & cglib & asm problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security & cglib & asm problem

    Hi!

    I'm trying to wire up spring security to be used with Spring MVC + Spring security with @Secured annotations. But if I include cglib-nodep, I'm getting ClassNoFound exception that TraceClassVisitor can not be found (and it is indeed not included in the cglib-nodep jar file).

    If I try to use regular cglib + asm dependencies, I'm getting the following exception:
    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mainController' defined in file [/...../MainController.class]: Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
    The POM dependencies are as follows:
    Code:
        <dependency>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-core</artifactId>
          <version>3.1.4.RELEASE</version>
        </dependency>
                
        <dependency>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-web</artifactId>
          <version>3.1.4.RELEASE</version>
        </dependency>
    
        <dependency>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-config</artifactId>
          <version>3.1.4.RELEASE</version>
        </dependency>
    
        <dependency>
          <groupId>cglib</groupId>
          <artifactId>cglib</artifactId>
          <version>3.0</version>
        </dependency>
    
        <dependency>
          <groupId>asm</groupId>
          <artifactId>asm</artifactId>
          <version>3.3.1</version>
        </dependency>
                
        <dependency>
          <groupId>asm</groupId>
          <artifactId>asm-util</artifactId>
          <version>3.3.1</version>
        </dependency>
    What am I missing?

    Thanks,
    Miha.

    ps: if I remove @Secured annotation, it compiles and runs, but without @Secured functionality of course.
    Last edited by skyflyer; May 11th, 2013, 10:58 AM.

  • #2
    Originally posted by skyflyer View Post
    Hi!
    What am I missing?
    I don't know what I was missing, but when I moved security configuration into a separate XML file (it was in "spring-context.xml" before) it started working...

    Who knew...

    Comment

    Working...
    X