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: Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0 GA
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      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
          Stéphane Nicoll added a comment -

          I think you reopened this issue by mistake. Maybe the status of the issue should be "won't fix" instead of "complete".

          Reading the whole threads and the last comments might help.

          Show
          Stéphane Nicoll added a comment - I think you reopened this issue by mistake. Maybe the status of the issue should be "won't fix" instead of "complete". Reading the whole threads and the last comments might help.
          Hide
          Ats U. added a comment -

          I think this issue needs to be reopened and solved properly.

          I encountered the same issue. Yes, I could work around it as suggested by adding optional/provided or what ever scope dependency to my project, but I think this is not correct solution.

          Costin Leau referred to AspectJ issue, that is directly related to this issue - now it is resolved https://bugs.eclipse.org/bugs/show_bug.cgi?id=310506#c2

          It seems to me that now this issue could be correcty reolved because of enhancement for AspectJ issue 310506.
          As I understood correct way to solve this issue is to define, that aspect that is causing this issue should be switched off if javax.persistence.Entity class is not available:

          <aspect name="org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl" requires="javax.persistence.Entity"/>

          Show
          Ats U. added a comment - I think this issue needs to be reopened and solved properly. I encountered the same issue. Yes, I could work around it as suggested by adding optional/provided or what ever scope dependency to my project, but I think this is not correct solution. Costin Leau referred to AspectJ issue, that is directly related to this issue - now it is resolved https://bugs.eclipse.org/bugs/show_bug.cgi?id=310506#c2 It seems to me that now this issue could be correcty reolved because of enhancement for AspectJ issue 310506. As I understood correct way to solve this issue is to define, that aspect that is causing this issue should be switched off if javax.persistence.Entity class is not available: <aspect name="org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl" requires="javax.persistence.Entity"/>
          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... .

            People

            • Assignee:
              Costin Leau
              Reporter:
              Pavel Král
              Last updater:
              Peter De Winter
            • Votes:
              7 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                1 year, 3 days ago