Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-1060

@Intercepted does not work with partial bean proxy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.5.2
    • None
    • Proxy-Module
    • None

    Description

      For a partial bean with an interceptor binding and an interceptor which injects the intercepted bean, e.g.

          @Inject
          @Intercepted
          private Bean<?> intercepted;
      

      Weld 2.2+ throws the following exception when an intercepted method of the partial bean is invoked:

      Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001549: Unable to determine parent creational context of org.jboss.weld.context.CreationalContextImpl@4841524b
      	at org.jboss.weld.bean.builtin.AbstractBuiltInMetadataBean.getParentCreationalContext(AbstractBuiltInMetadataBean.java:65) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.builtin.InterceptedBeanMetadataBean.newInstance(InterceptedBeanMetadataBean.java:62) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.builtin.InterceptedBeanMetadataBean.newInstance(InterceptedBeanMetadataBean.java:47) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.builtin.AbstractBuiltInMetadataBean.create(AbstractBuiltInMetadataBean.java:53) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:761) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:861) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:375) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:386) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:72) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:121) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159) [weld-core-impl-2.2.14.Final.jar:2015-06-24 15:18]
      	at org.apache.deltaspike.proxy.impl.invocation.ManualInvocationContext.proceed(ManualInvocationContext.java:84)
      	at org.apache.deltaspike.proxy.impl.invocation.AbstractManualInvocationHandler.invoke(AbstractManualInvocationHandler.java:48)
      	at org.apache.deltaspike.proxy.impl.invocation.DelegateManualInvocationHandler.staticInvoke(DelegateManualInvocationHandler.java:39)
      	at demo.CustomerDao$$DSPartialBeanProxy.findBy(Unknown Source)
      

      The problem was discovered trying to port an application from WildFly 9.0.1.Final to 10.0.0.CR5. In WildFly 10, the Narayana transactional interceptor implementation does inject the intercepted bean, which was not the case in WildFly 9.

      The problem can be reproduced also on WildFly 9 with a simple demo interceptor. I'll attach a sample project.

      Attachments

        1. deltaspike1060.tgz
          2 kB
          Harald Wellmann

        Issue Links

          Activity

            People

              hwellmann Harald Wellmann
              hwellmann Harald Wellmann
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: