Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-1258

Java 11 - Cannot get Unsafe.defineClass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.0.5
    • 2.0.7
    • None
    • None

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tmarin Teimatini Marin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: