Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-822

hidden dependency on javax.jdo.spi.PersistenceCapable???

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • 1.2.0
    • None
    • kernel
    • None
    • Windows XP SP3
      Java 6
      Maven 2.0.9

    Description

      Hi,

      It appears there's a dependency on javax.jdo.spi.PersistenceCapable when either running the enhancer or performing lazy loading with enhanced classes, but this dependency isn't specified in the Maven POM nor documented anywhere. Here's some output running the Ant task via Maven:

      [INFO] [antrun:run

      {execution: default}

      ]
      [INFO] Executing tasks
      [java] Exception in thread "Main Thread" java.lang.IllegalArgumentException:

      java.lang.NoClassDefFoundError: javax/jdo/spi/PersistenceCapable
      [java] at serp.util.Strings.toClass(Strings.java:164)
      [java] at serp.util.Strings.toClass(Strings.java:108)
      [java] at serp.bytecode.BCClass.getType(BCClass.java:566)
      [java] at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:248)
      [java] at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4492)
      [java] at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4439)
      [java] at org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4409)
      [java] at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:708)
      [java] at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:698)
      [java] at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4404)
      [java] at org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4395)
      [java] Java Result: 1

      I worked around this by specifying this in my POM:

      <dependency>
      <groupId>javax.jdo</groupId>
      <artifactId>jdo2-api</artifactId>
      <version>2.0</version>
      </dependency>

      (Note: I chose that version because it was the latest one that didn't have a dependency on javax.transaction, since that causes Maven pain.)

      With that change, everything seems to work fine, but I'm not sure if that dependency is really supposed to be there at all. Please review, and, at minimum, update the POM and make this dependency explicit in the documentation.

      Thank you!
      Ari

      Attachments

        Activity

          People

            curtisr7 Richard G. Curtis
            ari1meyer@yahoo.com Ari Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: