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

Wrong proxy in use when interface used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 2.4.1.Final
    • 2.4.0.Final
    • None
    • None

      For reference, you can run this test to reproduce this issue: https://github.com/hammock-project/hammock/blob/hammock-0.5.0/rest-cxf/src/test/java/ws/ament/hammock/rest/cxf/CXFTest.java

      The problem happens within CXF. They attempt to locate a bean using this:

              final Bean<?> busBean = beanManager.resolve(beanManager.getBeans(CdiBusBean.CXF));
              
              bus = (Bus)beanManager.getReference(
                      busBean, 
                      Bus.class,
                      beanManager.createCreationalContext(busBean));
      

      The problem is that when you invoke the method getProperty(String,Object) on the returned proxy, it throws an AbstractMethodError, almost like the proxy isn't getting the right underlying implementation.

      The following is purely speculative, and is just me doing a brain dump of thoughts

      The proxy class in this case inherits from org.apache.cxf.Bus instead of the underlying implementation. Changing the class in use fixes it, however that seems like a work around. Weld should be generating a proxy based on bean class, or the returned object type. Or at the very least, the generated proxy from weld shouldn't throw an AbstractMethodError when invoking getProperty

              Unassigned Unassigned
              meetoblivion_jira John Ament (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: