About this exception:
2018-04-26 16:13:20,929 ERROR [stderr] (Thread-94) com.jacob.com.ComFailException: Invoke of: Add
2018-04-26 16:13:20,929 ERROR [stderr] (Thread-94) Source: Microsoft Excel
2018-04-26 16:13:20,929 ERROR [stderr] (Thread-94) Description: Unable to get the Add property of the Workbooks class
2018-04-26 16:13:20,929 ERROR [stderr] (Thread-94)
The background
Server: Wildfly 11.0
JDK: 9.04
JACOB: 1.8
When generate excel report using jacob 1.8 and run Wildlfy as window service, it will throw this exception, it works when running form eclipse.
how to fix it
- Create a new user account, add to administrator group
- Run windows service as created user account
-
Run> dcomcnfg
This will open Component Services and navigate to Console Root
\Component Services\Computers\My Computer\DCOM Config\Microsoft Excel Application
Right click Microsoft Excel Application and select Properties
Click on Identity Tab and check selection.
It works for me when select option - This user
image.png
网友评论