Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2613

ClassFileUtils.java can invoke Unsafe under JDK 11 causing a NoClassDefFoundError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.4.Final
    • 3.1.3.Final
    • Reflection layer
    • None

      I tried to do my homework but didn't see any other issue in the issue tracker with Weld as the project and "sun misc Unsafe" as search keywords. Feel free to close if this is a duplicate.

      ClassUtils.java line 75 features a blind invocation of sun.misc.Unsafe that throws a NoClassDefFoundError under JDK 11. Here's the source link: https://github.com/weld/core/blob/8d4fb65fcba96a41abbf8c019f8162a786cc1435/impl/src/main/java/org/jboss/weld/util/bytecode/ClassFileUtils.java#L75

      It's my understanding that Unsafe is no longer present in JDK 11.

      We stumbled across this when a user mistakenly used the module path in case it matters.

            manovotn Matěj Novotný
            ljnelson+github@gmail.com Laird Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: