java System.exit causes Oo server to crash

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
quodlibetarian
Posts: 3
Joined: Tue Sep 06, 2016 5:54 pm

java System.exit causes Oo server to crash

Post by quodlibetarian »

I am running the java API against Oo documents. If the code below is run, then a java call to System.exit(0) causes the Oo server to crash.

'doc' is a draw document

public String m(int s, int c){
try{
XComponent doc = ...;
XMasterPagesSupplier xDPS = UnoRuntime.queryInterface(XMasterPagesSupplier.class, doc);
XDrawPages xDrawPages = xDPS.getMasterPages();
XDrawPage xDrawPage = getXPage(xDrawPages, 0, false);

XIndexAccess xIndexAccess_2 = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xDrawPage );
XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xIndexAccess_2.getByIndex( s ));

XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xShape );
XTable xTable = (XTable) UnoRuntime.queryInterface(XTable.class, xPropertySet.getPropertyValue( "Model" ));

XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, xTable );

// issue disappears if the following lines are not called
XCell xCell = xCellRange.getCellByPosition(c , 0);
new UnoService(xTable).showAll();

XText xText = (XText) UnoRuntime.queryInterface(XText.class, xCell );
String rv = xText.getString();

return rv;
}
catch(Exception e){
...;
}
}

if the code 'xCellRange.getCellByPosition(c , 0);' is not called, then the Oo server does not crash.

LibreOffice 5.1.4.2
Operating system : Kubuntu 18.04
Java 1.8.0.05 (both in java development environment and Oo tools >> options)
I have a system monitor running which shows enough resources are available

The code works and produces the desired results.

Any ideas?
Open Office 3.1 on Kubuntu 14.04
Post Reply