On 31.07.2019 20:26, Potgieter, Carlo wrote:
On 31.07.2019 14:49, Mark Thomas wrote:
On 31/07/2019 13:03, Potgieter, Carlo wrote:

On 31/07/2019 12:48, Potgieter, Carlo wrote:
I was hoping to obtain some assistance. We have used a library to convert MS 
Office documents (docx and pptx) to PDF.

This works perfectly in the development environment and also when running 
Tomcat in a console window.

The moment we run Tomcat as a service this specific component gives and error. 
Unfortunately the error is non-specific so we cannot troubleshoot the origin.

My question is, what would be the difference in running Tomcat as a Service as 
oppose to running it in Console that might cause this problem?

Tomcat runs as a different user with different access permissions, particularly 
to network shares.

You probably want to set up a Tomcat specific user with the appropriate 


Thank you Mark for the quick response.

My first thought was permissions also, however I have attempted to run it with 
local, domain and system user, however the same result.

Both local and domain user was part of the local admin group. Is there anything 
else I can check?

Are you sure the DDL is being loaded? That normally needs explicit
configuration to point the JVM at the right path.

Look at the docs for for
org.apache.catalina.startup.VersionLoggerListener and configure it to
dump everything. Then compare the console start with the service start.

What is also different when Tomcat runs as a Service or in a console, is where 
the JVM that runs tomcat, picks up its environment and command-line switches.
If you are not familiar with this matter, this may help :
verbose explanation : 
Official page : 

(Perhaps the application expects some value to be set somewhere..)

Also, above you mention "Unfortunately the error is non-specific..", but maybe 
you want to copy the error message here, so that someone else can have a look at it ?
Maybe it triggers some recognition by another user having had the same issue 
with that library.

Quickly answering both posts from Mark and Andrei:

Mark: Yes, the DLL is being loaded. There is error handling in place should it 
be unsuccessful in accessing any of the components.
I also compared the output of the VersionLoggerListners:
When running as a service and executing the Tomcat8.exe from cmd the 
information is the same, however the functionality only works when the .exe is 
run from cmd.
When using the Startup.bat script to start the server there are three less 
entries and one extra:

Entries not included:
31-Jul-2019 19:34:37.398 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
31-Jul-2019 19:34:37.399 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
31-Jul-2019 19:34:37.399 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 

Entry included but not in the other two:
31-Jul-2019 19:37:11.434 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 

Again using this method to run the server allows the functionality to work.

Andre: From what I could see, everything is loaded the same as all of them uses 
the sae JVM. Unless I missed something...which is entirely possible.
The zeonpadpdf we are using consists of 3 components, 2 .jar's and 1 .dll. 
zeonpadpdf.jar, jacob-1.18.jar, jacob-1.18-x64.dll
The error we are receiving states: "Conversion error" and is generated from the 
zeonpadpdf.jar which handles the conversion from .docx to pdf.
This is also the error in the stack trace which doesn't provide much more 
Based on what I could find in the zeonpadpdf.jar this is generic error message.

Hope that gives some more context.

1) I remember (from some time ago) that in the Services control panel, there was an option when defining a Service, like "Allow this service to interact with the desktop".
If you find it, you may want to set it, and then just redo your test.
That is based on the fact that when you run a Service, normally that task does not have a console, while when you run a program in a console window (of course) it does. That may make the difference if somewhere along the line, one of the components that you use requires something like .. a console. Note that setting this may result in some console popping up unexpectedly on your server machine while a conversion is running. But at least you'll find out if this is the problem.

2) this is a bit more delicate, and I'm doing some guessing.
As I understand from some browsing for "jacob" and "zeonpadpdf", these things work in fact by leveraging at the end some Microsoft Office components pre-installed on the machine on which you run your Tomcat application. And if you want to do do this in Tomcat, then maybe the application in question will be used through a web interface, for several users. I also remember - from some experience a while ago - that somewhere in the Microsoft Office API interface description, it mentions that Microsoft Office components are not meant to be used in such a context, and that in any case, should you want to use this on a server, special Microsoft licensing conditions may apply.
The current conditions may have changed.
But what I'm saying is that if this is anything else than some exploratory project, you may want to be careful as to what you're getting into (even if you do not intend to charge anyone for the result).
Disclaimer : I have no professional or commercial links with Microsoft.

There exist other software packages which convert .docx documents to PDF, some of them open-source, others with a commercial license, but which do not use any MS Office components. One commercial entity of which I know that they do extensive PDF-related things can be found here : https://www.pdf-tools.com/pdf20/en/home/
You may want to consult them, letting them know exactly what you have in mind.
2d disclaimer : I don't work for them either, but I am a (satisfied) customer.

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

Reply via email to