honyk wrote:
Dear All,

I have a JSF2.0 app that executes (via ProcessBuilder) an external script.
This script opens PPTX via PowerPoint ActiveX object, manipulate it and
save. It runs on Windows Server 2008 R2 64-bit, 4GB RAM, JDK 7.

When tomcat 7 is launched using startup.bat (with original settings), it
works fine.

When tomcat runs as a service, opening the PPTX in the PowerPoint fails
because of Out Of Memory error regardless Xmx settings (tomcat7w.exe).

I originally asked PowerPoint forum, but haven't get any explanation yet:
http://answers.microsoft.com/thread/37cbebf6-4003-4ab0-9295-92413aaecc2e

But as the entry point is Tomcat and the only difference between problematic
and non problematic behavior is the 'service' mode, maybe there is something
related in the tomcat7.exe code base. Just guessing.

Has anybody an idea why both modes behave differently?


Hi.
The problem has nothing to do with Tomcat per se.
It is due to running a Microsoft Office program (or library modules such as the "Interop" series) as a sub-process of a Windows Service (and thus in the same Service context) which is something that is not in the design of Microsoft Office, not supported by Microsoft, and even actively discouraged by Microsoft.
See : http://support.microsoft.com/kb/257757

The problem is basically that a Windows Service does not run in the same "environment" as a "user session" environment, and as they say in that article, you will certainly experience "unstable behavior and/or deadlock" somewhere, and will get no help for it.

Personal experience : some things will work with one MS-Office program, and totally fail with another; even simple things like opening or saving a file. It may work with one file, and fail with another, for no apparent reason. You get an OOM error in this case, but other cases may be "file not found" (although it's there) or whatever other bizarre failures.
Ultimately it is unpredictable, frustrating and time-consuming.

Solutions :
1) instead of MS-Office, use LibreOffice or OpenOffice. Both can run in "headless" mode, and provide an API to have them "do things with documents". And both can open and manipulate MS-Office documents. Depending on what you do, there may be some differences in the results, but it works fine for many things.
Or try one of the other solutions suggested in the above article.
(I have not tried them, I use OpenOffice/LibreOffice).
2) do not run Tomcat as a Service. Create a virtual Windows machine, and run it in a user console (with startup.bat). You can restrict access to the VM, and since it is a VM, it can run unattended, just as a service would.
(I am also using this scheme, when circumstances permit).
But in that case, also pay attention to the licensing considerations at the end of the article.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to