There's a problem with setting up dynamic enhancement for OpenJPA 2.1.0
with recent Oracle JDKs on Linux, related to the java.home system property.
org.apache.openjpa.enhance.InstrumentationFactory.findToolsJar()
attempts to load the tools.jar from ${java.home}/lib/tools.jar.
The problem is that even when running under the JDK, java.home points to
/usr/lib/jvm/java-6-sun/jre instead of /usr/lib/jvm/java-6-sun.
Just to rule out that Ubuntu's packaging might cause the problem, I
downloaded the latest JDK 1.6.0_24, installed it in my home folder and
ran a System.println(System.getProperty("java.home") both from
[java_install]/bin/java and [java_install]/jre/bin/java, and in both
cases, the result was [java_install]/jre.
So it appears the special case
if (JavaVendors.getCurrentVendor().isIBM()) {
in findToolsJar() is now also required for Oracle's JDK.
This looks like a bug or at least an incompatible change in the JDK to
me, but then again, the structure of a JDK installation is vendor
dependent, and I'm not sure that OpenJPA's lookup logic is failsafe.
For now, I just created a symlink in my JDK so that OpenJPA finds
tools.jar under .../jre/lib.
Are there any better solutions? Should I file an issue in JIRA?
Regards,
Harald
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de