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

Scoped CDI interceptor cause Stackoverflow

XMLWordPrintable

    • Hide

      1. Create CDI Bean
      2. Create a Interceptor Binding Annotation
      3. Add Interceptor Binding to CDI Bean
      4. Create a Interceptor
      5. Run code, all OK
      6. Add any non Dependent scope to the Interceptor @Request|Session|ApplicationScope
      7. Run code, Stackoverflow

      Show
      1. Create CDI Bean 2. Create a Interceptor Binding Annotation 3. Add Interceptor Binding to CDI Bean 4. Create a Interceptor 5. Run code, all OK 6. Add any non Dependent scope to the Interceptor @Request|Session|ApplicationScope 7. Run code, Stackoverflow

      Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=999050

      Description of problem:

      Version-Release number of selected component (if applicable):
      6.1.0.GA

      How reproducible:
      10%

      Steps to Reproduce:
      1. Create CDI Bean
      2. Create a Interceptor Binding Annotation
      3. Add Interceptor Binding to CDI Bean
      4. Create a Interceptor
      5. Run code, all OK
      6. Add any non Dependent scope to the Interceptor @Request|Session|ApplicationScope
      7. Run code, Stackoverflow

      Actual results:

      org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:69)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:112)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:88)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:55)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.cedj.geekseek.web.rest.core.test.integration.TestResource$Proxy$$$_WeldSubclass.get(TestResource$Proxy$$$_WeldSubclass.java)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at java.lang.reflect.Method.invoke(Method.java:606)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:85)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:127)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.cedj.geekseek.web.rest.core.interceptor.RESTInterceptorEnabler.intercept(RESTInterceptorEnabler.java:44)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.cedj.geekseek.web.rest.core.interceptor.RESTInterceptorEnabler$Proxy$$$_WeldClientProxy.intercept(RESTInterceptorEnabler$Proxy$$$_WeldClientProxy.java)
      16:22:29,943 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
      16:22:29,944 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      16:22:29,944 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at java.lang.reflect.Method.invoke(Method.java:606)
      16:22:29,944 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30)
      16:22:29,944 ERROR [stderr] (http-localhost.localdomain/127.0.0.1:8080-2) at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:69)

      Expected results:

      Pr CDI spec:
      "An interceptor instance is a dependent object of the object it intercepts"

      So, Scoped Interceptors is defined as non-portable behavior.

      Deployment Validation Exception would help, since Weld can't handle it.

      Additional info:

      Arquillian based test case to demonstrate the problem:
      https://github.com/aslakknutsen/cdi-eap-interceptor-stackoverflow

              marko.luksa@gmail.com Marko Luksa (Inactive)
              maschmid@redhat.com Marek Schmidt
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: