[ 
https://issues.apache.org/jira/browse/CXF-8941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772706#comment-17772706
 ] 

John Yin commented on CXF-8941:
-------------------------------

Another piece of information that might be useful - we use Amazon Corretto JDK 
17.

> Intermittent IllegalArgumentException: invalid header name: ":status" when 
> processing responses
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-8941
>                 URL: https://issues.apache.org/jira/browse/CXF-8941
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.6.2
>            Reporter: John Yin
>            Priority: Major
>
> Intermittently, our CXF 3.6.2 application throws 
> java.lang.IllegalArgumentException: invalid header name: ":status" when 
> processing an HTTP 200 response.  For some responses that look almost the 
> same, CXF does not complain at all.  A sample response is provided below 
> along with the stacktrace.  Thanks in advance for your help!
>  
> Here is one sample response that caused the error.
> Response-Code: 200
> Encoding: UTF-8
> Content-Type: application/json; charset=utf-8
> Headers: {{*}:status=[200]{*}, cache-control=[max-age=0, private, 
> must-revalidate], cf-cache-status=[DYNAMIC], cf-ray=[8120d7582c945770-IAD], 
> content-type=[application/json; charset=utf-8], date=[Fri, 06 Oct 2023 
> 21:01:44 GMT], etag=[W/"ee18109d88c13426e719d4b94ee966ed"], 
> nel=[\{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}], 
> rate-limit=[2500], rate-limit-remaining=[2431], rate-limit-reset=[16], 
> report-to=[\{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=cOsINr5vmtTDMmXBT5prRJo0t%2BH6pPQ0XMI3jqa3BqngB0QhhzoH51kNiQ36yWPtTzI%2FyL3fOXgG%2BchPNpGVcMG0BVzVGrcDguWlf5WrD9w0rj0cY58vOpkML%2FPbSnV5Ne053tBNQc5MzRDvtRKWPuRz6QU%3D"}],"group":"cf-nel","max_age":604800}],
>  server=[cloudflare], 
> set-cookie=[_zendesk_cookie=BAhJIhl7ImRldmljZV90b2tlbnMiOnt9fQY6BkVU--0bf2100788cb010d0183feca16aaf88ccaf719ca;
>  path=/; expires=Sun, 06 Oct 2024 20:32:12 GMT; secure; HttpOnly; 
> SameSite=None, __cfruid=06ac2cb41aceac3e3b01106d2faee9ebc301c6c2-1696626104; 
> path=/; domain=.tescosupportcentre.zendesk.com; HttpOnly; Secure; 
> SameSite=None], strict-transport-security=[max-age=31536000; 
> includeSubDomains], x-frame-options=[SAMEORIGIN], x-rate-limit=[2500], 
> x-rate-limit-remaining=[2431], x-request-id=[8120d7582c945770-IAD, 
> 8120d7582c945770-IAD], x-runtime=[0.888500], x-zendesk-api-version=[v2], 
> x-zendesk-application-version=[v18586], 
> x-zendesk-origin-server=[classic-app-server-5cf4594448-kpvc5], 
> x-zendesk-zorg=[yes]}
> Payload: \{... removed}
>  
> Here is the stacktrace:
>  
> org.apache.cxf.interceptor.Fault: Problem with writing the data, class 
> java.lang.String, ContentType: application/json;charset=utf-8
>     at 
> org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1228)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1223)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:710)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:932) 
> ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901) 
> ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:364) 
> ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:348)
>  ~[camel-cxf-rest-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:102)
>  ~[camel-cxf-rest-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.support.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:48)
>  ~[camel-support-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
>  ~[camel-support-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172) 
> ~[camel-core-processor-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
>  ~[camel-base-engine-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:95) 
> ~[camel-core-processor-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
>  ~[camel-base-engine-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.processor.TryProcessor$TryState.run(TryProcessor.java:109) 
> ~[camel-core-processor-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
>  ~[camel-base-engine-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
>  ~[camel-base-engine-3.20.6.jar:3.20.6]
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:165) 
> ~[camel-core-processor-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
>  ~[camel-base-engine-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:269)
>  ~[camel-seda-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187) 
> ~[camel-seda-3.20.6.jar:3.20.6]
>     at 
> org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130) 
> ~[camel-seda-3.20.6.jar:3.20.6]
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
>  ~[?:?]
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>  ~[?:?]
>     at java.lang.Thread.run(Thread.java:833) ~[?:?]
> Caused by: javax.ws.rs.ProcessingException: Problem with writing the data, 
> class java.lang.String, ContentType: application/json;charset=utf-8
>     at 
> org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:853)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:536) 
> ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1223)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     ... 26 more
> Caused by: java.lang.IllegalArgumentException: invalid header name: ":status"
>     at jdk.internal.net.http.common.Utils.newIAE(Utils.java:286) 
> ~[java.net.http:?]
>     at 
> jdk.internal.net.http.HttpRequestBuilderImpl.checkNameAndValue(HttpRequestBuilderImpl.java:107)
>  ~[java.net.http:?]
>     at 
> jdk.internal.net.http.HttpRequestBuilderImpl.header(HttpRequestBuilderImpl.java:126)
>  ~[java.net.http:?]
>     at 
> jdk.internal.net.http.HttpRequestBuilderImpl.header(HttpRequestBuilderImpl.java:43)
>  ~[java.net.http:?]
>     at 
> org.apache.cxf.transport.http.HttpClientHTTPConduit$HttpClientWrappedOutputStream.setProtocolHeadersInBuilder(HttpClientHTTPConduit.java:399)
>  ~[cxf-rt-transports-http-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.transport.http.HttpClientHTTPConduit$HttpClientWrappedOutputStream.setProtocolHeaders(HttpClientHTTPConduit.java:527)
>  ~[cxf-rt-transports-http-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1373)
>  ~[cxf-rt-transports-http-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1353)
>  ~[cxf-rt-transports-http-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:60)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:90)
>  ~[cxf-core-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.provider.StringTextProvider.writeTo(StringTextProvider.java:73)
>  ~[cxf-rt-frontend-jaxrs-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.provider.StringTextProvider.writeTo(StringTextProvider.java:36)
>  ~[cxf-rt-frontend-jaxrs-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1651) 
> ~[cxf-rt-frontend-jaxrs-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:522) 
> ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     at 
> org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1223)
>  ~[cxf-rt-rs-client-3.6.2.jar:3.6.2]
>     ... 26 more



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to