Jacob 1.8 com.jacob.com.ComFailE

2018-04-26  本文已影响54人  Dino

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

  1. Create a new user account, add to administrator group
  2. Run windows service as created user account
  3. 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
上一篇 下一篇

猜你喜欢

热点阅读