当前位置:网站首页>Problem solving: officeexception: failed to start and connect (I)
Problem solving: officeexception: failed to start and connect (I)
2022-07-01 06:39:00 【Going_ man】
problem :OfficeException: failed to start and connect( One )
scene : restart tomcat After service , The preview system cannot be started
Output log : start-up office Component failed , Please check office Is the component available
Report errors :org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
Identification reason I :
1、 The unsuccessful killing of the process and the starting of the software process conflict with each other
boolean killOffice = killProcess();
if (killOffice) {
logger.warn(" A running... Has been detected office process , The process has ended automatically ");
}
try {
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
configuration.setOfficeHome(officeHome);
configuration.setPortNumber(8100);
// Set the task execution timeout to 25 minute
configuration.setTaskExecutionTimeout(1000 * 60 * 25L);
// Set task queue timeout to 24 Hours
configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);
configuration.setMaxTasksPerProcess(1000);
officeManager = configuration.buildOfficeManager();
officeManager.start();
} catch (Exception e) {
logger.error(" start-up office Component failed , Please check office Is the component available ");
throw e;
}
// Kill the process core code
String[] cmd ={
"cmd","/c","taskkill /im soffice.bin /f"};
Process process= Runtime.getRuntime().exec(cmd);
// Output is 1, It can be seen that killing the process failed
logger.warn("killProcess:process"+process.waitFor());
Solution one :
I will kill soffice Code comments for the service process , Let it start directly !
//boolean killOffice = killProcess();
//if (killOffice) {
// logger.warn(" A running... Has been detected office process , The process has ended automatically ");
//}
try {
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
configuration.setOfficeHome(officeHome);
configuration.setPortNumber(8100);
// Set the task execution timeout to 25 minute
configuration.setTaskExecutionTimeout(1000 * 60 * 25L);
// Set task queue timeout to 24 Hours
configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);
configuration.setMaxTasksPerProcess(1000);
officeManager = configuration.buildOfficeManager();
officeManager.start();
} catch (Exception e) {
logger.error(" start-up office Component failed , Please check office Is the component available ");
throw e;
}
Found that it can start successfully ! Try adding a delay after killing again !
Thread.sleep(5000);
As a result, it can be started !
Conclusion 1 :
So the final problem is that after the kill process command is executed , You cannot immediately execute the startup command , It will lead to an error .
边栏推荐
- Some pits designed by NOC
- 清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间
- Storage function learning notes
- Interview questions for HW (OD) post
- Esp32 - ULP coprocessor reading Hall sensor in low power mode
- C语言课设工资管理系统(大作业)
- DML statement in SQL (data operation language)
- SQL statement
- Postgraduate entrance examination directory link
- 三说 拷贝构造之禁用
猜你喜欢

2022 年江苏省职业院校技能大赛(中职) 网络搭建与应用赛项公开赛卷
![[unity shader ablation effect _ case sharing]](/img/e3/464f1cf426e8c03ce3d538ed9cf4bc.png)
[unity shader ablation effect _ case sharing]

C语言课设学生考勤系统(大作业)

Record MySQL troubleshooting caused by disk sector damage

问题:OfficeException: failed to start and connect(二)

软件工程复习

【微信小程序】视图容器和基本内容组件

How to use SCI hub

【Unity Shader 消融效果_案例分享】

Dirty reading, unreal reading and unrepeatable reading
随机推荐
Is fixed investment fund a high-risk product?
Storage function learning notes
(上)苹果有开源,但又怎样呢?
[unity shader custom material panel part II]
C#如何打印輸出原版數組
[wechat applet low code development] second, resolve the code composition of the applet in practice
[wechat applet] how to build a building block development?
Find the original array for the inverse logarithm
What is a port scanning tool? What is the use of port scanning tools
C语言课设图书信息管理系统(大作业)
@Propagation property of transactional requires_ New in-depth understanding
[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform
【微信小程序】一文解决button、input、image组件
ESP32 ESP-IDF ADC监测电池电压(带校正)
mysql约束学习笔记
[unity shader custom material panel part I]
C language course set up property fee management system (big work)
H5网页判断是否安装了某个APP,安装则跳转未安装则下载的方案总结
Esp32 - ULP coprocessor reading Hall sensor in low power mode
Draw a directed graph based on input