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

IllegalArgumentException with new WeldDefaultProxyServices for JDK11+

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.7.SP1, 4.0.1.SP1
    • 4.0.1.Final, 3.1.7.Final
    • Proxies

      Simple Weld SE application is throwing IllegalArgumentException

      WELD-001524: Unable to load proxy class for bean Producer Method [TestInterface] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @ApplicationScoped public com.mycompany.mavenproject1.beans.Application.createTestInterface()] with class class java.lang.Object
      

      This occurs after upgrade from Weld 3.1.6 to 3.1.7 with new ProxyService implementation introduced with WELD-2581.

            [WELD-2662] IllegalArgumentException with new WeldDefaultProxyServices for JDK11+

            Yes, probably later this week.
            There was another related issue (WELD-2666) that needed solving.

            Matěj Novotný added a comment - Yes, probably later this week. There was another related issue ( WELD-2666 ) that needed solving.

            manovotn: Two weeks later ready for a SP1?

            Benjamin Graf added a comment - manovotn : Two weeks later ready for a SP1?

            I'd like to wait for about a week or perhaps a bit longer to see if we get any other reports regarding this release. After that, we could do an SP1.

            Matěj Novotný added a comment - I'd like to wait for about a week or perhaps a bit longer to see if we get any other reports regarding this release. After that, we could do an SP1.

            Thanks manovotn for being so fast with a solution! Hope to see a release soon, when ready!

            Benjamin Graf added a comment - Thanks manovotn for being so fast with a solution! Hope to see a release soon, when ready!

            Ok, so this only happens if you have a producer with normal scope on it that returns a type from different package than the class declaring the producer. The generated class name was appended with a hash code but without a proper splitting charatecter ($) making it impossible for WeldDefaultProxyServices to determine the correct JDK 11 module in which to create Lookup.

            I have sent a PR for both branches along with a test. I was frankly surprised that this scenario wasn't present in any of our or TCK tests.

            Thanks for the report and reproducer graben1181!

            Matěj Novotný added a comment - Ok, so this only happens if you have a producer with normal scope on it that returns a type from different package than the class declaring the producer. The generated class name was appended with a hash code but without a proper splitting charatecter ( $ ) making it impossible for WeldDefaultProxyServices to determine the correct JDK 11 module in which to create Lookup . I have sent a PR for both branches along with a test. I was frankly surprised that this scenario wasn't present in any of our or TCK tests. Thanks for the report and reproducer graben1181 !

            I think I found it - this is caused by miniature change introduced in WELD-2618 where a generated proxy in your case doesn't always have $ symbol appended making the class defining services fail in determining the correct class (and subsequently module) where to place the proxy.

            Matěj Novotný added a comment - I think I found it - this is caused by miniature change introduced in WELD-2618 where a generated proxy in your case doesn't always have $ symbol appended making the class defining services fail in determining the correct class (and subsequently module) where to place the proxy.

            Hi,

            thanks for the report, I'll take a look into it later today.

            Matěj Novotný added a comment - Hi, thanks for the report, I'll take a look into it later today.

              manovotn Matěj Novotný
              graben1181 Benjamin Graf
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: