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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mkouba Martin Kouba
                  Reporter:
                  swd847 Stuart Douglas
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: