Hi Stefan/All, I've been trying to track down why the jvm isn't usable in unit tests (attempted fix in https://gerrit.libreoffice.org/#/c/5936/ )
stoc/source/javavm/javavm.cxx needs to find java which it does by expanding URE_INTERNAL_JAVA_DIR. This seems to be set within "unorc", which is found automatically by cppuhelper (cppuhelper/source/paths.cxx -- getUnoIniuri()) -- this loads unorc from wherever cppuhelper library is found(called libuno_ccpuhlpergcc3.so -- not sure why this is the naming scheme?). Running LO from instdir: instdir/unxlngx6/ure/lib/unorc is used (generated by scp2/source/ooo/ure.scp) -- this contains the expected URE_INTERNAL_JAVA_DIR Running unit tests -- seems to happen in solver/, and solver/unxlngx6/lib/unorc is used (directly copied from cppuhelper/source/unorc), this one doesn't contain any JAVA paths so the jvm can't be loaded. I've just hardcoded the new path into cppuhelper/source/unorc . I don't know enough about the instdir changes to know whether this is a good long term solution though? There is also the classpath variable -- in the instdir unorc this is set as URE_INTERNAL_JAVA_CLASSPATH=${URE_MORE_JAVA_TYPES} URE_MORE_JAVA_TYPES is set in fundamentalrc, of which there is also a copy in solver (but under installation/program/...), I'm still looking into whether this is loaded too in a unit test environment, but for the moment I've just copied the same URE_INTERNAL_JAVA_CLASSPATH line: I haven't tested yet whether this works -- I'll try that next. What I'm still not able to do is have hsqldb itself load (fails on can't find org.hsqldb.jdbcDriver or similar) --this is since the driver has the hsqldb.jar path hardcoded in the sources as "$BRAND_BASE_DIR/" LIBO_SHARE_JAVA_FOLDER "/hsqldb.jar" (and the jdbc drivers specifically only load classes from the driver specific classpath) -- I guess if unit tests were to be run in instdir then that would allow things to work, I'm still thinking about how best to let them run in the current solver though (although I hear solver is to be gotten rid of eventually). Cheers, Andrzej _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice