Apache OpenOffice (AOO) Bugzilla – Issue 114574
Writer hangs on fast programmatic file generation
Last modified: 2017-05-20 11:33:38 UTC
<pre> public static void main(String[] args) throws Exception { XComponentContext xContext = Bootstrap.bootstrap(); XMultiComponentFactory xMCF = xContext.getServiceManager(); Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext); XComponentLoader tempLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, oDesktop); String sUrl = "file:///C:/dev/workspaces/any/OpenOfficeConnectionTest/Writer2.odt"; for (int i = 1; i <= 50; i++) { XComponent xComp = tempLoader.loadComponentFromURL(sUrl, "_blank", 0, new PropertyValue[0]); XStorable xStorable = (XStorable)UnoRuntime.queryInterface(XStorable.class, xComp); File tempFile = File.createTempFile("WriterTest", ".odt"); tempFile.deleteOnExit(); StringBuffer sSaveUrl = new StringBuffer("file:///"); sSaveUrl.append(tempFile.getCanonicalPath().replace('\\', '/')); PropertyValue[] propertyValue = new PropertyValue[1]; propertyValue = new PropertyValue[2]; propertyValue[0] = new PropertyValue(); propertyValue[0].Name = "Overwrite"; propertyValue[0].Value = new Boolean(true); propertyValue[1] = new PropertyValue(); propertyValue[1].Name = "FilterName"; propertyValue[1].Value = "StarOffice XML (Writer)"; xStorable.storeAsURL(sSaveUrl.toString(), propertyValue); XCloseable tempCloseable = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xComp); tempCloseable.close(true); System.out.print(i % 10 == 0 ? ":" : "."); } System.exit(0); } </pre> PS: I have no idea how to format issue in bugzilla, sorry.
I am sorry, the actual description is missing. Why cant I edit my own bug report? Description: We are using OOo Writer from a Java Desktop Client to generate documents. However, the client hangs quite often when calling into the OOo-API. Here a *very basic* demonstration of a this: Just opening a file, saving it, a couple of times in a loop. Hangs on my machine after <5 loop executions.
Mathias, please dispatch.
It would help a lot if we could get a stack trace or at least a hint which call is blocked.
Here is the stack trace of all active threads: LoadCloseWriter [Java Application] mypackage.LoadCloseWriter at localhost:63117 Thread [main] (Suspended) Object.wait(long) line: not available [native method] JobQueue.removeJob(int) line: 230 JobQueue.enter(int, Object) line: 340 JobQueue.enter(Object) line: 313 JavaThreadPool.enter(Object, ThreadId) line: 101 java_remote_bridge.sendRequest(String, Type, String, Object[]) line: 652 ProxyFactory$Handler.request(String, Object[]) line: 154 ProxyFactory$Handler.invoke(Object, Method, Object[]) line: 136 $Proxy6.close(boolean) line: not available LoadCloseWriter.main(String[]) line: 59 Thread [Pipe: CO> ] (Suspended) FileInputStream.readBytes(byte[], int, int) line: not available [native method] FileInputStream.read(byte[], int, int) line: 199 BufferedInputStream.read1(byte[], int, int) line: 256 BufferedInputStream.read(byte[], int, int) line: 317 StreamDecoder.readBytes() line: 264 StreamDecoder.implRead(char[], int, int) line: 306 StreamDecoder.read(char[], int, int) line: 158 InputStreamReader.read(char[], int, int) line: 167 BufferedReader.fill() line: 136 BufferedReader.readLine(boolean) line: 299 BufferedReader.readLine() line: 362 Bootstrap$1.run() line: 322 Thread [Pipe: CE> ] (Suspended) FileInputStream.readBytes(byte[], int, int) line: not available [native method] FileInputStream.read(byte[], int, int) line: 199 StreamDecoder.readBytes() line: 264 StreamDecoder.implRead(char[], int, int) line: 306 StreamDecoder.read(char[], int, int) line: 158 InputStreamReader.read(char[], int, int) line: 167 BufferedReader.fill() line: 136 BufferedReader.readLine(boolean) line: 299 BufferedReader.readLine() line: 362 Bootstrap$1.run() line: 322 Thread [MessageDispatcher] (Suspended) PipeConnection.readJNI(byte[][], int) line: not available [native method] PipeConnection.read(byte[][], int) line: 210 XConnectionInputStream_Adapter.read() line: 59 DataInputStream.readInt() line: 370 urp.readBlock() line: 349 urp.readMessage() line: 89 java_remote_bridge$MessageDispatcher.run() line: 122 C:\Program Files (x86)\Java\jdk1.6.0_20\bin\javaw.exe (20.09.2010 12:10:57)
Reset assigne to the default "issues@openoffice.apache.org".