[ https://issues.apache.org/jira/browse/OWB-1258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665958#comment-16665958 ]
Romain Manni-Bucau commented on OWB-1258: ----------------------------------------- This is because you don't run in a classloader where defineClass is available for openwebbeans, you can likely open the java.base module or change the bootstrap classloader to enable it. Unsafe is a fallback when this condition is not met. > Java 11 - Cannot get Unsafe.defineClass > --------------------------------------- > > Key: OWB-1258 > URL: https://issues.apache.org/jira/browse/OWB-1258 > Project: OpenWebBeans > Issue Type: Bug > Affects Versions: 2.0.5 > Reporter: Teimatini Marin > Priority: Major > Fix For: 2.0.7 > > > While trying to start a container in Java 11, as the > sun.misc.Unsafe.defineClass has been terminally deprecated (forRemoval=true), > the following exception is thrown: > Exception in thread "main" java.lang.IllegalStateException: Cannot get > Unsafe.defineClass > at > org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:814) > at > org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:803) > at java.base/java.security.AccessController.doPrivileged(Native Method) > at > org.apache.webbeans.proxy.AbstractProxyFactory.initializeUnsafe(AbstractProxyFactory.java:802) > at > org.apache.webbeans.proxy.AbstractProxyFactory.<init>(AbstractProxyFactory.java:93) > at > org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory.<init>(InterceptorDecoratorProxyFactory.java:80) > at > org.apache.webbeans.config.WebBeansContext.<init>(WebBeansContext.java:157) > at > org.apache.webbeans.config.WebBeansContext.<init>(WebBeansContext.java:119) > at > org.apache.openwebbeans.se.OWBInitializer.initialize(OWBInitializer.java:86) > at > org.apache.openwebbeans.se.SeInitializerFacade.initialize(SeInitializerFacade.java:137) > at com.beuwa.redwine.sensor.Main.main(Main.java:20) > Caused by: java.lang.NoSuchMethodException: > sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, > java.lang.ClassLoader, java.security.ProtectionDomain) > at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476) > at > org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:809) > ... 10 more -- This message was sent by Atlassian JIRA (v7.6.3#76005)