EAP 6 with NIO connector intermittently returns 400 or incorrect header value

Solution Verified - Updated -

Issue

  • Seemingly at random, we receive an unexpected 400 response from JBoss and/or a request.getHeader() call is returning an incorrect value instead of the expected header value. For example, request.getHeader("Content-type") is unexpectedly returning a portion of the POST request body:
WARN  [org.jboss.resteasy.resteasy_jaxrs.i18n] (http-executor-threads - 13) RESTEASY000230: Failed to parse request.: java.lang.IllegalArgumentException: R
ESTEASY001295: Failure parsing MediaType string: UNEXPECTED_CONTENT_TYPE_VALUE                                                                                                               
        at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.parse(MediaTypeHeaderDelegate.java:45) [resteasy-jaxrs-2.3.22.Final-redhat-1.jar:]                       
        at org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate.fromString(MediaTypeHeaderDelegate.java:19) [resteasy-jaxrs-2.3.22.Final-redhat-1.jar:]                  
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:173) [jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-3.jar:1.0.1.Final-redhat-3]                                        
        at org.jboss.resteasy.plugins.server.servlet.ServletUtil.extractHttpHeaders(ServletUtil.java:90) [resteasy-jaxrs-2.3.22.Final-redhat-1.jar:]                             
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:186) [resteasy-jaxrs-2.3.22.Final-redhat-1.jar:]         
  • The exact same request can then be re-attempted and succeed in most cases.

Environment

  • JBoss Enteprise Application Platform (EAP) 6.4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In