wiremock / wiremock-docker

Wiremock Docker image
https://hub.docker.com/r/wiremock/wiremock
MIT License
218 stars 101 forks source link

Later / Latest version of Java #54

Closed michaelruocco closed 2 years ago

michaelruocco commented 2 years ago

Hi, thanks for providing this image. It works very nicely for us, recently though we have hit an issue with one of our services that uses this image for testing. The service has been upgraded to enable use of Java 18, however because we also build and compile wiremock transformer classes, when we try to run this image with the transformer classes that have been compiled using java 18 we get the following error when the container tries to start up.

Exception in thread "main" java.lang.UnsupportedClassVersionError: uk/gov/homeoffice/wiremock/refdata/RefDataTransformer has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 55.0 at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(Unknown Source) at java.base/java.security.SecureClassLoader.defineClass(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Unknown Source) at com.github.tomakehurst.wiremock.extension.ExtensionLoader$3.apply(ExtensionLoader.java:71) at com.github.tomakehurst.wiremock.extension.ExtensionLoader$3.apply(ExtensionLoader.java:67) at wiremock.com.google.common.collect.Iterators$6.transform(Iterators.java:829) at wiremock.com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52) at wiremock.com.google.common.collect.TransformedIterator.next(TransformedIterator.java:52) at wiremock.com.google.common.collect.Maps.uniqueIndex(Maps.java:1391) at wiremock.com.google.common.collect.Maps.uniqueIndex(Maps.java:1353) at com.github.tomakehurst.wiremock.extension.ExtensionLoader.asMap(ExtensionLoader.java:40) at com.github.tomakehurst.wiremock.extension.ExtensionLoader.loadExtension(ExtensionLoader.java:32) at com.github.tomakehurst.wiremock.extension.ExtensionLoader.load(ExtensionLoader.java:36) at com.github.tomakehurst.wiremock.standalone.CommandLineOptions.buildExtensions(CommandLineOptions.java:363) at com.github.tomakehurst.wiremock.standalone.CommandLineOptions.<init>(CommandLineOptions.java:354) at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:49) at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.main(WireMockServerRunner.java:133)

We can resolve the issue by rolling our environment back to Java 11, and we could also look at splitting our transformers in to a separate repo but right now it works quite nicely for us having everything in a single repo.

I would hope it might just be a case of updating this line to something like FROM docker.io/library/eclipse-temurin:18 If so I can have a look at forking the repo to try it out but I wanted to check if there were any plans to issue a docker image tag with java 18 support first before doing so.

rodolpheche commented 2 years ago

Hi, This repository only handles the Wiremock Docker image build and deployment based on the Wiremock repository specifications (including java version).