我在启动officeManager时遇到了下一个问题:
带有 acceptString 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager' 的进程已启动,但找不到其 pid
@Configuration
public class LibreOfficeConfig {
@Value("${libre.office.path}")
private String officeHomeDirectory;
@Bean
public OfficeManager officeManagerConfig() {
return LocalOfficeManager.builder()
.install()
.officeHome(Paths.get(officeHomeDirectory).toFile())
.install()
.build();
}
}
public class LibreOfficeConversionServiceImpl implements DocumentConversionChain {
private void startOfficeManager() {
if (!officeManager.isRunning()) {
try {
officeManager.start();
} catch (OfficeException e) {
throw new RedactionServiceException(e.getMessage(), e);
}
}
}
}