[Bug]: Kafka module cannot find java class written using java 17 #7332
-
Dear TestContainers team, it might be not a bug so if it's necessary please downgrade it. We use Kafka TestContainers module and it helps us very much. Thank you for your work. Could you please tell me did you have any specific issues/challenges making Kafka test containers (TC) workable for java17. It looks like that Kafka TestContainers module cannot find the jar compiled using java 17. Let me explain the reason for this question. ImageFromDockerfile() Now we decided to migrate our SMT which is written in java 8 and tested using TestContainers to java17 because java8 won't be supported by Confluent after version 7.4. We use maven to build the SMT project. We built a new jar file compiled using java 17, we checked the jar on the real environment with Confluent platform run on java 17 and it works correctly. The only difference in two versions of our SMT project is the java version which is used and it's handled by maven plugin, all other dependencies are the same: we use the same version of TestContainers, we import the same library.
we changed the config to be build using java17
The logic is the following: we create Kafka Confluent Connect TC from docker image Any obstacles which you overcame making TestContainers workable for java 17 would be really great to know. Some More details Module Testcontainers version Using the latest Testcontainers version? Host OS Host Arch Docker version |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
This is not clear to me. The jar in your host machine or in the container? How are you moving the jar from host to the container? Also, if you were using Java 8 previously to build the SMT, Confluent should also support it, right? So, there is also an upgrade of Confluent platform. What I mean is if there is a different location in this new version 7.4.x In order to do a analysis, please provide an minimal example that reproduces the issue. It can be shared as a zip or in a github repository. It shouldn't be your exact project. Some basic example with java 8 showing that works and the one upgrading to java 17. |
Beta Was this translation helpful? Give feedback.
-
kafka-stream-testcontainers is using gradle to build, all dependencies are inside build.gradle.kts file |
Beta Was this translation helpful? Give feedback.
when you access to the kafka connect container and perform
java -version
the result isopenjdk version "11.0.15" 2022-04-19 LTS
. For that reason, the project using Java 17 is not being picked. I tried compiling with Java 11 and it worked. CP images are using Java 11 at the moment, see this issue.