Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1683

Warp: mixes up objects in RequestContext due to wrong use of HttpServletRequest#hashCode()

XMLWordPrintable

    • Workaround Exists
    • Hide

      Use following interceptor that will synchronized Warp execution calls:

      public class WarpRequestSynchronizer {
       
          public synchronized void synchronizedRequests(@Observes(precedence = 100) EventContext<ProcessHttpRequest> context) {
              context.proceed();
          }
       
      }
      

      https://github.com/richfaces/richfaces/commit/0d8a8fb750ee35cbc74743840035d59706677668

      Show
      Use following interceptor that will synchronized Warp execution calls: public class WarpRequestSynchronizer { public synchronized void synchronizedRequests(@Observes(precedence = 100) EventContext<ProcessHttpRequest> context) { context.proceed(); } } https://github.com/richfaces/richfaces/commit/0d8a8fb750ee35cbc74743840035d59706677668

      HttpServletRequest, HttpServletResponse and FilterChain objects are samples of objects stored in RequestContext.

      We are getting this exception:

      20:10:05,423 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /ITResourceOptimization/org.richfaces.resources/javax.faces.resource/org.richfaces.optimized/5.0.0-SNAPSHOT/PackedCompressed/DEFAULT/org.richfaces.css/skinning.css: java.lang.IllegalArgumentException: UT010023: Request io.undertow.servlet.spec.HttpServletRequestImpl@31772f73 was not original or a wrapper
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:117) [undertow-servlet-1.0.0.Beta30.jar:1.0.0.Beta30]
      	at org.jboss.arquillian.warp.impl.server.execution.HttpRequestProcessor.processHttpRequest(HttpRequestProcessor.java:73) [arquillian-warp.jar:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
      	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) [arquillian-core.jar:]
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-core.jar:]
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-core.jar:]
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-core.jar:]
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-core.jar:]
      	at org.jboss.arquillian.warp.impl.server.execution.WarpFilter.doFilterWarp(WarpFilter.java:144) [arquillian-warp.jar:]
      

      The problem here is that Warp stores these objects in WarpFilter and it injects them to WarpExecutionObserver where it calls #doFilterChain.

      Undertow detects that the objects are mixed up.

              aslak@redhat.com Aslak Knutsen
              lfryc Lukáš Fryč (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: