Skip to content

Conversation

@jwcarman
Copy link
Contributor

There was a very strange line in the ContainerRequestContextImpl which nulled out the HttpHeaders that were already there as a field. So, a simple solution was to not null it out and return what HttpHeaders was returning, since it already does the right thing. Let me know if this will work. All tests in the frontend-jaxrs module passed for me. My Jenkins is still running the full build, but I thought I'd get this in front of you guys to let me know if I'm on the right track. Thanks.

@sberyozkin
Copy link
Contributor

sberyozkin commented Sep 14, 2018

Hi, I have done that line, most likely, to get the TCK passing, @andymc12, FYI, thanks

@andymc12
Copy link
Contributor

The code looks right to me. I'll see if I can run these changes through the TCK to ensure it still passes on Monday.

Thanks @jwcarman for the PR, and @sberyozkin for the feedback!

@jwcarman
Copy link
Contributor Author

jwcarman commented Oct 3, 2018

Did this change cause the TCK to fail?

@andymc12
Copy link
Contributor

andymc12 commented Oct 3, 2018

@jwcarman I ran them both together (this one + #446). I'll run it again with just this one and let you know the result. Thanks for the ping.

@andymc12
Copy link
Contributor

andymc12 commented Oct 4, 2018

@jwcarman, yes, it does fail the TCK. The failing test is called getHeadersIsMutableTest - and so the problem is that when a ContainerRequestFilter attempts to modify the headers (MultivaluedMap), it gets an exception similar to this (this exception is from an OpenLiberty test case I wrote, not the TCK - but I believe it is the same issue):

java.lang.UnsupportedOperationException
 at java.util.Collections$UnmodifiableMap.put(Collections.java:1457)
 at org.apache.cxf.jaxrs.impl.MetadataMap.put(MetadataMap.java:185)
 at org.apache.cxf.jaxrs.impl.MetadataMap.putSingle(MetadataMap.java:130)
 at jaxrs21.fat.mutableHeaders.ContainerRequestFilter1.filter(ContainerRequestFilter1.java:37)
 at org.apache.cxf.jaxrs.utils.JAXRSUtils.runContainerRequestFilters(JAXRSUtils.java:1709)
 at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:267)
 at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:89)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:124)
 at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:274)
 at com.ibm.ws.jaxrs20.endpoint.AbstractJaxRsWebEndpoint.invoke(AbstractJaxRsWebEndpoint.java:134)
 at com.ibm.websphere.jaxrs.server.IBMRestServlet.handleRequest(IBMRestServlet.java:146)
 at com.ibm.websphere.jaxrs.server.IBMRestServlet.doGet(IBMRestServlet.java:112)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:686)
 at com.ibm.websphere.jaxrs.server.IBMRestServlet.service(IBMRestServlet.java:96)
 at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1255)
 at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:743)
 at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1221)
 at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4954)
 at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
 at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:996)
 at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
 at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1011)
 at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:414)
 at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:373)
 at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:532)
 at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:466)
 at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:331)
 at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:302)
 at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165)
 at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74)
 at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
 at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
 at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
 at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)

So, I think the fix will need to return a modifiable map that also honors the split headers setting (if enabled).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants