Sorry for the previous mail, just ignore it. I missclicked :/

Hi,

I encountered a problem today while executing my code several times.
I'm connecting to an remote OOServer which is started in invisible and headless mode. From a GUI application the user can execute a printing job to create an openoffice(writer) document filled with the data he selected. The code for this works fine, at least most of the time. Now and then I get the following error ( *** is manually inserted for privacy reasons):

java.io.IOException: com.sun.star.io.IOException: EOF reached - socket,host=openoffice,port=8100,localHost=***,localPort=39629,peerHost=openoffice,peerPort=8100 com.sun.star.lang.DisposedException: java.io.IOException: com.sun.star.io.IOException: EOF reached - socket,host=openoffice,port=8100,localHost=***,localPort=39629,peerHost=openoffice,peerPort=8100 at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:176)

The server crashed and has to be restarted to try again. After executing the EXACT same code right after a crash, I sometimes get the "ASCII Filter Options"-Dialog which is used when OO doesn't know how to open the file. Otherwise I get the same error again. After that I wait a couple minutes and try again and all works well again. At least for a couple of times till I get the mentioned error again.

I googled the problem and found that others encountered an equal problem sometimes and one claimed, that after disposing the document, he got rid of his error. I tried that , but it didn't solve my problem :/ .
My closing operation for documents is:

   public void close() throws OpenOfficeException
   {
       XModifiable modifiable = (XModifiable) UnoRuntime.queryInterface(
               XModifiable.class, this.component);

       if (this.xModel != null)
       {
           // It is an full featured office document.
           // Try to use the close mechanism instead of the hard dispose().
           // But maybe such service is not available on this model
           if (this.xCloseable != null)
           {
               try
               {
                   modifiable.setModified(false);
                   this.xCloseable.close(true);
               }
               catch (CloseVetoException cve)
               {
                   // use close(boolean DeliverOwnership) ->
                   // The boolean parameter DeliverOwnership tells objects
                   // vetoing the
                   // close process that they may assume ownership if they
                   // object
                   // the closure by throwing a CloseVetoException
// Here we give up ownership. To be on the safe side, catch
                   // possible veto exception anyway.
                   throw new OpenOfficeException("Error closing document "
                           + this.xModel.getURL(), cve);
               }
               catch (PropertyVetoException e)
               {
                   throw new OpenOfficeException("Error closing document "
                           + this.xModel.getURL(), e);
               }
           }
           else
           {
// If close() is not supported by this model - try to dispose
               // it.
// But if the model disagree with a reset request for the modify
               // state
// we shouldn't do so. Otherwise some strange things can happen.
               this.xDisposeable.dispose();
           }
       }
   }

Is there anything wrong with it? Any support/hints for solving my problem would be appreciated.

Regards,
Steffen

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to