Hello all,

In the end, I did finally figure out a way to adhere to the Java 1.5 requirement for building
the Geronimo plugins required for Tradebeans/Tradesoap while holding onto Java 1.6 JAVA_HOME
for Ant. So below, I have the steps I went through to do this. If there actually is a simpler way,
please don't hesitate to let me know. I'm keeping notes on this for future reference.

To build Tradebeans/Tradesoap in DaCapo 9.12 benchmark on Ubuntu (from source):

Problem: Checksum validation fails?

1) Remove MD5 checksums in benchmark/libs/daytrader/downloads
      cd benchmark/libs/daytrader/downloads
      rm *.MD5

This will force ant to decide to redownload everything and generate new checksums
for those download items. Alternatively, you can try and comment out all the checksum
validations.

Problem: Maven required java 1.5, but detects java 1.6?

1) Make sure you have a java 1.5 installation somewhere to compile java 1.5 code, and know
   the path to the bin folder of that installation. For example, if we have it at
      /usr/lib/jvm/java-1.5.0-sun/bin/java
   we want to remember
      /usr/lib/jvm/java-1.5.0-sun
  If you don't have it, I suggest looking for it somewhere on the web. Some repos still
  have it for Ubuntu, for instance (as of 08-01-2013).

2) Go up a level and open build.xml in your favorite editor
      cd ..
      emacs -nw build.xml

3) Search for the point where ant will build the geronimo plugins (j2ee, client, cxf, axis).
   It will look something like the xml below:

      <!-- build required plugins -->
      <exec executable="${mvn}" dir="${lib-build-dir}/plugins/j2ee" failonerror="yes" failifexecutionfails="yes"/>
      <exec executable="${mvn}" dir="${lib-build-dir}/plugins/client" failonerror="yes" failifexecutionfails="yes"/>
      <exec executable="${mvn}" dir="${lib-build-dir}/plugins/cxf" failonerror="yes" failifexecutionfails="yes"/>
      <exec executable="${mvn}" dir="${lib-build-dir}/plugins/axis" failonerror="yes" failifexecutionfails="yes"/>

4) For each of those exec tags, you must add in an env tag for JAVA_HOME, like so
      <exec executable="${mvn}" dir="${lib-build-dir}/plugins/j2ee" failonerror="yes" failifexecutionfails="yes"> <!-- Note the missing / at the end -->
          <env key="JAVA_HOME" path="/path/to/java-1.5.0-sun"/> <!-- new tag -->
      </exec> <!-- Close your exec tag now -->

Now, when it gets to building the plugins, many things will be downloaded and then tested.
Assuming the tests pass, it will run the Geronimo server for further testing/download and
(hopefully) succeed.

5) Now you can try and build tradebeans/tradesoap in the benchmarks folder
      cd ../..
      ant tradebeans

This seems to work for me. Hopefully it works for others too. It is worth noting that
both benchmarks do still run with Java 1.6. Now Jikes is a different story...

Again, if there is anything else or other fixes, let me know. I'd like to put them together into one document for future reference.


On Wed, Jul 24, 2013 at 3:18 PM, Diogenes Nunez <dan@cs.tufts.edu> wrote:
Hello everyone,

I am trying to build the Tradebeans and Tradesoap from the DaCapo source with Java 1.6, Maven 2.1.0 and javacc 4.2.
It seems the source must be compiled with Java 1.5 instead of 1.6. The build error reporting that is shown in Error 1. However,
switching to 1.5 causes another failure, as shown in Error 2. Is there anything else I can do to try and get these 
benchmarks to compile? Thank you for taking the time to read this.

- Diogenes

Error 1:
[exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] Scanning for projects...
     [exec]      [exec] [INFO] Reactor build order: 
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Schema
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Builder
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Server
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Naming Builder
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Security Builder
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Test DDBeans
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Web 2.5 Builder
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Deployer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: JSR-88 EAR Configurer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: JSR-88 JAR Configurer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: JSR-88 RAR Configurer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: JSR-88 WAR Configurer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Unavailable Client Deployer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Unavailable EJB Deployer
     [exec]      [exec] [INFO]   Geronimo Plugins, J2EE :: Unavailable Web Services Deployer
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] Building Geronimo Plugins, J2EE
     [exec]      [exec] [INFO]    task-segment: [install]
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] [enforcer:enforce {execution: default}]
     [exec]      [exec] [WARNING] Rule 0: org.apache.maven.plugin.enforcer.RequireJavaVersion failed with message: Detected JDK Version: 1.6.0-27 is not in the allowed range [1.5,1.6).
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [ERROR] BUILD ERROR
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] For more information, run Maven with the -e switch
     [exec]      [exec] [INFO] ------------------------------------------------------------------------
     [exec]      [exec] [INFO] Total time: 2 seconds
     [exec]      [exec] [INFO] Finished at: Wed Jul 24 15:06:21 EDT 2013
     [exec]      [exec] [INFO] Final Memory: 21M/240M
     [exec]      [exec] [INFO] ------------------------------------------------------------------------

Error 2:
Buildfile: /home/dan/research/benchmarks/build.xml
BUILD FAILED
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:88)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:278)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:107)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:120)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:104)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:172)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:273)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:178)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
at org.apache.tools.ant.Main.runBuild(Main.java:793)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)