[jira] [Commented] (TIKA-2753) ChildProcess does not use the JAVA_HOME

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (TIKA-2753) ChildProcess does not use the JAVA_HOME

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/TIKA-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16648159#comment-16648159 ]

Hudson commented on TIKA-2753:

SUCCESS: Integrated in Jenkins build tika-branch-1x #114 (See [https://builds.apache.org/job/tika-branch-1x/114/])
TIKA-2753 -- use -javaHome or $JAVA_HOME when starting child process w (tallison: [https://github.com/apache/tika/commit/0f7e86cced275c2db3e2456685acf24fcf44e286])
* (edit) tika-server/src/main/java/org/apache/tika/server/TikaServerWatchDog.java
* (edit) tika-core/src/main/java/org/apache/tika/utils/ProcessUtils.java
* (edit) tika-server/src/main/java/org/apache/tika/server/TikaServerCli.java
* (edit) CHANGES.txt

> ChildProcess does not use the JAVA_HOME
> ---------------------------------------
>                 Key: TIKA-2753
>                 URL: https://issues.apache.org/jira/browse/TIKA-2753
>             Project: Tika
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 1.19.1
>            Reporter: Julien Massiera
>            Assignee: Tim Allison
>            Priority: Critical
>             Fix For: 2.0.0, 1.20
> If the user starting the Tika Server does not have the path to java configured in its PATH var, the following error appears in the logs :
> java.io.IOException: Cannot run program "java": error=2, No such file or directory
>     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
>     at org.apache.tika.server.TikaServerWatchDog$ChildProcess.startProcess(TikaServerWatchDog.java:224)
>     at org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:149)
>     at org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:139)
>     at org.apache.tika.server.TikaServerWatchDog.execute(TikaServerWatchDog.java:87)
>     at org.apache.tika.server.TikaServerCli.execute(TikaServerCli.java:136)
>     at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:117)
> Caused by: java.io.IOException: error=2, No such file or directory
>     at java.lang.UNIXProcess.forkAndExec(Native Method)
>     at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
>     at java.lang.ProcessImpl.start(ProcessImpl.java:134)
>     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
>     ... 6 more
> By checking the TikaServerWatchDog class I noticed that the startProcess method of the ChildProcess private class is using the 'java' argument. As my user only have the JAVA_HOME configured in its /etc/profile and not the path to java, this explains the error.
> It would be better if the startProcess relies on the JAVA_HOME env var to use java instead of assuming that the java program is configured in the PATH env var of the user.

This message was sent by Atlassian JIRA