Hi Steffen,

stopOOoConnection disposed all OO objects including the bridge to the remote office. It's not surprising that you get the DisposedException.

There is currently no clean way to shutdown the office process from the bean. Even if it would work the XDesktop.terminate() is an ugly way to do it and can have unexpected side effects.

You can try OOoBean.clear() which keeps the connection alive. But i assume that is doesn't work either. I haven't tested it.

Terminating the office this way can have unexpected side effects if you don't work with different user installations ...

It's indeed not optimal and it would be really nice to have a clean and controlled way to terminate the office or at least to trigger a termination if the bean would be the last client of the office process.

Juergen


Steffen Boersig wrote:
Hi,

I'm currently trying to get OO Documents embedded into a JFrame. Mainly working with examples from the developers Guide such as OOoBeanViewer.java . I encountered the problem, that I'm not able to correctly terminate my OO process through the XDesktop interface. Neither with the example given in OOoBeanViewer.java nor with self-made closing routines.
The source code for terminating in the example looks like this:

   private void terminate()
   {
       setVisible(false);
       com.sun.star.frame.XDesktop xDesktop = null;
       try
       {
           xDesktop = aBean.getOOoDesktop();
       }
       catch (com.sun.star.comp.beans.NoConnectionException aExc)
       {
       } // ignore
       aBean.stopOOoConnection();
       stop();
       if (xDesktop != null)
           xDesktop.terminate();
       System.exit(0);
   }

I'm always getting a DisposedException Error. If I move aBean.stopOOoConnection() down further, after xDesktop.terminate(), no exception arises anymore. But the processes soffice.bin and soffice.exe are still running. By searching the web I found several approaches to this problem. (Killing the office process programatically, trying to close with XComponent::dispose() -- didn't work, starting in headless mode etc. etc.)

Most of them were ugly workarounds and they were from 2.x .

On this mailing list was once the same question but it was back in 2004 ( http://markmail.org/message/ostlb4xtc6axzqah ) and the answer was to use XDesktop::terminate(). But as already stated it's not working for me at the moment. Am I'm doing sth. wrong here or is it a bug that appeared in 3.x?

I'm using OOo 3.1.1(OOO310m19 Build9420), Java 1.5_017 and Windows XP.

Any advice/info would be great.

Regards,
Steffen Börsig

---------------------------------------------------------------------
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]

Reply via email to