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?
java System.exit causes Oo server to crash
Java, C++, C#, Delphi... - Using the UNO bridges
-
- Posts: 3
- Joined: Tue Sep 06, 2016 5:54 pm
java System.exit causes Oo server to crash
Post by quodlibetarian »
Open Office 3.1 on Kubuntu 14.04
Jump to
- Getting started
- ↳ Survival guide
- ↳ Beginners
- ↳ Getting Started Guide for 4.x
- ↳ Getting Started Guide for 3.x
- ↳ Install, Setup and Troubleshooting
- ↳ Admin Guide
- ↳ MS Windows
- ↳ Linux
- ↳ Mac OSX
- ↳ LibreOffice
- ↳ Tablets
- ↳ Tutorials
- ↳ Writer
- ↳ Calc
- ↳ Base
- Applications
- ↳ Writer
- ↳ Writer Guide for 4.x
- ↳ Writer Guide for 3.x
- ↳ Writer Tutorials
- ↳ Templates
- ↳ Advanced Uses
- ↳ Calc
- ↳ Calc Guide for 4.x
- ↳ Calc Guide for 3.x
- ↳ Calc Functions
- ↳ Calc Tutorials
- ↳ Impress
- ↳ Impress Guide for 4.x
- ↳ Impress Guide for 3.x
- ↳ Draw
- ↳ Draw Guide for 4.x
- ↳ Draw Guide for 3.x
- ↳ Math
- ↳ Math Guide for 4.x
- ↳ Math Guide for 3.x
- ↳ Math Guide for 3.x
- ↳ Base
- ↳ Base Guide for 4.x
- ↳ Wiki
- ↳ Base Tutorials
- ↳ Tables & Queries
- ↳ Forms
- ↳ External Data Sources
- ↳ Reporting
- ↳ Database Examples
- Customizing and Extending
- ↳ Macros and UNO API
- ↳ Basic Guide
- ↳ Code Snippets
- ↳ Extension Repository
- ↳ Macro Repository
- ↳ External Programs
- ↳ Extensions
- ↳ Extensions page
- Community
- ↳ General Discussion
- ↳ Site Feedback
- ↳ Forum Governance
- ↳ User Experience (UX)
- ↳ Announcements
- Business
- ↳ Institutions & Educational
- ↳ Paid support
- ↳ Consultants Directory