Joachim,
On Tuesday 27 September 2005 08:19 am, Joachim Lingner wrote:
> snpe wrote:
> > Hello,
> >   I try OfficeBean and have one problem :
> > 
> > when I call program with OO jars (jars in OO_HOME/program/classes) it work 
> > fine
> > 
> > I want import jars in my project, but then OfficeBean can't find soffice 
> > program
> > OO seek soffice in /soffice always (linux)
> When using OOoBean then jars, such as jurt.jar, ridl.jar, etc. must be 
> on the class path. They must also be located in the program classes 
> directory. OOoBean uses com.sun.star.lib.util.NativeClassLoader 
> (jurt.jar) to get the location of the executable. NativeClassLoader 
> examines the parent directory of the jar, where it finds soffice.
It is fine when jars are in original position
Example : 
1) create project and add jars from OFFICE_HOME/program/classes in classpath
(no relocate jars, only add in classpath) - It work fine
2) create project, add jars  from OFFICE_HOME/program/classes in my project 
folder
(relocate it) - add relocated jars in classpath.It compile, load class, but 
can't find
officebean libraries (libofficebean.so) - I add 
java.library.path=OFFICE_HOME/program
and libofficebean.so is ok, but OOoBean can't find soffice program.I try add 
soffice in PATH,
java.library.path,com.sun.star.beans.path without success - OOoBean seek 
soffice relative to
jars files - I see NativeClassLoader and it search with loader of class 
LocalOfficeConnection
and relative from officebean.jar - I think that loader have to seek in PATH yet 
(or OFFICE_HOME)
It is simple add in LocalOfficeConnection#getProgramPath for seek in PATH 
(and/or OFFICE_HOME)

> 
> > I link soffice to /soffice for check and get InteruptedException
> > How I can set program location for OfficeBean ?
> One could use an UrlClassLoader that knows the location of soffice to 
> load OOoBean. (never tested that before).
> Have a look at LocalOfficeConnection.getProgramPath and 
> NativeLibraryLoader.getResource.
> 
This not help, because NativeLibraryPath search urls directories (or parent 
directories) only
If I relocate jars then it can't find soffice

My workaround for now is :
make classloader - use OFFICE_HOME env. variable for soffice libraries (add in 
path) dynamic and
load OO classes dynamic with this, but I have to use reflection for calling OO 
method (I work in eclipse
and can't change classloader on runtime, but OO doesn't use context classloader)
It is much better that getProgramPath or NativeClassLoader use PATH (and yet 
any use variable) for search)

There is yet another problem : I try officebean in KDE and it work fine in KDE, 
but when I set
SAL_USE_VCLPLUGIN=gtk it doesn't work - no exception, office start, loadFromURL 
work fine,
acquireSystemWindow work without exception but no connection (panel is empty)
I try from gtk environment, but it isn't work , too (I don't test enough this, 
because my gnome is compiled
and hard patched - gtk is 2.8.4)

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to