Community
Participate
Working Groups
With JDK 1.5, executing 'ant test-oxm' and 'test-jaxb' from trunk fails during compiling the tests. The error is "package javax.xml.bind does not exist". The package is in trunk\moxy\plugins\javax.xml.bind_2.0.0.jar, I cannot see the jar in the compiling classpath, how come there are no problems with JDK 1.6? Error message: ============== compile-tests-against-jar: [javac] Compiling 1078 source files to /net/stame10.us.oracle.com/scratch/aime/eclipselink/org.eclipse.persistence/trunk/moxy/eclipselink.moxy.test/classes [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] Compiling 130 source files to /net/stame10.us.oracle.com/scratch/aime/eclipselink/org.eclipse.persistence/trunk/moxy/eclipselink.moxy.test/classes [javac] /net/stame10.us.oracle.com/scratch/aime/eclipselink/org.eclipse.persistence/trunk/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java:20: package javax.xml.bind does not exist [javac] import javax.xml.bind.JAXBContext; [javac] ^
(Blaise) The JAXB APIs are included with JDK 1.6, but for JDK 1.5 you need to supply them in jar.
Created attachment 118841 [details] patch file for changes - Add eclipselink.moxy.depend and remove jaxb-api.lib in trunk/moxy/eclipselink.moxy.test/build.properties - Include ${eclipselink.moxy.plugins}/${eclipselink.moxy.depend} in the classpaths of build and test targets
Feedback from Blaise: Ultimately we need it to be included with only 1.5. I believe some versions of JDK 1.6 include JAXB 2.0 and others include JAXB 2.1, so I'm concerned with always including a JAXB 2.0 jar on the classpath.
Created attachment 118927 [details] revised patch based on feedback from Blaise Include jaxb api jar in the classpath only on JDK 1.5
Created attachment 118947 [details] revised patch Reduce 2 <condition> tasks to one in the patch
The jaxb api jar had been in the classpaths. With Eric's build reorg checkins, the jar was renamed and moved to another directory, it is not in the classpaths any more. Testing moxy still works on JDK 1.6 because the JAXB APIs are included with JDK 1.6, but it fails on JDK 1.5. With this patch, per Blaise's request, trunk\moxy\plugins\javax.xml.bind_2.0.0.jar will be included in the classpaths only if testing moxy on JDK 1.5. Code reviewed by: Blaise Doughan, Eric Gwin
Edwin's statements as to the cause of this issue are misleading. The jaxb api library name was not changed in my transaction. However, I did move third-party library definitions into the respective component builds. The definition for javax-api.lib was seemingly unneeded, since the compile worked without it, so I removed it. The issue wasn't found because: - prior to my change the definition in trunk build.properties of "jaxb-api.lib" was correct (moxy/plugings/javax.xml.bind_2.0.0.jar) and overrode the local incorrect definition (../eclipselink.moxy.lib/jaxb-api.jar). - the default build now uses JDK 6 which includes javax.xml.bind - after my change, only the incorrect definition was set but it was not used unless the compile was done with an older JDK.
The same problem actually exists with the org.eclipse.persistence.moxy build since the "javax-api.lib" is local (and also incorrect) but unused, unless JDK5 is used in the compile. I will fix the scripts.
reopening to add patch.
was unable to create patch.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink