OpenJPA
  1. OpenJPA
  2. OPENJPA-685

Problem enhancing test cases with Maven 2.0.9

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.4, 1.2.1, 1.3.0
    • Component/s: build / infrastructure
    • Labels:
      None
    • Environment:
      Maven 2.0.9 (latest available) and Sun JVM 1.5.0_14.

      Description

      Starting with Maven 2.0.8 (later corrected to 2.0.9) there is a problem with the enhancement step that leads to numerous (yet apparently non-fatal) exceptions being thrown during the enhancement step. Debugging reveals that the problem occurs when the code is trying to unzip pom.xml. The problem may arise from some difference in the Maven Ant plugin.

      The exception seen looks like the following:

      java.util.zip.ZipException: error in opening zip file
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.<init>(ZipFile.java:203)
      at java.util.zip.ZipFile.<init>(ZipFile.java:234)
      at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
      at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
      at java.lang.ClassLoader.getResource(ClassLoader.java:972)
      at org.apache.openjpa.lib.util.J2DoPrivHelper$13.run(J2DoPrivHelper.java:377)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getSourceFile(AnnotationPersistenceMetaDataParser.java:684)
      at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getMetaData(AnnotationPersistenceMetaDataParser.java:660)
      at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseClassAnnotations(AnnotationPersistenceMetaDataParser.java:480)
      at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parse(AnnotationPersistenceMetaDataParser.java:352)
      at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:229)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:474)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:294)
      at org.apache.openjpa.meta.ValueMetaDataImpl.resolveDeclaredType(ValueMetaDataImpl.java:431)
      at org.apache.openjpa.meta.ValueMetaDataImpl.resolve(ValueMetaDataImpl.java:410)
      at org.apache.openjpa.meta.FieldMetaData.resolve(FieldMetaData.java:1676)
      at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1690)
      at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1625)
      at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:717)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:616)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:541)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:581)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:541)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
      at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:248)
      at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4492)
      at org.apache.openjpa.ant.PCEnhancerTask.executeOn(PCEnhancerTask.java:89)
      at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:172)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
      at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
      at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        Activity

        Hide
        Jeremy Bauer added a comment -

        I experienced the same issue using mvn 2.0.8 & 2.0.9 on Windows. I applied your patched and ran a trunk build with 2.0.9 and it looks good. +1 to commit.

        Show
        Jeremy Bauer added a comment - I experienced the same issue using mvn 2.0.8 & 2.0.9 on Windows. I applied your patched and ran a trunk build with 2.0.9 and it looks good. +1 to commit.
        Hide
        Michael Dick added a comment -

        I have not been able to reproduce the issue on Linux. From the documentation on the antrun plugin page it looks like maven.dependency.classpath is (or will be) deprecated). The maven.compile.classpath is a subset of maven.test.classpath and can also be removed.

        I took both references out of the build files and produced the attached patch. If one of the people who can reproduce the problem could verify that the patch works I'll go ahead and commit the changes. Otherwise I'll try to scrounge up a Windows box.

        Show
        Michael Dick added a comment - I have not been able to reproduce the issue on Linux. From the documentation on the antrun plugin page it looks like maven.dependency.classpath is (or will be) deprecated). The maven.compile.classpath is a subset of maven.test.classpath and can also be removed. I took both references out of the build files and produced the attached patch. If one of the people who can reproduce the problem could verify that the patch works I'll go ahead and commit the changes. Otherwise I'll try to scrounge up a Windows box.
        Hide
        Michael Dick added a comment -

        Per remarks at http://jira.codehaus.org/browse/MANTRUN-38 maven.dependency.classpath will be deprecated in the future. I'm not sure it is deprecated in the latest version of the antrun plugin though.

        Show
        Michael Dick added a comment - Per remarks at http://jira.codehaus.org/browse/MANTRUN-38 maven.dependency.classpath will be deprecated in the future. I'm not sure it is deprecated in the latest version of the antrun plugin though.
        Hide
        Max Offman added a comment -

        I observed similar diagnostics with a Maven 2.0.9 maven-antrun-plugin -launched enhancement. The culprit was in:

        <path id="cp">
        <path refid="maven.test.classpath" />
        <path refid="maven.compile.classpath" />
        <path refid="maven.dependency.classpath" />
        </path>

        After removing <path refid="maven.dependency.classpath" /> there were no more exceptions. I believe that "maven.dependency.classpath" has been deprecated in favor of "maven.compile.classpath" .

        Show
        Max Offman added a comment - I observed similar diagnostics with a Maven 2.0.9 maven-antrun-plugin -launched enhancement. The culprit was in: <path id="cp"> <path refid="maven.test.classpath" /> <path refid="maven.compile.classpath" /> <path refid="maven.dependency.classpath" /> </path> After removing <path refid="maven.dependency.classpath" /> there were no more exceptions. I believe that "maven.dependency.classpath" has been deprecated in favor of "maven.compile.classpath" .
        Hide
        David Ezzio added a comment -

        Hi Albert,

        Right, you are. Contrary to my prior belief, the problem does not occur (for me) with Maven 2.0.8. I followed your instructions to rebuild the repository for 2.0.8 (just as I have done with the other versions), and the enhancement step was clean.

        Thanks,

        David

        Show
        David Ezzio added a comment - Hi Albert, Right, you are. Contrary to my prior belief, the problem does not occur (for me) with Maven 2.0.8. I followed your instructions to rebuild the repository for 2.0.8 (just as I have done with the other versions), and the enhancement step was clean. Thanks, David
        Hide
        David Ezzio added a comment -

        Hi Albert,

        I first saw this problem with Maven 2.0.8 in April. I tried your suggestion with Maven 2.0.9. Report behavior persists.

        My configuration:

        C:\code\svn\RW_OpenJPAMainline>mvn -v
        Maven version: 2.0.9
        Java version: 1.5.0_14
        OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

        C:\code\svn\RW_OpenJPAMainline>java -version
        java version "1.5.0_14"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
        Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode)

        C:\code\svn\RW_OpenJPAMainline>ver

        Microsoft Windows XP [Version 5.1.2600]

        Show
        David Ezzio added a comment - Hi Albert, I first saw this problem with Maven 2.0.8 in April. I tried your suggestion with Maven 2.0.9. Report behavior persists. My configuration: C:\code\svn\RW_OpenJPAMainline>mvn -v Maven version: 2.0.9 Java version: 1.5.0_14 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows" C:\code\svn\RW_OpenJPAMainline>java -version java version "1.5.0_14" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode) C:\code\svn\RW_OpenJPAMainline>ver Microsoft Windows XP [Version 5.1.2600]
        Hide
        Pinaki Poddar added a comment -

        I have been silently suffering from this symptom for months.
        Did not occur that the cause may lie with Maven version. But, once you mention it, it is true that the problem did appear as I moved into a new box with and used a newer version of Maven (2.0.9).

        Show
        Pinaki Poddar added a comment - I have been silently suffering from this symptom for months. Did not occur that the cause may lie with Maven version. But, once you mention it, it is true that the problem did appear as I moved into a new box with and used a newer version of Maven (2.0.9).
        Hide
        Albert Lee added a comment -

        David,

        Try cleaning up (rename/remove) your local repository at .m2/* and let maven download the right level of dependencies seem to resolve this problem condition. If I recall, Mike D. reminded me to stay with maven 2.0.8 to avoid other problems.

        Albert Lee.

        Show
        Albert Lee added a comment - David, Try cleaning up (rename/remove) your local repository at .m2/* and let maven download the right level of dependencies seem to resolve this problem condition. If I recall, Mike D. reminded me to stay with maven 2.0.8 to avoid other problems. Albert Lee.
        Hide
        David Ezzio added a comment -

        It may be relevant that I am using Windows XP.

        Show
        David Ezzio added a comment - It may be relevant that I am using Windows XP.

          People

          • Assignee:
            Michael Dick
            Reporter:
            David Ezzio
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development