I have created a simple Spring Boot application in java which has a controller that triggers a Performance testing run. It works very well when I run it locally. Now I have dockerized the application and trying to run the same controller. I get this error:
2023-10-13 23:44:36 java.nio.file.NoSuchFileException: /bin
2023-10-13 23:44:36 at jdk.zipfs/jdk.nio.zipfs.ZipPath.readAttributes(ZipPath.java:769)
2023-10-13 23:44:36 at jdk.zipfs/jdk.nio.zipfs.ZipPath.readAttributes(ZipPath.java:777)
2023-10-13 23:44:36 at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:276)
2023-10-13 23:44:36 at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
2023-10-13 23:44:36 at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:220)
2023-10-13 23:44:36 at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:277)
2023-10-13 23:44:36 at java.base/java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:323)
2023-10-13 23:44:36 at java.base/java.nio.file.FileTreeIterator.<init>(FileTreeIterator.java:71)
2023-10-13 23:44:36 at java.base/java.nio.file.Files.walk(Files.java:3918)
2023-10-13 23:44:36 at java.base/java.nio.file.Files.walk(Files.java:3973)
2023-10-13 23:44:36 at us.abstracta.jmeter.javadsl.core.engines.JmeterEnvironment.installConfig(JmeterEnvironment.java:98)
2023-10-13 23:44:36 at us.abstracta.jmeter.javadsl.core.engines.JmeterEnvironment.<init>(JmeterEnvironment.java:41)
2023-10-13 23:44:36 at us.abstracta.jmeter.javadsl.core.engines.EmbeddedJmeterEngine.run(EmbeddedJmeterEngine.java:93)
2023-10-13 23:44:36 at us.abstracta.jmeter.javadsl.core.DslTestPlan.run(DslTestPlan.java:125)
2023-10-13 23:44:36 at com.mtaf.managed_testing_services_core.services.JMeterTestService.runPerformanceTest(JMeterTestService.java:145)
2023-10-13 23:44:36 at com.mtaf.managed_testing_services_core.services.JMeterTestService.startPerformanceTest(JMeterTestService.java:110)
2023-10-13 23:44:36 at com.mtaf.managed_testing_services_core.background_jobs.JobService.runJMeterTest(JobService.java:29)
2023-10-13 23:44:36 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-10-13 23:44:36 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2023-10-13 23:44:36 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-10-13 23:44:36 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
Here is my Dockerfile for reference:
FROM openjdk:17
COPY target/test-performance-api.jar /app/test-performance-api.jar
WORKDIR /app
ENTRYPOINT ["java", "-jar", "test-performance-api.jar", "--spring.profiles.active=test"]
EXPOSE 8080
I am guessing the JMeter jar is not getting added properly. Appreciate your help in this regard.
I tried building it as a FatJar to ensure that the Apache JMeter is accessible But still the same error.
The two solutions that I think could be:
I think we already found a solution here
Basically you need to tune your spring-boot-maven-plugin configuration to add requireUnpack for jmeter dependencies.