bytedeco / javacpp

The missing bridge between Java and native C++
Other
4.46k stars 581 forks source link

java.io.IOException: Cannot run program "/app/.javacpp/cache/ffmpeg-5.0-1.5.7-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/ffmpeg": error=2, No such file or directory #583

Closed shourya93 closed 2 years ago

shourya93 commented 2 years ago

Hi, I have updated the docker image to alpine/openjdk17 from centos7/openjdk8. Since then the application has been throwing up different errors which somehow I was able to resolve but I got stuck with one error described here and desperately looking for any help. Ironically everything is working perfectly fine in the local IDE, it just fails in the actual Openshift environment.

So basically, I have changed the Java17 image URL in the docker file, taken a Jenkins build, and deployed it to the Openshift. The pod is getting created successfully but at the time of application start up getting the below error.

`

Caused by: java.io.IOException: Cannot run program "/app/.javacpp/cache/ffmpeg-5.0-1.5.7-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/ffmpeg": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143) at @java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073) at net.bramp.ffmpeg.RunProcessFunction.run(RunProcessFunction.java:39) at net.bramp.ffmpeg.FFcommon.version(FFcommon.java:66) at net.bramp.ffmpeg.FFmpeg.version(FFmpeg.java:31) at net.bramp.ffmpeg.FFmpeg.(FFmpeg.java:90) at net.bramp.ffmpeg.FFmpeg.(FFmpeg.java:85) Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.(ProcessImpl.java:314) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110) ... 82 common frames omitted

`

I have a functionality to deal with audio/video files and from the logs I could see that it is failing while loading and creating ffmpeg class.

Below are the list of ffmpeg related dependency I am passing through the pom.xml file. pom.xml

           <dependency>
        <groupId>net.bramp.ffmpeg</groupId>
        <artifactId>ffmpeg</artifactId>
        <version>0.6.2</version>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>ffmpeg</artifactId>
        <version>5.0-1.5.7</version>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacpp</artifactId>
        <version>1.5.7</version>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>ffmpeg</artifactId>
        <version>5.0-1.5.7</version>
        <classifier>linux-x86</classifier>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>ffmpeg</artifactId>
        <version>5.0-1.5.7</version>
        <classifier>windows-x86_64</classifier>
    </dependency>

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>ffmpeg-platform</artifactId>
        <version>5.0-1.5.7</version>
    </dependency>

@saudet I can see you have answered a somewhat related question. Please help, I will be very thankful to you.

saudet commented 2 years ago

Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console.

saudet commented 2 years ago

Alpine Linux doesn't install glibc by default. You'll need to install it.

saudet commented 2 years ago

Duplicate of #329

saudet commented 2 years ago

Are you saying you're not able to get this working on CentOS 7 with JDK17? If so, that sounds like a duplicate of issue #581.

@jeffgennari Have you found the cause of the problem yet?

saudet commented 1 year ago

Duplicate of https://github.com/bytedeco/javacpp-presets/issues/1379