Bug 999050 - Scoped CDI interceptor cause Stackoverflow
Scoped CDI interceptor cause Stackoverflow
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld (Show other bugs)
6.1.0
i686 Linux
unspecified Severity medium
: ER3
: EAP 6.2.0
Assigned To: Jozef Hartinger
Ron Šmeral
Russell Dickenson
:
Depends On:
Blocks: 1003581
  Show dependency treegraph
 
Reported: 2013-08-20 11:36 EDT by Aslak Knutsen
Modified: 2016-10-31 21:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:16:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WELD-1483 Major Resolved Scoped CDI interceptor cause Stackoverflow 2015-05-06 10:30:50 EDT

  None (edit)
Description Aslak Knutsen 2013-08-20 11:36:13 EDT
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
Comment 1 JBoss JIRA Server 2013-08-27 07:32:54 EDT
Marko Lukša <marko.luksa@gmail.com> made a comment on jira WELD-1483

Pull request at https://github.com/weld/core/pull/351
Comment 3 JBoss JIRA Server 2013-08-29 02:59:54 EDT
Jozef Hartinger <jharting@redhat.com> made a comment on jira WELD-1483

Merged, please also create a PR for the master branch.
Comment 7 Paul Gier 2013-12-04 09:19:56 EST
Looks like this fix was included in EAP 6.2 via Weld 1.1.15.Final.  Setting to ON_QA.
Comment 8 Ron Šmeral 2013-12-06 10:41:55 EST
Verified on EAP 6.2.0.CR3 (EAP_6.2.0.CR3-dev2).

Note You need to log in before you can comment on or make changes to this bug.