Springboot remote connection LibreOffice

I use windows11 ,start LibreOffice use cmd order,
soffice --headless --accept=“socket,host=0.0.0.0,port=8100;urp;” --nofirststartwizard
actually start successful,and I can listener port and service.
I use java code try to connect libreoffice
@Test
public void testConnectionToLibreOffice() throws OfficeException {
// 请替换下面的IP地址和端口为实际可用的服务地址和端口
String officeUrl = “http://192.168.2.7:8100”; // 示例IP,请替换为实际IP和端口

    // 创建远程Office管理器
    OfficeManager officeManager = RemoteOfficeManager.builder()
            .urlConnection(officeUrl)
            .build();

    try {
        System.err.println("开始连接 " + officeUrl);
        officeManager.start();

        // 进行一个简单的文档转换测试
        File file = new File("D:\\ideaProjects\\LibreOfficeRemoteDemo\\test.doc"); // 替换为实际文件路径
        File outputFile = new File("D:\\ideaProjects\\LibreOfficeRemoteDemo\\output.pdf"); // 输出文件路径
        RemoteConverter converter = RemoteConverter.make(officeManager);
        converter.convert(file).to(outputFile).execute();
        
        System.err.println("连接成功");

        // 这里可以添加你的文档转换逻辑

    } catch (OfficeException e) {
        System.err.println("连接失败: " + e.getMessage());
        e.printStackTrace();
    } finally {
        // 确保最后关闭office管理器
        if (officeManager.isRunning()) {
            officeManager.stop();
            System.err.println("关闭office管理器");
        }
    }
} 

always Read timed out ,I sure the post request start, but libreoffice service do not response me,how can i get response??? local is successful,i want remote

Have you opened your firewall to provide a service for other machines? Is your router transporting requests? Can you ping your “server”?

You tagged base. Is this really an issue with database connection (through ODBC)? Your code shows reference to a .doc file, i.e. a text document one in a non-native format. Note it is always a bad idea to create non-native format documents).

Are you trying to launch Writer on a specific document? Is your question more general: you want to be able to handle any managed file (.odt with Writer, .ods with Calc, .odg with Draw, .odp with Impress, …)? In this case, reference to a .doc file is only a particular example. You should then retag as common from the general case or writer for the specific case.

Please explain and mention exact LO version.

I turned off the firewall, my local java service called my local libreoffice to do a test, and I was able to ping through my 192.168.2.7,is my local ip

Certainly, I will include that additional information in the response:

Thank you for your detailed explanation and suggestions. Indeed, I am not dealing with a database connection issue but rather with how to control LibreOffice remotely for document conversion. The .doc file I mentioned is just an example; in reality, I want to handle various document formats supported by LibreOffice. Additionally, my goal is to utilize LibreOffice on other servers to assist in file previewing, which allows for more flexible file management and presentation across different systems or platforms. Therefore, this leans more towards a general issue, rather than being specific to one application (such as Writer). Thank you again for your guidance, and I will consider re-tagging the issue to a more appropriate category.

libreofiice version is 7.6.7
<jodconverter.version>4.3.0</jodconverter.version>

this is my yml
server:
port: 8082

#jodconverter:
#  local:
#    enabled: true
#    office-home: D:\Program app\LibreOffice  # OpenOffice安装路径
#    max-tasks-per-process: 10  # 每个进程的最大任务数
#    port-numbers: 8100         # 端口号

jodconverter:

  remote:
    enabled: true
    url: http://192.168.2.7:8100
    connect-timeout: 5000  # 提高连接超时时间到5000毫秒(5秒)
    socket-timeout: 150000  # 提高套接字超时时间到15000毫秒(15秒)
    pool-size: 10
    task-execution-timeout: 120000 #设置单个任务的最大执行时间

this is my test interface

@RestController
@RequestMapping("jodconverter")
public class JodConverterController {
    

    @Autowired(required = false)
    private DocumentConverter documentConverter;

    @SneakyThrows
    @GetMapping("test")
    public void test(HttpServletResponse response) {
        if (documentConverter == null) {
            throw new Exception("转换失败,请检查LibreOffice及系统相关配置");
        }
        // TODO: 读取文件流

        // 示例:从文件系统读取文件
        File file = new File("D:\\ideaProjects\\LibreOfficeRemoteDemo\\test.doc"); // 替换为实际文件路径
        if (!file.exists()) {
            throw new FileNotFoundException("文件不存在");
        }

        InputStream inputStream = new FileInputStream(file);

        // 调用LibreOffice,转PDF
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        try {
            documentConverter
                    .convert(inputStream)
                    .as(DefaultDocumentFormatRegistry.PDF)
                    .to(byteArrayOutputStream)
                    .as(DefaultDocumentFormatRegistry.PDF)
                    .execute();
        }
        catch (Exception ex) {
            byteArrayOutputStream.close();
            throw ex;
        }

        // 返回PDF
        ServletOutputStream outputStream = response.getOutputStream();
        byte[] pdfBytes = byteArrayOutputStream.toByteArray();
        outputStream.write(pdfBytes);

        IoUtil.writeUtf8(outputStream, true);
    }
}

(reformatted by ajlittoz)

I know what happen,I should set a libreOffice Online in linux service,then use jobconverter remote to use service