Issue 13167 - Crash on using XDesktop.terminate() with the bean
Summary: Crash on using XDesktop.terminate() with the bean
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Sun Solaris
: P3 Trivial
Target Milestone: ---
Assignee: oh
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-08 15:00 UTC by oh
Modified: 2013-02-24 21:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Tar of 4 java files as showcase (56.50 KB, application/octet-stream)
2003-04-08 15:02 UTC, oh
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description oh 2003-04-08 15:00:08 UTC
I'm using OOo 1.1 Beta and the OOBean provided with its installation. To make
sure, that no instance of OOo will be left after closing the last document in
the bean, I want to use the terminate() method of XDesktop. But when I do, the
call of this method causes an "unexpected error" dialog and the office crashes.
As a little showcase I will add  4 classes to this issue.
Comment 1 oh 2003-04-08 15:02:28 UTC
Created attachment 5530 [details]
Tar of 4 java files as showcase
Comment 2 andreas.schluens 2003-04-14 08:28:01 UTC
Sorry -  but this isn't a bug inside office.

a) The code you attached creates a frame outside the global frame tree
of the office with the desktop as root. So a Desktop.terminate() can't
detect it. But at the end of office termination a global object pool
recognizes, that there is at least one document structure and try to
release it ... but it's to late. Most of the office internal
components are already deinitialized and so this request will run into
an access violation.

Solution: If an internal script creates own ressources (especialy
document frames) outside the normal uses cases - it has to release
such private structures BEFORE it calls terminate(). Otherwhise the
results will be undefined. Or it has to use the API right, to make
frames part of the already mentioned frame tree. (see e.g.
XFrame.findFrame("_blank",0)) for further informations)

b) The only bug I've found (and filed another internal bug report for
that) was, that the used TerminateListener runs into it's finalize()
method immediatly after it was added to the desktop listener
container. The remote reference (which exists inside the desktop
container) was valid ... but the client reference was not hold by the
client proxy of the uno bridge. So the listener was not realy added.
But that was not a problem for the attached code - because this
terminate listener will be disabled before terminate() will be called.

c) At least the attached code does not handled an already closed
office connection. So it tries to terminate it more then once -
because the method closeConnection() is used at more then one code
places. So the code has to react for multiple RuntimeException's -
especialy DisposedException's.

Please read the available SDK Manual on openoffice.org or contact
Jürgen Schmidt / Michael Hönnig for further informations on this thema.

Regards
Andreas Schlüns
Comment 3 andreas.schluens 2003-04-15 05:33:10 UTC
.
Comment 4 oh 2003-04-24 14:18:47 UTC
I found out that the TerminateListener seems to work well with
OpenOffice 1.1 Beta and JRE 1.4.1 (build 1.4.1-b21). I did not have
any case where the listener was not called. JRE 1.4.0 does defenetly
not work.

Kind regards
Oliver 
Comment 5 Joost Andrae 2003-10-30 20:38:24 UTC
JA: closing as invalid
Comment 6 Joost Andrae 2003-10-30 20:38:37 UTC
.