OpenOffice uno.util.Bootstrap.bootstrap () freezes and doesn't return

Windows Server 2003 - IIS 6.0

I have an Asp.Net 4.0 (C #) web application that uses OpenOffice to convert Microsoft Office office documents to PDF files so that they can be displayed on the Internet.

Everything worked fine.

Then I upgraded OpenOffice from 3.2.1 to 3.4.1 on the web server, and now it does not work. The problem occurs when the bootstrap is called.

private static XComponentLoader LoadOO() { XComponentContext OO = uno.util.Bootstrap.bootstrap(); // this will either start OOo or Find one that running. (The code hangs here) XMultiServiceFactory oServMan = (XMultiServiceFactory)OO.getServiceManager(); // Get Service Manager XComponentLoader aLoader = (XComponentLoader)oServMan.createInstance("com.sun.star.frame.Desktop"); // Get a CompontLoader return aLoader; } 

uno.util.Bootstrap.bootstrap (); hangs and returns nothing.

The call starts OpenOffice with the username of the network service, but the call never returns. Each time a method is called, it opens a different instance of OpenOffice instead of binding to an already open instance.

Again I tried to downgrade to 3.2.1, but the same thing happens.

I tried solution 3, indicated here with no success.

I tried restarting IIS and restarting the application pool and various things related to user permissions. I get nothing and need some help.

I was not the person who originally got this job on a web server, so I don’t know if any special steps have been taken. I have no problem making it work on my development machine with any version of OpenOffice.

+4
source share
1 answer

I know that using LocalSystem as an application pool identifier will solve the problem.

I know that this is not ideal, and may not even be acceptable in your situation. Thus, you can also try changing local policies for an ASPNET user or a user local or domain user. Of course, the user will need read / execute permissions to the ooo executable folder, and possibly temp.

In Vista / Server 2008 and above, I cannot get it to work without being a local administrator or local system. I think this is due to changes in the PROCESS_QUERY_INFORMATION permission, since the call to .Bootstrap () is intended to join the newly created OO process. You can try the following if you work older:

run secpol.msc or administrative tools / Local security policy, in local policies / Assigning user rights:

  • find "Deny logging in locally" and "Deny logging in through the terminal" (if present, may vary depending on version)
  • remove ASPNET or {your user} from this list, if any.
  • then find "Allow local login" and add the user to this list.

http://support.microsoft.com/default.aspx?scid=kb;en-us;317012 http://support.microsoft.com/kb/555134

The application pool should also be included in 32-bit, but I believe that if you get to this, you already have this set.

+2
source

Source: https://habr.com/ru/post/1468997/


All Articles