Issue Details (XML | Word | Printable)

Key: OPENJPA-186
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Marc Prud'hommeaux
Reporter: Jacek Laskowski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Build failure of OpenJPA sources from trunk

Created: 28/Mar/07 07:50 AM   Updated: 29/Mar/07 08:34 AM
Return to search
Component/s: build / infrastructure
Affects Version/s: 0.9.7
Fix Version/s: 0.9.7

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
Text File OPENJPA-186-builderror-2.txt 2007-03-28 06:04 PM Jacek Laskowski 11 kB
Text File OPENJPA-186.buildfailure.txt 2007-03-28 11:32 AM Jacek Laskowski 99 kB
Text File OPENJPA-186.patch 2007-03-28 08:08 PM Jacek Laskowski 0.5 kB

Resolution Date: 29/Mar/07 08:34 AM

Sub-Tasks  All   Open   
No sub-tasks match this view.

 Description  « Hide
(I have sent it to the mailing list on March 26th, but it didn't get through)

As I'm not alone with the build failure, see http://www.nabble.com/error-building-openjpa-tf3478705.html, here goes the issue report.

I've been trying to build OpenJPA source from trunk for a couple of days and no joy so far. Anything missing?

jlaskowski@dev /cygdrive/c/oss/openjpa
$ svn up
At revision 522565.

jlaskowski@dev /cygdrive/c/oss/openjpa
$ svn status

jlaskowski@dev /cygdrive/c/oss/openjpa
$ mvn clean install
[INFO] Executing tasks
    [echo] Revision: 406193:522097
[INFO] Executed tasks
[INFO] [antrun:run {execution: delete sun.misc.Perf}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 33 source files to
c:\oss\openjpa\openjpa-lib\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory:
c:\oss\openjpa\openjpa-lib\target\surefire-reports
[INFO] Building jar: c:\DOCUME~1\JLASKO~1\LOCALS~1\Temp\surefirebooter30238.jar
java.lang.NoClassDefFoundError: org/apache/maven/surefire/booter/SurefireBooter
Exception in thread "main"
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Mon Mar 26 19:16:09 CEST 2007
[INFO] Final Memory: 21M/254M
[INFO] ------------------------------------------------------------------------

jlaskowski@dev /cygdrive/c/oss/openjpa
$ mvn -v
Maven version: 2.0.5

jlaskowski@dev /cygdrive/c/oss/openjpa
$ java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Marc Prud'hommeaux added a comment - 28/Mar/07 09:00 AM
This is almost certainly a general maven setup problem. Try building another maven project and see if the same problem occurs. I recommend re-installing maven.

If this problem only happens with OpenJPA, please re-open this bug and post the output of the mvn command with the "-e" and "-X" flags.

Jacek Laskowski added a comment - 28/Mar/07 11:30 AM
What?! Please appologize my lack of understanding, but comments like this "Try building another maven project and see if the same problem occurs. I recommend re-installing maven." doesn't apply in this scenario. I'm building Apache Geronimo and Apache OpenEJB almost every day with success (they're built with M2) and there are other M2-ized projects that work fine (with OpenJPA as a dependency, too) and I can't understand why re-installing M2 would help here if everything but OpenJPA builds fine?

Please have a look at the attachment with the output of executing 'mvn -e -X clean install' command.

Jacek Laskowski added a comment - 28/Mar/07 11:31 AM
The attachment contains all that's necessary to back up the reopening.

Kevin Sutter added a comment - 28/Mar/07 01:54 PM
Jacek,
I just reproduced your problem. It looks to be related to the surefire 2.3 plugin for maven. I first tried my current maven setup and that had surefire 2.0. Everything worked just fine. I then attempted to remove just the surefire 2.0 plugin, but maven just downloaded the same 2.0 version. So, I removed maven completely from my .m2 repository and surefire 2.3 was downloaded and my build failed in the same way as yours (same exception anyway):

[INFO] Surefire report directory: C:\eclipse.workspaces\3.2.2\openjpa\openjpa-lib\target\surefire-reports
[INFO] Building jar: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\surefirebooter27730.jar
java.net.MalformedURLException: unknown protocol: c
        at java.net.URL.<init>(URL.java:608)
        at java.net.URL.<init>(URL.java:498)
        at sun.misc.URLClassPath$JarLoader.parseClassPath(URLClassPath.java:1118)
        at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:1091)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:476)
        at sun.misc.URLClassPath.getResource(URLClassPath.java:322)
        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:959)
        at java.security.AccessController.doPrivileged(AccessController.java:275)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:602)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:568)
The java class is not found: org.apache.maven.surefire.booter.SurefireBooter

If I modify my pom.xml to use surefire 2.2, everything builds again...

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.2</version>
                  :

Not sure what is wrong with surefire 2.3, but we have experienced a few problems with it. Maybe we should update our pom.xml to use version 2.2 until it gets more stable.

Kevin

Marc Prud'hommeaux added a comment - 28/Mar/07 04:28 PM
I haven't had any problems with surefire 2.3, but I don't build on Windows. I think setting the surefire version to 2.2 in the pom.xml is a fine solution ... I've gone ahead and committed this change. Please comment in this issue if the problem still occurs.

Jacek Laskowski added a comment - 28/Mar/07 06:03 PM
Alas, the build went further, but still fails. See the attached output of 'mvn clean install' command.

Marc Prud'hommeaux added a comment - 28/Mar/07 06:18 PM
If you manually include the tools.jar (in your Java system library directory) in your CLASSPATH, do you still get the same error? Can you post the setting of your CLASSPATH?

Jacek Laskowski added a comment - 28/Mar/07 07:40 PM
It's something pertaining to the way Ant is executed from within M2, and OpenJPA build runs into troubles. I could reproduce it with a simple, almost empty project. When build.xml is executed directly with ant it runs fine. When it's executed from M2 it fails with the following error message. Any hints on how to work it out?

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ ant -version
Apache Ant version 1.7.0 compiled on December 13 2006

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ mvn -v
Maven version: 2.0.5

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ echo $CLASSPATH


jlaskowski@dev /cygdrive/c/OPENJPA-186
$ echo $JAVA_HOME
/cygdrive/c/apps/java5

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ ant
Buildfile: build.xml

compile:
    [javac] Compiling 1 source file

BUILD SUCCESSFUL
Total time: 0 seconds

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ mvn integration-test
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building OpenJPA Examples Integration Tests
[INFO] task-segment: [integration-test]
[INFO] ----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [antrun:run {execution: run-examples}]
[INFO] Executing tasks
     [echo] Running OpenJPA Examples

compile:
    [javac] Compiling 1 source file
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line:
C:\OPENJPA-186\build.xml:4: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Wed Mar 28 21:36:02 CEST 2007
[INFO] Final Memory: 4M/254M
[INFO] ------------------------------------------------------------------------

$ cat pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
        http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>xxx</groupId>
    <artifactId>examples</artifactId>
    <packaging>pom</packaging>
    <version>1.0</version>
    <name>OpenJPA Examples Integration Tests</name>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>run-examples</id>
                        <phase>integration-test</phase>
                        <configuration>
                        <tasks>
                        <echo>Running OpenJPA Examples</echo>

                        <subant inheritAll="false">
                            <fileset dir="."
                                includes="build.xml"/>
                        </subant>

                        </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

jlaskowski@dev /cygdrive/c/OPENJPA-186
$ cat build.xml
<project default="compile">

    <target name="compile" description="Compile the example java files">
        <javac srcdir="src" />
    </target>

</project>

Jacek Laskowski added a comment - 28/Mar/07 08:08 PM
Applying the patch lets you go on with the build until another BUILD ERROR:

[INFO] ----------------------------------------------------------------------------
[INFO] Building OpenJPA JPA TCK Integration Tests
[INFO] task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target
[INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target\classes
[INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target\test-classes
[INFO] [site:attach-descriptor]
[INFO] [antrun:run {execution: run-tck}]
[INFO] Executing tasks
     [echo] Running Sun JPA TCK
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The TCK file C:\.m2/../privaterepos/jpa-1_0a-tck.zip does not exist. This file must be downloaded separately in order to be able to run the JPA TCK
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 33 seconds
[INFO] Finished at: Wed Mar 28 21:58:01 CEST 2007
[INFO] Final Memory: 35M/254M
[INFO] ------------------------------------------------------------------------

I wonder how non-committers build OpenJPA?! Could the tck modue be moved to a profile that's executed for some?

Jacek Laskowski added a comment - 28/Mar/07 10:23 PM
mvn package -Dtest=false did the trick. mvn clean package works now too! mvn install fails. See the following build error (after the successful build message). It looks install isn't for faint-hearted. It should be documented somewhere on the website.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] OpenJPA ............................................... SUCCESS [1.328s]
[INFO] OpenJPA Utilities ..................................... SUCCESS [29.250s]
[INFO] OpenJPA Kernel ........................................ SUCCESS [15.453s]
[INFO] OpenJPA JDBC .......................................... SUCCESS [12.203s]
[INFO] OpenJPA XML Store ..................................... SUCCESS [0.407s]
[INFO] OpenJPA Kernel 1.5 .................................... SUCCESS [0.312s]
[INFO] OpenJPA JDBC 1.5 ...................................... SUCCESS [0.297s]
[INFO] OpenJPA JPA ........................................... SUCCESS [2.015s]
[INFO] OpenJPA JPA JDBC ...................................... SUCCESS [11.203s]
[INFO] OpenJPA Aggregate Jar ................................. SUCCESS [20.438s]
[INFO] OpenJPA Persistence Examples .......................... SUCCESS [0.562s]
[INFO] OpenJPA Distribution .................................. SUCCESS [35.578s]
[INFO] OpenJPA Integration Tests ............................. SUCCESS [0.000s]
[INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.000s]
[INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.000s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 9 seconds
[INFO] Finished at: Thu Mar 29 00:07:18 CEST 2007
[INFO] Final Memory: 26M/254M
[INFO] ------------------------------------------------------------------------

     [echo] Running Sun JPA TCK
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The TCK file C:\.m2/../privaterepos/jpa-1_0a-tck.zip does not exist. This file must be downloaded separately in order to be able to run the JPA TCK
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 36 seconds
[INFO] Finished at: Thu Mar 29 00:18:28 CEST 2007
[INFO] Final Memory: 35M/254M
[INFO] ------------------------------------------------------------------------

Patrick Linskey added a comment - 29/Mar/07 08:34 AM
Sorry about that -- I don't think that many of us run 'mvn install' all that often.

I just removed the line that tries to invoke the tck in r523613; hopefully, you should now be able to build successfully. I was just able to run a 'mvn clean install' without issue.