I have the same problem too. Even the java is terminated, the soffice process(tow processes as show below ) still running.
14803 pts/3 S 0:00 /bin/sh /opt/openoffice.org3/program/soffice -nologo -nodefault -norestore -nocrashreport -nolockcheck -accept=pipe,name=uno1583999052068028538;urp;
14863 pts/3 Sl 0:02 /opt/openoffice.org3/program/soffice.bin -nologo -nodefault -norestore -nocrashreport -nolockcheck -accept=pipe,name=uno1583999052068028538;urp;
I recently ran into this problem. It's hard to find the right bridge. After much digging, I found the local service manager had a reference. Here is a method I wrote that closes the connection, leaving both processes running. It is safe to call even when there is no connection.
import static com.sun.star.uno.UnoRuntime.queryInterface;
import com.sun.star.bridge.XBridge;
import com.sun.star.bridge.XBridgeFactory;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.lang.XComponent;
/**
* Close our connection to the office process.
*/
public static void closeOfficeConnection() {
try {
// get the bridge factory from the local service manager
XBridgeFactory bridgeFactory = queryInterface(XBridgeFactory.class,
Bootstrap.createSimpleServiceManager()
.createInstance("com.sun.star.bridge.BridgeFactory"));
if (bridgeFactory != null) {
for (XBridge bridge : bridgeFactory.getExistingBridges()) {
// dispose of this bridge after closing its connection
queryInterface(XComponent.class, bridge).dispose();
}
}
} catch (Throwable e) {
System.err.println("Exception disposing office process connection bridge:");
e.printStackTrace(System.err);
}
} // end closeOfficeConnection()