Hi Mikhail,
Thank you for your answer. Here is the stack of the deadlock:
Threads:
Main
main
Waiting for Monitor: com.sun.star.lib.uno.remote.JobQueue(#621)
Thread-1
Pipe:CO>
Owned Monitors
Owned Monitor: java.io.BufferedInputStream(#624)
Owned Monitor: java.io.InpuitStreamReader(#625)
Pipe: CE>
Owned Monitors
Owned Monitor: java.io.InputStreamReader(#620)
MessageDispatcher
Owned Monitors
Owned Monitor: java.io.BufferedInputStream(#622)
Reference Handler
Waiting for Monitor: java.lang.ref.Reference#Lock(#650)
Finalizer
Waiting for Monitor: java.lang.ref.ReferenceQueue$Lock
Signal Dispatcher
Attach Listener
Thread-2
Waiting for Monitor: java.util.LinkedList(#623)
Stack:
System
'Attach Listener' suspended
'Finalizer' suspended at 'java.lang.Object.wait'
Waiting for Monitor: java.lang.ReferenceQueue$Lock(#653)
java.lang.Object.wait
java.lang.ref.ReferenceQueue.remove:116
java.lang.ref.ReferenceQueue.remove:132
java.lang.ref.Finalizer$FinalizerThread.run:159
'Reference Handler' suspended at 'java.lang.Object.wait'
Waiting for Monitor:java.lang.Reference$Lock(#650)
java.lang.Object.wait
java.lang.Object.wait:485
java.lang.ref.Reference$ReferenceHandler.run:116
'Signal Dispatcher' suspended
'Thread-Z' suspended at 'java.lang.Object.wait'
Waiting for Monitor:java.util.LinkedList(#623)
java.lang.Object.wait
java.lang.Object.wait:485
com.sun.start.lib.util.AsynchronousFinalizer$1.run:89
main
'main' suspended at 'java.lang.Object.wait'
Waiting for Monitor:
com.sun.star.lib.uno.environments.remote.JobQueue(#621)
java.lang.Object.wait
com.sun.star.lib.uno.environments.remote.JobQueue.removeJob:230
com.sun.star.lib.uno.environments.remote.JobQueue.enter:340
com.sun.star.lib.uno.environments.remote.JobQueue.enter:313
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter:101
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest:652
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request:154
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke:136
$Proxy23.storeToURL
LbaEnvelopeAssembler.oooStoreTo:972
LbaEnvelopeAssembler.processTabFilesExt:1521
LbaEnvelopeAssembler.processTabFiles:1428
LbaEnvelopeAssembler.process:1377
LbaEnvelopeAssembler.run:1674
LbaEnvelopeAssembler.main:1655
'MessageDispatcher' suspended at
'java.net.SocketInputStream.socketRead0'
Hidden source Calls
java.net.SocketInputStream.socketRead0
java.net.SocketInputStream.read:129
java.io.BufferedinputStream.fill:218
java.io.BufferedInputStream.read1:258
java.io.BufferedInputStream.read:317
Owned Monitor: java.io.BufferedInputStream(#622)
com.sun.star.lib.connections.socket.SocketConnection.read:158
com.sun.star.lib.uno.bridges.java_remote_XConnectionInputStream_Adapter.read
:59
java.io.DataInputStream.readInt:370
com.sun.star.lib.uno.protocols.urp.urp.readBlock:349
com.sun.star.lib.uno.protocols.urp.urp.readMessage:89
com.sun.star.lib.uno.bridges.java_remote_bridge$MessageDispatcher.run:122
'Pipe: CE>' suspended at 'java.io.FileInputStream.readBytes'
Hidden Source Calls
java.io.FileInputStream.readBytes
java.io.FileInputStream.read:199
sun.nio.cs.StreamDecoder.readBytes:264
sun.nio.cs.StreamDecoder.implRead:306
sun.nio.cs.StreamDecoder.read:158
Owned Monitor: java.io.InputStreamReader(#620)
java.io.InputStreamReader.read:167
java.io.BufferedReader.fill:136
java.io.BufferedReader.readLine:299
java.io.BufferedReader.readLine:362
ooo.connector.server.OOServer$1.run:143
'Pipe: CO>' suspended at 'java.io.FileInputstream.readBytes'
Hidden Source Calls
java.io.FileInputStream.readBytes
java.io.FileInputStream.read:199
java.io.BufferedInputStream.read1:256
java.io.BufferedInputStream.read:317
Owned Monitor: java.io.BufferedInputStream(#624)
sun.nio.cs.StreamDecoder.readBytes:264
sun.nio.cs.StreamDecoder.implRead:306
sun.nio.cs.StreamDecoder.read:158
Owned Monitor: java.io.InputStreamReader(#625)
java.io.InputStreamReader.read:167
java.io.BufferedReader.fill:136
java.io.BufferedReader.readLine:299
java.io.BufferedReader.readLine:362
ooo.connector.server.OOServer$1.run:143
'Tread-1' suspended at
'sun.print.Win32PrintServiceLookup.notifyPrinterChange'
Hidden Source Calls
sun.print.Win32PrintServiceLookup.notifyPrinterChange
sun.print.Win32PrintServiceLookup.access$100:32
sun.print.Win32PrinterServiceLookup$PrinterChangeListener.run:302
I hope this helps in finding where the problem lies.
Could you please signal me if there is something I am doing wrong?
Regards,
Daniel
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: February 24, 2009 4:19 AM
> To: [email protected]
> Subject: Re: [api-dev] Xstorable.storeToUrl locks soffice.bin
>
> Hi Daniel,
>
> First of all what do you name the main thread?
>
> As I understood you use own java application that connects
> the office using UNO API. The main thread of the java
> application does not correspond to the main thread of the
> office process it connects ( at least it was so before ).
>
> As I have written in one of my previous answers, please try
> to use "com.sun.star.awt.AsyncCallback" service to get a
> callback from the office main thread. In this case you can
> use the callback to do your API call in the office main thread.
>
>
> The remaining lock file looks in this case like a result of
> non-closed model. The model is the object that creates lock
> file on document opening and closes it on closing. The office
> never waits for a document lock file to continue, except the
> case of error/query message shown during document opening/storing.
>
> Anyway, the stack of the deadlock would be very interesting.
>
> Best regards,
> Mikhail.
>
> On 02/24/09 07:05, Daniel Brosseau wrote:
> > Hi,
> >
> > In everything done in one main thread with no GUI, my program
> > loadsFromUrl from the Frame a first ODT file and then
> appends one or
> > more ODT files to this through a XTextCursor and
> XDocumentInsertable.
> > After all files are appended I do a XRefreshable.refresh().
> >
> > I then move to the beginning of the XTextDocument and
> insert a Table
> > of Contents, do another XRefreshable.refresh() and a
> > XDocumentIndex.update which I retreived through a XServiceInfo.
> >
> > At this point I can do one of two things:
> > i) print the document through a XPrintable with a property
> "Wait" of
> > true and
> > for belts and suspenders a XPrintJobListener and
> XPrintJobBroadcaster
> > (I do not think I need this with "Wait") Or ii)
> storeToUrl through
> > a XStorable using the PDF filter "writer_pdf_Export",
> > Asynchron of false and Overwrite true.
> >
> > The program then loops back to the beginning and
> > loadsFromUrl/Append/etc for another set of files ... (after
> the load I
> > close the released Xmodel, but am I leaking a Controller which I
> > should also close?)
> >
> > If all I do is print, the the program can handle several
> sets of files
> > without a problem but if I storeToUrl then soffice.bin will
> typically
> > hang after 1 to 5 stores.
> > The specific set of loaded files that causes soffice.bin to hang
> > varies from run to run but inevitably soffice.bin hangs. In the
> > directory from which the files are loaded, I see Appear a file
> > .~lock.fileName.ODT# where the fileName is the name of
> first file of
> > the set that was loaded through loadFromUrl which
> corresponds to the
> > XModel's URL property.
> >
> > Evidently, having soffice.bin hang is a problem. What I
> don't know is
> > if
> > i) it is a threading issue relating to synchronization of
> the store,
> > the refresh or
> > the update
> > Or ii) their is a file lock taken out that soffice.bin is
> waiting to
> > have released before
> > continuing.
> >
> > Really what I would like to know is how to avoid the
> hanging soffice.bin.
> > When soffice.bin
> > hangs, it just sits there consumming around 20% of the CPU with no
> > change to memory usage, bytes read or anything else.
> >
> > Any hints?
> >
> > Thank you,
> >
> > Daniel Brosseau
> >
> >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]