{"action":"created","issue":{"url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/75","repository_url":"https://api.github.com/repos/sbraconnier/jodconverter","labels_url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/75/comments","events_url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/75/events","html_url":"https://github.com/sbraconnier/jodconverter/issues/75","id":319255263,"number":75,"title":"soffice can't start (Ubuntu 16.04, LibreOffice 5.1.6.2, Java 8)","user":{"login":"janssen","id":512087,"avatar_url":"https://avatars0.githubusercontent.com/u/512087?v=4","gravatar_id":"","url":"https://api.github.com/users/janssen","html_url":"https://github.com/janssen","followers_url":"https://api.github.com/users/janssen/followers","following_url":"https://api.github.com/users/janssen/following{/other_user}","gists_url":"https://api.github.com/users/janssen/gists{/gist_id}","starred_url":"https://api.github.com/users/janssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janssen/subscriptions","organizations_url":"https://api.github.com/users/janssen/orgs","repos_url":"https://api.github.com/users/janssen/repos","events_url":"https://api.github.com/users/janssen/events{/privacy}","received_events_url":"https://api.github.com/users/janssen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-05-01T16:51:21Z","updated_at":"2018-05-09T16:27:11Z","closed_at":null,"author_association":"NONE","body":"I'm trying to use LocalConverter to convert a file, but I can't seem to start LibreOffice.  This is using the latest Github master branch.  I've updated OfficeProcess to (1) use double-hyphens for the command-line flags where soffice says it should, and (2) spit out the command-line so that I can see what it is.\r\n\r\n```\r\n$ java -classpath jodconverter-local-4.2.1-SNAPSHOT.jar:jodconverter-core-4.2.1-SNAPSHOT.jar:slf4j-jdk14-1.7.25.jar:slf4j-api-1.7.25.jar:commons-lang3-3.7.jar:commons-io-2.6.jar:/usr/lib/libreoffice/program/classes/commonwizards.jar:/usr/lib/libreoffice/program/classes/form.jar:/usr/lib/libreoffice/program/classes/hsqldb.jar:/usr/lib/libreoffice/program/classes/java_uno.jar:/usr/lib/libreoffice/program/classes/juh.jar:/usr/lib/libreoffice/program/classes/jurt.jar:/usr/lib/libreoffice/program/classes/query.jar:/usr/lib/libreoffice/program/classes/report.jar:/usr/lib/libreoffice/program/classes/ridl.jar:/usr/lib/libreoffice/program/classes/ScriptFramework.jar:/usr/lib/libreoffice/program/classes/ScriptProviderForJava.jar:/usr/lib/libreoffice/program/classes/sdbc_hsqldb.jar:/usr/lib/libreoffice/program/classes/smoketest.jar:/usr/lib/libreoffice/program/classes/table.jar:/usr/lib/libreoffice/program/classes/unoil.jar:/usr/lib/libreoffice/program/classes/unoloader.jar:/usr/lib/libreoffice/program/classes/XMergeBridge.jar:/usr/lib/libreoffice/program/classes/xmerge.jar:. convert /home/wjanssen/Downloads/syllabus.docx /tmp/bar.pdf\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcessManager submitAndWait\r\nINFO: Submitting task 'Start' and waiting...\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcess prepareProcessBuilder\r\nINFO: Command: /usr/lib/libreoffice/program/soffice.bin --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager -env:UserInstallation=file:///tmp/.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1 --invisible --norestore --nofirststartwizard --nologo --nodefault --nolockcheck --headless --nocrashreport\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcess start\r\nINFO: Starting process with acceptString 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager' and profileDir '/tmp/.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1'\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcess start\r\nINFO: Started process; pid = 17235\r\nMay 01, 2018 9:45:18 AM convert main\r\nSEVERE: Can't start LibreOffice: org.jodconverter.office.OfficeException: Office process died with exit code 77\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.AbstractOfficeManagerPool doStop\r\nINFO: Stopping the office manager pool...\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcessManager submitAndWait\r\nINFO: Submitting task 'Stop' and waiting...\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcess forciblyTerminate\r\nINFO: Trying to forcibly terminate process: 'host=127.0.0.1,port=2002,tcpNoDelay=1'; pid: 17235\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcessManager doTerminateProcess\r\nINFO: process forcibly terminated with code 77\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.OfficeProcessManager doEnsureProcessExited\r\nINFO: process exited with code 77\r\nMay 01, 2018 9:45:18 AM org.jodconverter.office.AbstractOfficeManagerPool doStop\r\nINFO: Office manager stopped\r\n```"},"comment":{"url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/comments/387796895","html_url":"https://github.com/sbraconnier/jodconverter/issues/75#issuecomment-387796895","issue_url":"https://api.github.com/repos/sbraconnier/jodconverter/issues/75","id":387796895,"user":{"login":"janssen","id":512087,"avatar_url":"https://avatars0.githubusercontent.com/u/512087?v=4","gravatar_id":"","url":"https://api.github.com/users/janssen","html_url":"https://github.com/janssen","followers_url":"https://api.github.com/users/janssen/followers","following_url":"https://api.github.com/users/janssen/following{/other_user}","gists_url":"https://api.github.com/users/janssen/gists{/gist_id}","starred_url":"https://api.github.com/users/janssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janssen/subscriptions","organizations_url":"https://api.github.com/users/janssen/orgs","repos_url":"https://api.github.com/users/janssen/repos","events_url":"https://api.github.com/users/janssen/events{/privacy}","received_events_url":"https://api.github.com/users/janssen/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T16:27:11Z","updated_at":"2018-05-09T16:27:11Z","author_association":"NONE","body":"Broken again.  Same code!  Error appears to be a negative PID reported.\r\n\r\n```\r\n$ java -Djava.util.logging.config.file=.logging.config -classpath jodconverter-local-4.2.1-SNAPSHOT.jar:jodconverter-core-4.2.1-SNAPSHOT.jar:slf4j-jdk14-1.7.25.jar:slf4j-api-1.7.25.jar:commons-lang3-3.7.jar:commons-io-2.6.jar:gson-2.8.2.jar:pdfbox-app-2.0.9.jar:/usr/lib/libreoffice/program/classes/commonwizards.jar:/usr/lib/libreoffice/program/classes/form.jar:/usr/lib/libreoffice/program/classes/hsqldb.jar:/usr/lib/libreoffice/program/classes/java_uno.jar:/usr/lib/libreoffice/program/classes/juh.jar:/usr/lib/libreoffice/program/classes/jurt.jar:/usr/lib/libreoffice/program/classes/query.jar:/usr/lib/libreoffice/program/classes/report.jar:/usr/lib/libreoffice/program/classes/ridl.jar:/usr/lib/libreoffice/program/classes/ScriptFramework.jar:/usr/lib/libreoffice/program/classes/ScriptProviderForJava.jar:/usr/lib/libreoffice/program/classes/sdbc_hsqldb.jar:/usr/lib/libreoffice/program/classes/smoketest.jar:/usr/lib/libreoffice/program/classes/table.jar:/usr/lib/libreoffice/program/classes/unoil.jar:/usr/lib/libreoffice/program/classes/unoloader.jar:/usr/lib/libreoffice/program/classes/XMergeBridge.jar:/usr/lib/libreoffice/program/classes/xmerge.jar:. convert /home/wjanssen/Downloads/syllabus.docx /tmp/b2.pdf\r\nStarting...\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcessManager submitAndWait\r\nINFO: Submitting task 'Start' and waiting...\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcess prepareProcessBuilder\r\nINFO: Command: /usr/lib/libreoffice/program/soffice.bin --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager -env:UserInstallation=file:///tmp/.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1 --invisible --norestore --nofirststartwizard --nologo --nodefault --nolockcheck --headless --nocrashreport\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcess start\r\nINFO: Starting process with acceptString 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager' and profileDir '/tmp/.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1'\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcess start\r\nINFO: Started process; pid = -2\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.AbstractOfficeManagerPool doStop\r\nINFO: Stopping the office manager pool...\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcessManager submitAndWait\r\nINFO: Submitting task 'Stop' and waiting...\r\nMay 09, 2018 9:21:10 AM org.jodconverter.office.OfficeProcess forciblyTerminate\r\nINFO: Trying to forcibly terminate process: 'host=127.0.0.1,port=2002,tcpNoDelay=1'; pid: -2\r\nMay 09, 2018 9:21:11 AM org.jodconverter.office.OfficeProcessManager doTerminateProcess\r\nINFO: process forcibly terminated with code 81\r\nMay 09, 2018 9:21:11 AM org.jodconverter.office.OfficeProcessManager doEnsureProcessExited\r\nINFO: process exited with code 81\r\nMay 09, 2018 9:21:11 AM org.jodconverter.office.AbstractOfficeManagerPool doStop\r\nINFO: Office manager stopped\r\nException in thread \"main\" org.jodconverter.office.OfficeException: A process with acceptString 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ServiceManager' started but its pid could not be found\r\n\tat org.jodconverter.office.OfficeProcess.start(OfficeProcess.java:360)\r\n\tat org.jodconverter.office.OfficeProcessManager.doStartProcessAndConnect(OfficeProcessManager.java:100)\r\n\tat org.jodconverter.office.OfficeProcessManager.access$100(OfficeProcessManager.java:40)\r\n\tat org.jodconverter.office.OfficeProcessManager$4.call(OfficeProcessManager.java:260)\r\n\tat org.jodconverter.office.OfficeProcessManager$4.call(OfficeProcessManager.java:255)\r\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n$\r\n```\r\nCode is\r\n```java\r\n/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\r\n\r\nimport java.io.File;\r\nimport java.io.IOException;\r\nimport java.util.Map;\r\nimport java.util.HashMap;\r\nimport java.util.logging.Logger;\r\nimport java.util.logging.Level;\r\n\r\nimport org.jodconverter.document.DefaultDocumentFormatRegistry;\r\nimport org.jodconverter.document.DocumentFormatRegistry;\r\nimport org.jodconverter.document.DocumentFormat;\r\nimport org.jodconverter.office.LocalOfficeManager;\r\nimport org.jodconverter.office.OfficeException;\r\nimport org.jodconverter.office.OfficeManager;\r\nimport org.jodconverter.office.OfficeConnectionProtocol;\r\nimport org.jodconverter.office.OfficeUtils;\r\nimport org.jodconverter.LocalConverter;\r\nimport org.jodconverter.task.LocalConversionTask;\r\n\r\n/**\r\n */\r\npublic final class convert\r\n{\r\n    private convert()\r\n    {\r\n        //static class\r\n    }\r\n\r\n    static private DocumentFormatRegistry formatRegistry = null;\r\n\r\n    static private Logger logger = Logger.getGlobal();\r\n\r\n    public static void main( String[] args ) throws IOException, OfficeException\r\n    {\r\n        if (args.length != 2) {\r\n            System.err.println(\"Usage: convert INPUT-FILE OUTPUT-FILE\");\r\n            System.exit(1);\r\n        }\r\n\r\n        // suppress the Dock icon on OS X\r\n        System.setProperty(\"apple.awt.UIElement\", \"true\");\r\n\r\n        // tell log4j to stop its yapping\r\n        System.setProperty(\"log4j.defaultInitOverride\", \"true\");\r\n\r\n        final LocalOfficeManager officeManager = LocalOfficeManager.make(); \r\n\r\n        try {\r\n            // Start an office process and connect to the started instance (on port 2002).\r\n            System.err.println(\"Starting...\");\r\n            officeManager.start();\r\n            System.err.println(\"Sleeping...\");\r\n            try {\r\n                Thread.sleep(5 * 1000);\r\n            } catch (InterruptedException x) {\r\n            }\r\n            System.err.println(\"Awake again\");\r\n            \r\n            File inputFile = new File(args[0]);\r\n            File outputFile = new File(args[1]);\r\n\r\n            Map<String, Object> filterData = new HashMap<>();\r\n            filterData.put(\"UseTaggedPDF\", true);\r\n            Map<String, Object> storeProperties= new HashMap<>();\r\n            storeProperties.put(\"FilterData\", filterData);\r\n            storeProperties.put(\"Overwrite\", true);\r\n\r\n            LocalConverter\r\n                .builder()\r\n                .officeManager(officeManager)\r\n                .storeProperties(storeProperties)\r\n                .build()\r\n                .convert(inputFile)\r\n                .to(outputFile)\r\n                .execute();\r\n        } finally {\r\n            // Stop the office process\r\n            OfficeUtils.stopQuietly(officeManager);\r\n        }\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"janssen"}}