Not able to connect to LO from my java app. Getting a disposed exception. [closed]

asked 2012-04-24 13:20:02 +0200

kaushalc gravatar image

updated 2013-03-13 04:21:45 +0200

qubit gravatar image

I am trying to migrate to LO from OO. The java code that I used to connect to OO doesnt seem to be working. I am getting a exception.

I am using this command to start LO in headless mode

/opt/libreoffice3.4/program/soffice --headless --accept="socket,host=,port=8100;urp;"

My code is as below

String connectionString = "socket,host=" + "" + ",port=" + "8100" + ",tcpNoDelay=1";

XComponentContext localContext = Bootstrap.createInitialComponentContext(null);

XMultiComponentFactory localServiceManager = localContext.getServiceManager();

XConnector connector = (XConnector) UnoRuntime.queryInterface(, localServiceManager.createInstanceWithContext("", localContext));

XConnection connection = connector.connect(connectionString);

XBridgeFactory bridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(, localServiceManager.createInstanceWithContext( "", localContext));

XBridge bridge = bridgeFactory.createBridge("", "urp", connection, null);

XComponent bridgeComponent = (XComponent) UnoRuntime.queryInterface(, bridge);

        Object serviceManagerObject = bridge.getInstance("StarOffice.ServiceManager");

I get a disposed exception in the last line at the bridge.getInstance() call.

Any help is greatly appreciated.


edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by qubit
close date 2013-03-21 10:22:14.965295


@kaushalc -- Have you found an Answer to your question? Still interested in us tracking down the issue here?

qubit gravatar imagequbit ( 2013-03-10 09:55:09 +0200 )edit