Hello Harsha,

On Friday 10 December 2010, 02:47, Harsha Ravnikar wrote:
> Hi,
> 
> I am trying out OpenOffice example "TextReplace" available from the
> following URL:
> 
> http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextReplac
> e
> 
> I am also using bootstrapconnector.jar available from
> http://user.services.openoffice.org/en/forum/viewtopic.php?t=2520
> 
> While executing it, I get the following exception:
> 
> com.sun.star.comp.helper.BootstrapException
>         at
> ooo.connector.BootstrapConnector.connect(BootstrapConnector.java:129)
>         at
> ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.jav
> a:68) at
> ooo.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.jav
> a:45) at
> ooo.connector.BootstrapSocketConnector.bootstrap(BootstrapSocketConnector.j
> ava:82) at
> org.openoffice.sdk.example.text.TextReplace.getDesktop(TextReplace.java:175
> ) at
> org.openoffice.sdk.example.text.TextReplace.main(TextReplace.java:63)
> 
> 
> I have pasted below the full method thats corresponds to
> BootstrapConnector.java:129. Exception occurs when the statement
> oooServer.start(oooAcceptOption);is executed. The exception occurs
> even when OpenOffice write is running. Can
> anyone let me know how to resolve this issue?

this example does not throw the exception, it's the  bootstrapconnector.jar, 
so you should ask the one who delivers that jar.
I don't have time to look at that forum, but simply reading that it suggests 
to hard-code the "folder of your OpenOffice.org executable to a String 
variable" 
makes this look rather suspicious to me.

On the other hand, the TextReplace sample comes with the SDK, did you try to 
build it and run it in the SDK env.? I just did and works fine. The sample is 
in
</opt/openoffice.org/basis3.4/>sdk/examples/java/Text/TextReplace.java

Notice that the NetBeans project on that wiki page that you can download:
http://wiki.services.openoffice.org/wiki/File:TextReplace.zip
was outdated (made for OOo 2.4), and it misses the bootstrap glue code, that's 
why you get a com.sun.star.comp.helper.BootstrapException: no office executable 
found! even if you fix the missing OOo 2.4 library issue.
I loaded a new version now, you can try it with the latest NetBeans and latest 
OOo (you just have to change the project's settings, because I'm working with 
a OOo 3.4).
 

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to