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

Delegate proxies cannot call public methods on delegate if class is not public

XMLWordPrintable

    • Workaround Exists
    • Hide

      For now, just make sure the delegate class has public visibility.

      Show
      For now, just make sure the delegate class has public visibility.

      If a non-public class is used as the type of a delegate in a decorator, then the decorator cannot actually call any of the delegate methods. The following exception occurs unless the class is made public:

      java.lang.reflect.InvocationTargetException
      at org.jboss.webbeans.introspector.jlr.WBMethodImpl.invokeOnInstance(WBMethodImpl.java:198)
      at org.jboss.webbeans.bean.proxy.DecoratorProxyMethodHandler.invoke(DecoratorProxyMethodHandler.java:83)
      at org.jboss.jsr299.tck.tests.lookup.injectionpoint.Cat_$$javassist_0.hello(Cat$$_javassist_0.java)
      at org.jboss.jsr299.tck.tests.lookup.injectionpoint.InjectionPointTest.testIsDelegate(InjectionPointTest.java:212)
      at org.jboss.testharness.AbstractTest.run(AbstractTest.java:240)
      Caused by: java.lang.IllegalAccessException: Class org.jboss.webbeans.bean.proxy.DecoratorProxyMethodHandler can not access a member of class org.jboss.jsr299.tck.tests.lookup.injectionpoint.Cat with modifiers "public"
      at org.jboss.webbeans.bean.proxy.DecoratorProxyMethodHandler.invoke(DecoratorProxyMethodHandler.java:86)
      at org.jboss.jsr299.tck.tests.lookup.injectionpoint.Cat_$$javassist_0.hello(Cat$$_javassist_0.java)
      at org.jboss.jsr299.tck.tests.lookup.injectionpoint.CatDecorator.hello(CatDecorator.java:13)
      ... 37 more
      ... Removed 34 stack frames

            pmuiratbleepbleep Pete Muir (Inactive)
            drallendc@gmail.com David Allen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: