glassfish
  1. glassfish
  2. GLASSFISH-20341

Support for AroundConstruct Interceptors defined in ejb-jar.xml

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0.1
    • Component/s: cdi
    • Labels:
      None

      Description

      We are seeing a few EJB devtest failure

      ejb32/interceptors/constructor-level/descriptor/
      ejb32/interceptors/aroundconstruct/descriptor/
      ejb32/interceptors/get_method_lc/descriptor/

      where Interceptor for AroundConstruct on a bean are defined "only in" ejb-jar.xml and implicit CDI scanning has been enabled. The exception reported is:

      [java] Caused by: java.lang.RuntimeException: [SfulEJB] InterceptorA.AroundConstruct was not called
      [java] at com.acme.BaseBean.verify(BaseBean.java:17)
      [java] at com.acme.SfulEJB.hello(SfulEJB.java:19)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [java] at java.lang.reflect.Method.invoke(Method.java:601)
      [java] at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
      [java] at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
      [java] at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4695)
      [java] at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:630)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
      [java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
      [java] at com.acme.InterceptorA.interceptCall(InterceptorA.java:51)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [java] at java.lang.reflect.Method.invoke(Method.java:601)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
      [java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
      [java] at com.acme.InterceptorB.interceptCall(InterceptorB.java:46)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [java] at java.lang.reflect.Method.invoke(Method.java:601)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
      [java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
      [java] at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [java] at java.lang.reflect.Method.invoke(Method.java:601)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
      [java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
      [java] at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
      [java] at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4667)
      [java] at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4655)
      [java] at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)

        Activity

        Hide
        arjavdesai added a comment - - edited

        Waiting on WELD to resolve https://issues.jboss.org/browse/WELD-1412. In the meantime, if AroundConstruct interceptors are specified in the ejb-jar.xml, that module can't use CDI. Hence the above mentioned tests are modified to disable CDI scanning. To reproduce the issue, please remove beans.xml from it.

        Show
        arjavdesai added a comment - - edited Waiting on WELD to resolve https://issues.jboss.org/browse/WELD-1412 . In the meantime, if AroundConstruct interceptors are specified in the ejb-jar.xml, that module can't use CDI. Hence the above mentioned tests are modified to disable CDI scanning. To reproduce the issue, please remove beans.xml from it.
        Hide
        tlcksnyder added a comment -

        JBoss not planning to fix in Weld 2.0, therefore it is not making initial drop for EE7 / 4.0.

        Show
        tlcksnyder added a comment - JBoss not planning to fix in Weld 2.0, therefore it is not making initial drop for EE7 / 4.0.
        Hide
        arjavdesai added a comment -

        Following EJB CTS failure are caused by this issue as well:

        com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbembed: Client_aroundConstructInterceptorTest_from_ejbembed
        Failed with exception
        java.lang.RuntimeException: nullExpecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]null , but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
        at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36)
        at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42)
        at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146)
        at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221)
        at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114)
        at com.sun.ts.tests.common.vehicle.ejbembed.EJBEmbedRunner.run(EJBEmbedRunner.java:41)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:102)
        at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:446)
        at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:210)
        at com.sun.ts.lib.harness.EETest.run(EETest.java:257)
        at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:27)

        com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsf: Client_aroundConstructInterceptorTest_from_ejblitejsf
        com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsp: Client_aroundConstructInterceptorTest_from_ejblitejsp
        com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet: Client_aroundConstructInterceptorTest_from_ejbliteservlet
        com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet2: Client_aroundConstructInterceptorTest_from_ejbliteservlet2

        java.lang.RuntimeException:
        Expecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
        , but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
        at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36)
        at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42)
        at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146)
        at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221)
        at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
        at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
        at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
        at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:63)
        at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:68)
        at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
        at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
        at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
        at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
        at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
        at javax.faces.component.UIOutput.getValue(UIOutput.java:174)

        Show
        arjavdesai added a comment - Following EJB CTS failure are caused by this issue as well: com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbembed: Client_aroundConstructInterceptorTest_from_ejbembed Failed with exception java.lang.RuntimeException: nullExpecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean] null , but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean] at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36) at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42) at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146) at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221) at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114) at com.sun.ts.tests.common.vehicle.ejbembed.EJBEmbedRunner.run(EJBEmbedRunner.java:41) at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:102) at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:446) at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:210) at com.sun.ts.lib.harness.EETest.run(EETest.java:257) at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:27) com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsf: Client_aroundConstructInterceptorTest_from_ejblitejsf com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsp: Client_aroundConstructInterceptorTest_from_ejblitejsp com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet: Client_aroundConstructInterceptorTest_from_ejbliteservlet com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet2: Client_aroundConstructInterceptorTest_from_ejbliteservlet2 java.lang.RuntimeException: Expecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean] , but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean] at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36) at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42) at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146) at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221) at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at javax.el.BeanELResolver.getValue(BeanELResolver.java:363) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) at com.sun.el.parser.AstValue.getValue(AstValue.java:140) at com.sun.el.parser.AstValue.getValue(AstValue.java:204) at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:63) at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:68) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226) at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
        Hide
        phil.zampino added a comment -

        The associated Weld issue (https://issues.jboss.org/browse/WELD-1412) is targeted for 2.0.1, but is as of yet unresolved.

        Show
        phil.zampino added a comment - The associated Weld issue ( https://issues.jboss.org/browse/WELD-1412 ) is targeted for 2.0.1, but is as of yet unresolved.

          People

          • Assignee:
            phil.zampino
            Reporter:
            arjavdesai
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: