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

Weld attempts to proxy private methods which can cause issues if the signature contains private types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • None
    • None

      If you attempt to use java.util.Properties as a normal scoped bean on JDK8 you get the following error:

      Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.IllegalAccessError: tried to access class java.util.Properties$LineReader from class org.jboss.weld.util.Properties$Proxy$_$$_WeldClientProxy
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
      	at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
      

      This is because CDI is proxying the private load0 method which references a package private class. As this class is being defined into a different class loader this type is not accessible and the exception results.

      I think we should not be proxying private methods anyway, I'm not sure why we are doing it at the moment.

              mkouba@redhat.com Martin Kouba
              sdouglas1@redhat.com Stuart Douglas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: