Problem of Developer's Guide Examples "OOoBeanViewer"

2 replies [Last post]
william
Offline
Last seen: 1 year 44 weeks ago
Title:
Joined: 23 Jul 2014
Posts: 2
Hello,

I want to see if i can embed Libreoffice in a Java Application. And i tried with the “Developer’s Guide Examples” on link
http://api.libreoffice.org/examples/DevelopersGuide/OfficeBean/OOoBeanVi....

After i installing Libreoffice & SDK with version 4.2.5 and finish the code(uploaded libre_OOoBeanViewer.zip), the demo UI can show normally, but if i click “new document” and select any item, Exception throws as.


Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no officebean in java.library.path

For this Exception, i guess it might cause “libofficebean.so” file which in “/opt/libreoffice/program” was not involved in current property “java.library.path”. I tried with the folloing code to update system property.


 String property = System.getProperty("java.library.path");
 System.setProperty("java.library.path", property + ":/opt/libreoffice4.2/program");
 System.out.println("java.library.path=" + System.getProperty("java.library.path"));

But it’s no use. Please refer the attached “6.jpg”.

And if you try “new document”, another Exception throws as follow


Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.sun.star.comp.beans.LocalOfficeConnection
	at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:269)
	at com.sun.star.comp.beans.OOoBean.getMultiServiceFactory(OOoBean.java:289)
	at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:557)
	at com.test.oobean.OOoBeanViewer.createBlankDoc(OOoBeanViewer.java:322)
	at com.test.oobean.OOoBeanViewer.access$1(OOoBeanViewer.java:313)
	at com.test.oobean.OOoBeanViewer$5.actionPerformed(OOoBeanViewer.java:168)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

Does anybody can help me solve this problem? Any suggestion & help is greatly appreciated.

Thanks
William

AttachmentSize
libre_OOoBeanViewer.zip1.42 MB
6.jpg319.29 KB
william
Offline
Last seen: 1 year 44 weeks ago
Title:
Joined: 23 Jul 2014
Posts: 2
Issue was resolved!
Issue was resolved!
kalaiselvan
Offline
Last seen: 33 weeks 5 days ago
Title:
Joined: 7 Oct 2015
Posts: 1
NEED A HELP
i am also having same error suddenly i saw u r post so that i am asking with you how to set path for error reply me back

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.