I'm upgrading my hosted system to use Java 11 instead of Java 8. My web apps are deployed onto Wildfly 10. When I change the config file and restart Wildfly, I get an error like this
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.ClassNotFoundException: jdk.internal.reflect.ConstructorAccessorImpl from [Module "org.infinispan:main" from local module loader @502a16d9 (finder: local module finder @122003cc (roots: /opt/wildfly10/modules,/opt/wildfly10/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
I've seen a few reasons for this, like Java 9 introducing modules and also the packages being renamed from something like javax.reflect.* to jdk.internal.reflect.* but I haven't really found any good workarounds for this. All this works on my Wildfly 15 at home on localhost, but I'm loathe to go through the process of re-deploying all the apps and the Wildfly modules and any other configs that I have. So, my question is this:
- What sort of workaround will fix this?
- or is just easier to get a later version of Wildfly installed and go through all of that work?
Wildfly 10 was released in January 2016, but Java 11 was not released until September, 2018, over two and a half years later. So Wildfly 10 was never tested against Java 11, and does not support the use of Java 11.
Since you are running on old releases of both Wildfly and Java you are inevitably going to have to upgrade both at sometime, and the sooner the better, if only to avoid security vulnerabilities.
As you point out, Wildfly 15 runs fine using Java 11, but the good news is that it also runs fine on Java 8: "WildFly 15 also is heavily tested and runs well on Java 8". So a simple and safe approach would be:
Additional Notes: