Closed anti43 closed 8 years ago
This happened to me in Eclipse, too, the reason being LibreOffice plays its own classloader games and Eclipse doesn't like it (I'm not familiar with Netbeans, it might be the same there).
I've been unable to solve the issue programmatically, classpath in manifest prevents ClassDefNotFound exceptions from happening, but doesn't help wih this 'office executable not found' issue. The only thing I was able to do was to add officebean jar (possibly also URE jars) to runtime classpath in Eclipse.
@anti43: How does one run the connection test (in NetBeans or elsewhere)? How does the classpath look like? It would be helpful to know which classloader is being used when it fails, so if you can add some System.out.println(Bootstrap.class.getClassloader().getClass().getName()) to some appropriate place in the test and paste here what it prints ... I might have a way or two to work around the issue, but that one'll have to be implemented in libreoffice core
Hi,
It prints 'sun.misc.Launcher$AppClassLoader' when run in Lo4ConnectTest2.java (has a main method)
Hi I solved the issue in eclipse by adding the path to ...LibreOffice/program as an external class folder to my project (in project properties/libraries) and I also deleted the Classpath in die manifest file.
With the new OfficeLoader, this should no longer be an issue, as long as the app using noa is started through OfficeLoader::run() which stands a fair chance of finding some UNO on the system (if not, one can always specify it the noa-way through IOfficeApplication.*_HOME_KEY)
See src/Lo4ConnectionTest.java on how to do that. One needs two separate classes, or 1 top-level and 1 nested class, the former will call main() method of the latter with the help of OfficeLoader::run.
Gotcha: when rebuilding noa, delete any stale manifest.mf that might still be around.