Jacob 1.8 com.jacob.com.ComFailException: Invoke of: Add

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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容