Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:06:19+00:00 2026-05-28T03:06:19+00:00

I use the OpenOffice API from my Java Program to handle Documents for me.

  • 0

I use the OpenOffice API from my Java Program to handle Documents for me. Sometimes (once every 100k or so calls) the dispose method of a Document does not return, the CPU load stays at 100% but nothing seems to happen.

How should I act / code correctly in this situation?

My current approach is to wait for the dispose to succeed for two seconds. If it does not I try to terminate OpenOffice through the appropriate API. If that fails as well (as I would expect) then I kill the soffice process with a call to

XDesktop xDesk = (...) // achive desktop
xDesk.terminate();
Runtime.getRuntime().exec("pkill soffice"); // "taskkill /IM soffice" on windows

and then call

disposeThread.stop();

to the Thread that initially tries to dispose the XComponent. Now the Java API says that Thread.stop() should not be used (and there are valid arguments to that) so I’m wondering if there are any better solutions that what I did.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:06:19+00:00Added an answer on May 28, 2026 at 3:06 am

    It seems like you have some pretty novel ways to work around a strange rare bug.

    The way I see it is that while the Java API states that Thread.stop() should not be used, the same can be said that the the OpenOffice Document.dispose() should always return. Even if it is a rare occurrence, it is still a bug, as it does not finish and return a value nor does it throw an exception because of an invalid state. It just runs in an infinite loop, therefore it is a bug.

    As it is a workaround, I see no problems with using Thread.stop() if you need to prevent your application from hanging. The disclaimer about why it should not be used is more intended to prevent poorly developed multi-threaded applications as it can absolutely be abused.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use OpenOffice through the java API, and make him open the .odt file,
Has anyone used the CLI libraries from OpenOffice that allow to use it from
I cannot use Cells(x,y) anymore in OpenOffice (seems to be a bug, from what
When you use the POISSON function in Excel (or in OpenOffice Calc), it takes
use this website a lot but first time posting. My program creates a number
Currently we use OpenOffice to grab bookmarks in a template file document and replace
I use a Windows Web Server 2008 with ruby, PDFCreator, Microsoft Office, and OpenOffice
Is there any way to use OpenOffice's PyUNO without using the version of Python
I'm working on a c# project where I get input from Office documents, and
I am trying to use the roo gem to parse an Openoffice spreadsheet. However

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.