Reputation: 97
Windows Server 2003 - IIS 6.0
I have an Asp.Net 4.0 (C#) web application that uses OpenOffice to convert microsoft office documents into PDFs so they could be displayed on the web.
Everything was working fine.
Then I upgraded OpenOffice from 3.2.1 to 3.4.1 on the web server and now it doesn't work. The problem occurs on the bootstrapping call.
private static XComponentLoader LoadOO()
{
XComponentContext OO = uno.util.Bootstrap.bootstrap(); // this will either start OOo or Find one that's 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 doesn't return anything.
The call does start OpenOffice under the Network Service user name, but the call never returns. Every time the method is called it opens another instance of OpenOffice instead of attaching to the already opened instance.
I've tried downgrading to 3.2.1 again, but the same thing happens.
I've tried solution 3 outlined here with no success.
I've tried restarting IIS and recycling the application pool and various things having to do with user permissions. I'm getting no where and need some help.
I was not the person who originally got this working on the web server so don't know if there were any special steps taken. I have no problem getting it to work on my development machine with either version of OpenOffice.
Upvotes: 4
Views: 3446
Reputation: 92
I know that using LocalSystem as your application pool identity will resolve the issue.
I know that is not ideal, and might not even be permissible in your situation. So you can also try modifying the local policies for the ASPNET user or a custom local or domain user. The user will need read/execute permissions to the ooo executable folder of course, and perhaps temp.
On Vista/Server 2008 and above I cannot get it to work without it being a local administrator or local system. I think it has to do with changes to the PROCESS_QUERY_INFORMATION permission, as the ".Bootstrap()" call is looking to attach to the OO process that you just created. You can try the following if you're running older:
run secpol.msc or administrative tools / Local Security Policy, in Local Policies / User Rights Assignment:
http://support.microsoft.com/default.aspx?scid=kb;en-us;317012 http://support.microsoft.com/kb/555134
The app pool must also be 32-bit enabled, but I believe if you are getting this far you already have that set.
Upvotes: 2