Spring Framework
  1. Spring Framework
  2. SPR-6819

AnnotationDrivenStaticEntityMockingControl in spring-aspects module require javax.persistence.Entity on compiler classpath

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 4.1.2
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      Aspect org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl require for ajc javax.persistence.Entity to be on classpath, hovewer spring-aspect pom.xml doesn't provide such dependency. As workaround one must declare dependency in affected module pom.xml

      <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>persistence-api</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
      </dependency>

      1. ajdtCompilerOutput.txt
        30 kB
        Ed Bras
      2. bla.txt
        7 kB
        Ed Bras

        Issue Links

          Activity

          Hide
          Antti Andreimann added a comment -

          I would also LOVE to see the previous fix implemented. It's much cleaner than any workaround.

          Roo projects without persistence also suffer from this bug:

          1. Create a new Roo project
          2. Run web mvc setup
          3. Create a controller: eg web mvc controller --class ~.web.TestController

          And BANG!

          Show
          Antti Andreimann added a comment - I would also LOVE to see the previous fix implemented. It's much cleaner than any workaround. Roo projects without persistence also suffer from this bug: 1. Create a new Roo project 2. Run web mvc setup 3. Create a controller: eg web mvc controller --class ~.web.TestController And BANG!
          Hide
          Winarto added a comment -

          Even in 3.1.3, I still get this error

          Show
          Winarto added a comment - Even in 3.1.3, I still get this error
          Hide
          Peter De Winter added a comment -

          Yup, 3.1.2 too... .

          Show
          Peter De Winter added a comment - Yup, 3.1.2 too... .
          Hide
          Hantsy Bai added a comment -

          Encountered this problem in the latest Spring 4.0.6.

          I am using MongoDB as data storage, and use Spring Data MongoDB for data persisting, it is unreasonable to add JPA in dependencies.

          Show
          Hantsy Bai added a comment - Encountered this problem in the latest Spring 4.0.6. I am using MongoDB as data storage, and use Spring Data MongoDB for data persisting, it is unreasonable to add JPA in dependencies.
          Hide
          Stéphane Nicoll added a comment -

          AspectJ 1.8.3 provides a new annotation to disable an aspect that requires a dependency that is not present. We now use this annotation on AnnotationDrivenStaticEntityMockingControl to require javax.persistence.Entity.

          If you want to benefit from this feature, you should also update your build to use Aspect 1.8.3.

          Show
          Stéphane Nicoll added a comment - AspectJ 1.8.3 provides a new annotation to disable an aspect that requires a dependency that is not present. We now use this annotation on AnnotationDrivenStaticEntityMockingControl to require javax.persistence.Entity . If you want to benefit from this feature, you should also update your build to use Aspect 1.8.3.

            People

            • Assignee:
              Stéphane Nicoll
              Reporter:
              Pavel Král
              Last updater:
              Stéphane Nicoll
            • Votes:
              7 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                22 weeks, 4 days ago