Re: OpenOffice sample TextReplace throws BootstrapException

Ariel Constenla-Haile <[email protected]>
Newsgroups gmane.comp.openoffice.devel.general
Message-ID <[email protected]>
Hello Harsha,

On Friday 10 December 2010, 19:18, Harsha Ravnikar wrote:
> Hi Ariel,
> 
> Thanks for your reply. I see that the latest version available is 3.3.0
> Release Candidate 7. If you are using version 3.4... are you  one of the
> developers?

well I don't dare to call myself that, so let's say I'm a community contributor.

> I have version 3.2 from Ubuntu repository. I believe that should be fine
> too.

yes, but with the SDK from Ubuntu's repos:

~$ sudo apt-get install openoffice.org-dev openoffice.org-dev-doc

> I had not tried TextReplace.java from the distribution. So I picked it from
> my local installation
> 
> /usr/lib/openoffice/basis3.2/sdk/examples/java/Text/TextReplace.java
> 
> created a plain java project in my NetBeans IDE. 

this is your main error. As I said before, you need the bootstrap glue code.

* Install the NetBeans OOo plug-in:
http://api.openoffice.org/files/documents/22/4772/org-openoffice-extensions-2.0.7.alpha.nbm

* set up your OOo installation
 Tools - Options - Miscellaneous . OOo API Plugin
In "OpenOffice.org Installation" browse to (and select)
/usr/lib/openoffice
or
/usr/lib64/openoffice
if you're on 64 bits system.

* create a project using the template in the category 
 OpenOffice.org - OpenOffice.org Client Application

you'll see that the generated project has a package folder named 
com.sun.star.lib.loader
You would have seen this already if you had downloaded
and played with the new version of the example I uploaded.

> Added the library
> "OpenOffice.org" which has the following jars:
> 
> /usr/lib/openoffice/basis3.2/ure-link/share/java/juh.jar
> /usr/lib/openoffice/basis3.2/ure-link/share/java/jurt.jar
> /usr/lib/openoffice/basis3.2/ure-link/share/java/ridl.jar
> /usr/lib/openoffice/basis3.2/program/classes/unoil.jar
> 
> 
> and compiled it, OK. When I run it (from IDE) I get the following
> Exception:
> 
> run:
> com.sun.star.comp.helper.BootstrapException: no office executable found!
>         at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:246)
>         at TextReplace.main(TextReplace.java:64)
> BUILD SUCCESSFUL (total time: 3 seconds)

as already said, you need the bootstrap glue code (also, a good manifest, 
and if you try it on Win, the unowinreg.dll, etc).
Just follow the steps indicated above, and study the files generated by the 
NB plug-in (and look the contents of the generated jar, to get an idea of what 
is happening).

This compiled project runs even from the command line with:

$ cd TextReplace/dist/
$ java -jar TextReplace.jar 


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iQIcBAABCAAGBQJNA55LAAoJEMjP1bm45QNW53MP/1CKSoOhpXBAYpnxtZVdY0GG
TG3XjqYr0vt0g9OtXwGmPtapml6QQ/yffhY2ZoNgHrznfqv26cTo2gp20NeMgZlc
rtaRbKUavgLGBNY4odWWc71/pvUnqT5N0yD9wzLTs7zPZXNeTiTGlJGPzm+mLaqu
JVzPkzevex1cSrUEHcBLV2dwOAYwxLAN58acOkywgxVloy5KpPmbKLcrgvr9RQ+E
bymdAOlHwsJ1Txj9lRO/TyrEYfb5Nbrcsgiw7D5MPNhDWxCN21FbcneNdQ7W4XZ9
LBQy/A95ouzLnx9kXi2YcxvCFnfR8hN+ieuaZ8292JppqrebyPZHhJmDYmeuGTOD
VNCs7EJFQEknxVTqIlSSWc5/vZpxxxgFwwapI0FfsFPQxaZd+CPKe/0O9XPwhOBk
GDHgOeLj3DLNsjk80n25usLPLLC5TExxsyJEP14rT2JGnlzGNSYcv9iZMIiF7l6y
Qh9PsNVGkff2dHYU0bFqqj6cBTjq9GhX+fZjmMGa6u9f+TWax+lUjWTwedKSF5Gz
Y7LHQX68wNuSuj1gtkTp2L+bJryzvwyzvadF65U71ozsLWFO7H6HjZct3IqIL+mL
+sfJawVVJMLxwMXP7KFLakMD2vHphWxL0LOx4ihHS8sKfipX2d4YEiGH2/JvC3hk
sJd2uWzPt/z2wWiGF7p1
=zKoV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.