当前位置:网站首页>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 .
边栏推荐
- C language course set up student elective course system (big homework)
- Is fixed investment fund a high-risk product?
- ESP32 ESP-IDF GPIO按键中断响应
- Stored procedure learning notes
- Redis安装到Windows系统上的详细步骤
- Several ways of gson's @jsonadapter annotation
- Database objects: view learning records
- C language course set up library information management system (big homework)
- [ManageEngine Zhuohao] mobile terminal management solution, helping the digital transformation of Zhongzhou aviation industry
- What is a port scanning tool? What is the use of port scanning tools
猜你喜欢
![[ManageEngine] how to realize network automatic operation and maintenance](/img/8a/75332d3180f92c6a6482d881032bbf.png)
[ManageEngine] how to realize network automatic operation and maintenance

ESP32 - ULP 协处理器在低功耗模式下读片内霍尔传感器HALL SENSOR

Esp32 esp-idf ADC monitors battery voltage (with correction)

【Unity Shader 描边效果_案例分享第一篇】

mysql学习
![[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security](/img/fb/0a9f0ea72efc4785cc21fd0d4830c2.png)
[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security

Figure out the difference between event coordinates screenx, clientx, pagex and offsetx

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

NOC 设计的一些坑

Async and await
随机推荐
Comment imprimer le tableau original
[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security
[ManageEngine] terminal management system helps Huasheng securities' digital transformation
Three minutes to quickly understand the whole process of website development
MySQL constraint learning notes
What is a port scanning tool? What is the use of port scanning tools
Interview questions for HW (OD) post
软件工程领域的名词描述
ESP32 ESP-IDF ADC监测电池电压(带校正)
存储过程学习笔记
树莓派4的WiFi设置
C#如何打印输出原版数组
Promise
Rotate the animation component around the circle, take it and use it directly
ESP32 ESP-IDF GPIO按键中断响应
Application of IT service management (ITSM) in Higher Education
下载外文期刊的方法
问题解决:OfficeException: failed to start and connect(一)
RestTemplate使用
【#Unity Shader#自定义材质面板_第一篇】