I am planning to migrate a webapp from java 8/tomee 7.0.4 to java 11/tomee 7.1.0, but still unsuccessful. So I write a barebone webapp with only one facelet page and one managed bean. This works on java 10/tomee 7.1.0 but not java 11. The errors are:
java.lang.IllegalStateException: Cannot get Unsafe.defineClass
....
java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
After some Googling, from http://tomee-openejb.979440.n4.nabble.com/Some-jars-in-TomEE-8-SNAPSHOT-are-not-Java-11-compatible-td4685162.html it seems that the problem originates from jaxb-impl. So I tried adding to pom.xml according to https://winterbe.com/posts/2018/08/29/migrate-maven-projects-to-java-11-jigsaw/ which failed. I restored pom.xml and modified according to Java 11 package javax.xml.bind does not exist which also failed.
This is for tomee server which is less popular. But tomee 7.1.0 is based on tomcat 8.5 which should be much more popular. I think the problem will still be the same.
Advice is appreciated and I think many people should have the same problem.