Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: AspectJ @Before problem

  1. #11

    Default

    Seems that Hibernate ships with asm-*-1.5.3 but Spring 2.1-M4 ships with asm-*2.2.3. If I use asm-*-1.5.3 Spring breaks, but if I use asm-*-2.2.3 Hibernate breaks. So I can't test this either way.

  2. #12

    Default

    First a little explaining. When I began this post, I was using Ant but since then I've switched to Maven. So I figured it out. First I found this article explaining the problem. Then I did this:

    pom.xml
    Code:
    ...
    <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.5.ga</version>
            <exclusions>
              <exclusion>
                <artifactId>asm</artifactId>
                <groupId>asm</groupId>
              </exclusion>
              <exclusion>
                <artifactId>asm</artifactId>
                <groupId>asm-attrs</groupId>
              </exclusion>
              <exclusion>
              	<groupId>cglib</groupId>
              	<artifactId>cglib</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
        		<groupId>asm</groupId>
        		<artifactId>asm</artifactId>
        		<version>2.2.3</version>
        	</dependency>
        	<dependency>
        		<groupId>asm</groupId>
        		<artifactId>asm-attrs</artifactId>
        		<version>2.2.3</version>
        	</dependency>
        	<dependency>
        		<groupId>asm</groupId>
        		<artifactId>asm-commons</artifactId>
        		<version>2.2.3</version>
        	</dependency>
        	<dependency>
        		<groupId>asm</groupId>
        		<artifactId>asm-util</artifactId>
        		<version>2.2.3</version>
        	</dependency>
        	<dependency>
        		<groupId>cglib</groupId>
        		<artifactId>cglib-nodep</artifactId>
        		<version>2.1_3</version>
        	</dependency>
    ....
    Notice the bolded cglib-nodep. nodep is very important. Then the last thing I discovered is I had to put the annotation on the implementation of my DAO, not the DAO interface, and not the TestCase as you pointed out. It had to be on a Spring managed bean. Then it worked like a champ! Thanks for your help.

Posting Permissions

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