Hi all,
I am trying to re-connect to libreoffice after a call to xDesktop.terminate() or BootstrapConnector.disconnect():
BootstrapSocketConnector bootstrapSocketConnector = new BootstrapSocketConnector(OOOEXEFOLDER);
XComponentContext xContext = bootstrapSocketConnector.connect();
XMultiComponentFactory xRemoteServiceManager = xContext.getServiceManager();
Object desktop = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, desktop);
......
......
xDesktop.terminate(); //or bootstrapSocketConnector.disconnect()
and then:
xContext = bootstrapSocketConnector.connect();
Then, whatever I try to do with xDesktop, xContext I keep getting an
com.sun.star.lang.DisposedException: java_remote_bridge com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge
or
java.io.IOException: EOF reached - socket,host=localhost,port=8100,localHost=127.0.0.1,localPort=63519,peerHost=localhost,peerPort=8100
exception. Any ideas what am I doing wrong?
Regards,
lgs