First time here? Check out the FAQ!
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 com.sun.star.lang.DisposedException exception.
I am using this command to start LO in headless mode
/opt/libreoffice3.4/program/soffice --headless --accept="socket,host=192.168.0.176,port=8100;urp;"
My code is as below
String connectionString = "socket,host=" + "192.168.0.176" + ",port=" + "8100" + ",tcpNoDelay=1";
XComponentContext localContext = Bootstrap.createInitialComponentContext(null);
XMultiComponentFactory localServiceManager = localContext.getServiceManager();
XConnector connector = (XConnector) UnoRuntime.queryInterface(com.sun.star.connection.XConnector.class,
localServiceManager.createInstanceWithContext("com.sun.star.connection.Connector", localContext));
XConnection connection = connector.connect(connectionString);
XBridgeFactory bridgeFactory = (XBridgeFactory) UnoRuntime.queryInterface(
com.sun.star.bridge.XBridgeFactory.class, localServiceManager.createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", localContext));
XBridge bridge = bridgeFactory.createBridge("", "urp", connection, null);
XComponent bridgeComponent = (XComponent) UnoRuntime.queryInterface(com.sun.star.lang.XComponent.class, 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.
Thanks
Kaushal
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-04-24 13:20:02 +0200
Seen: 116 times
Last updated: Mar 13
Does LO require Java to load properly?
Is LibreOffice 4 available for Android?
Can I access a list of recent documents longer than 10 entries?
Custom Numbered Lists with sub/superscripts
Can spreadsheets and documents be separated in the Windows 7 taskbar?
Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
@kaushalc -- Have you found an Answer to your question? Still interested in us tracking down the issue here?
qubit ( 2013-03-10 09:55:09 +0200 )edit