Hey,
Locating a native library loaded by a Java jar is typically done using relative path entries in the jar manifest Class-Path. Resolving a relative path relative to a symlink can obviously have different results, depending on whether or not the symlink is resolved.
For Java there seems to be no problem resolving symlinks. I placed my main jar in <OO Installation>/basis-link/program/ and did put symlinks and other needed jars into a newly createed <OO Installation>/basis-link/program/lib folder. Resolving those symlinks was no problem for Java as I could see in -verbose mode. All classes/methods were properply loaded, except those JNI methods. I don't know why it is like that and if that is needed or a missing feature from classloaders/infrastructure.
However, setting up infrastructure so that a (copied?) officebean.jar finds its dependency jars will always be brittle and will likely break with new OOo versions. What confuses me is that you need such infrastructure at all.
I did in all tests use the original officebean.jar from OOo installation since it's the same folder structure under windows with <OO Installation>/basis-link/program/classes/officebean.jar whereas basis-link is resolved by my setup in Windows and just used under linux as is. But only using officebean.jar did result in missing classes since as you stated the Class-Path is empty. So I had to get the other jars in my Class-Path. My first solution was to refer to them with symbolic links to get rid of all platform dependent folder structures. (Don't know if Solaris or any other systems have again different structures so I didn't want to bother with creating xx versions of my original jar with different manifest files.) Instead I did want to edit the setup file for different folder structures. I don't know if it is intended that the Class-Path of officebean.jar is empty or if it's simply a bug. I'd say it's a missing feature at least ;) But maybe Jochen can enligthen us both.
If the latter (a copy of officebean.jar located outside the OOo installation), I wonder whether that is an intended way to use the bean, and, if it is, could mention a stable way to obtain from an OOo installation a list of jars (with absolute path) that are necessary in order to use Java UNO. Namely, calling executable "unoinfo" in the brand layer program directory with argument "java" (i.e., "openoffice.org3/program/unoinfo java") and processing its output (as done by the Simple Bootstrap mechanism), see <http://www.openoffice.org/issues/show_bug.cgi?id=88687#desc3>.
That seems to be a nice way of getting what I need. I'll take a deeper look into it when there's more freetime.
Anyway, maybe I misunderstand how officebean.jar is intended to be used, Jochen (on cc) probably can put me straight.
Please answer/copy the answer on the mailing list Jochen.

Regards,

Steffen B

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to