title: API returns 500 while running mule with jetty
body: <p>First of all it picks text/plain in content-type header and it shows headers as empty.</p>
  <p>I am calling GET /myapp/v2/status API and app is deployed on mule ESB which is using jetty. I just can not understand these logs.</p>
  <pre><code>    2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.servlet.ServletResponseWriter [ensureContentTypeHeaderIsSet:190]
  [:::::]-Using Content-Type from message header = text/plain
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$CommitCallback@1feedc9e generate: NEED_HEADER (null,[p=0,l=0,c=0,r=0],false)@START
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$CommitCallback@1feedc9e generate: FLUSH ([p=0,l=131,c=8192,r=131],[p=0,l=0,c=0,r=0],false)@COMMITTED
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-write: WriteFlusher@18e402ed{IDLE} [HeapByteBuffer@5534dd6[p=0,l=131,c=8192,r=131]={&lt;&lt;&lt;HTTP/1.1 500 Serv...t-Length: 0||||&gt;&gt;&gt;|http.status: 200...}]
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  </code></pre>
  <p>Mule Flow:</p>
  <pre><code>&lt;flow name=&quot;myAppHealthChecks&quot; doc:name=&quot;myApp Health Check Services&quot;&gt;
  &lt;composite-source&gt;
      &lt;inbound-endpoint ref=&quot;StatusSvcExternalEndpoint&quot;&gt;
          &lt;not-filter&gt;
              &lt;wildcard-filter pattern=&quot;/favicon.ico&quot;/&gt;
          &lt;/not-filter&gt;
      &lt;/inbound-endpoint&gt;
      &lt;inbound-endpoint ref=&quot;StatusSvcInternalEndpoint&quot;&gt;
          &lt;not-filter&gt;
              &lt;wildcard-filter pattern=&quot;/favicon.ico&quot;/&gt;
          &lt;/not-filter&gt;
      &lt;/inbound-endpoint&gt;
  &lt;/composite-source&gt;
  &lt;jersey:resources doc:name=&quot;Status Service Component&quot;&gt;
      &lt;component&gt;
          &lt;spring-object bean=&quot;statusService&quot;/&gt;
      &lt;/component&gt;
      &lt;jersey:context-resolver class=&quot;com.it.is.abs.core.http.myAppJAXBContextProvider&quot;/&gt;
  &lt;/jersey:resources&gt;
  </code></pre>
  
  <p>Full Logs</p>
  <pre><code>2021-02-24;22:42:01.994 [qtp1853662226-95] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$Input@47d5420f{HttpChannelOverHttp@43eace2d{r=1,a=IDLE,uri=-},HttpConnection@6a6d1194{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=END,0 of 0}} shutdown
  2021-02-24;22:42:01.994 [qtp1853662226-95] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-HttpChannelOverHttp@43eace2d{r=1,a=IDLE,uri=-} handle enter
  2021-02-24;22:42:01.994 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-REQUEST /myapp/v2/status on HttpChannelOverHttp@43eace2d{r=1,a=DISPATCHED,uri=/myapp/v2/status}
  2021-02-24;22:42:01.994 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-scope null||/myapp/v2/status @ o.e.j.s.ServletContextHandler@5092d2c6{/,null,AVAILABLE,@0.0.0.0:8888}
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-scope null||/myapp/v2/status @ o.e.j.s.ServletContextHandler@5092d2c6{/,null,AVAILABLE,@0.0.0.0:8888}
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-scope null||/myapp/v2/status @ o.e.j.s.ServletContextHandler@1b0642b8{/,null,AVAILABLE,@0.0.0.0:8889}
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-context=||/myapp/v2/status @ o.e.j.s.ServletContextHandler@1b0642b8{/,null,AVAILABLE,@0.0.0.0:8889}
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-servlet ||/myapp/v2/status -&gt; org.mule.transport.servlet.jetty.JettyReceiverServlet-6ac4efa8@be63ce8==org.mule.transport.servlet.jetty.JettyReceiverServlet,-1,true
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-chain=null
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.http.transformers.MuleMessageToHttpResponse [registerSourceType:175]
  [:::::]-java.lang.Object has been added as source type for this transformer, there will be no source type checking performed
  2021-02-24;22:42:01.995 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.DefaultMuleMessage [setPropertyInternal:514]
  [:::::]-setProperty(key, value) called with null value; removing key: MULE_CHARACTER_ENCODING
  2021-02-24;22:42:01.996 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.InterceptingChainLifecycleWrapper [process:67]
  [:::::]-Invoking InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' composite request/response chain'
  [
    InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' request chain'
    [
      org.mule.endpoint.inbound.InboundEndpointMimeTypeCheckingMessageProcessor,
      org.mule.endpoint.inbound.InboundEndpointPropertyMessageProcessor,
      org.mule.endpoint.inbound.InboundNotificationMessageProcessor,
      org.mule.endpoint.inbound.InboundLoggingMessageProcessor,
      org.mule.routing.filters.logic.NotFilter (wrapped by MessageFilter),
      org.mule.source.StartableCompositeMessageSource$InternalMessageProcessor
    ],
    InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' response chain'
    [
      org.mule.endpoint.inbound.InboundExceptionDetailsMessageProcessor,
      org.mule.routing.requestreply.ReplyToPropertyRequestReplyReplier
    ]
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.996 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.SimpleMessageProcessorChain [process:67]
  [:::::]-Invoking SimpleMessageProcessorChain
  [
    InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' request chain'
    [
      org.mule.endpoint.inbound.InboundEndpointMimeTypeCheckingMessageProcessor,
      org.mule.endpoint.inbound.InboundEndpointPropertyMessageProcessor,
      org.mule.endpoint.inbound.InboundNotificationMessageProcessor,
      org.mule.endpoint.inbound.InboundLoggingMessageProcessor,
      org.mule.routing.filters.logic.NotFilter (wrapped by MessageFilter),
      org.mule.source.StartableCompositeMessageSource$InternalMessageProcessor
    ],
    InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' response chain'
    [
      org.mule.endpoint.inbound.InboundExceptionDetailsMessageProcessor,
      org.mule.routing.requestreply.ReplyToPropertyRequestReplyReplier
    ]
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.996 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.InterceptingChainLifecycleWrapper [process:67]
  [:::::]-Invoking InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' request chain'
  [
    org.mule.endpoint.inbound.InboundEndpointMimeTypeCheckingMessageProcessor,
    org.mule.endpoint.inbound.InboundEndpointPropertyMessageProcessor,
    org.mule.endpoint.inbound.InboundNotificationMessageProcessor,
    org.mule.endpoint.inbound.InboundLoggingMessageProcessor,
    org.mule.routing.filters.logic.NotFilter (wrapped by MessageFilter),
    org.mule.source.StartableCompositeMessageSource$InternalMessageProcessor
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.997 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.SimpleMessageProcessorChain [process:67]
  [:::::]-Invoking SimpleMessageProcessorChain
  [
    org.mule.endpoint.inbound.InboundEndpointMimeTypeCheckingMessageProcessor,
    org.mule.endpoint.inbound.InboundEndpointPropertyMessageProcessor,
    org.mule.endpoint.inbound.InboundNotificationMessageProcessor,
    org.mule.endpoint.inbound.InboundLoggingMessageProcessor,
    org.mule.routing.filters.logic.NotFilter (wrapped by MessageFilter)
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.997 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.endpoint.inbound.InboundLoggingMessageProcessor [process:35]
  [:::::]-Message Received on: http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.997 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.InterceptingChainLifecycleWrapper [process:67]
  [:::::]-Invoking InterceptingChainLifecycleWrapper 'wrapper for 'myappHealthChecks' processor chain'
  [
    org.mule.construct.AbstractPipeline$1,
    org.mule.construct.AbstractPipeline$ProcessIfPipelineStartedMessageProcessor,
    org.mule.interceptor.ProcessingTimeInterceptor,
    org.mule.construct.processor.FlowConstructStatisticsMessageProcessor,
    org.mule.construct.DynamicPipelineMessageProcessor,
    org.mule.processor.LaxSedaStageInterceptingMessageProcessor,
    JerseyResourcesComponent{myappHealthChecks.component.745295748},
    org.mule.routing.requestreply.AsyncReplyToPropertyRequestReplyReplier,
    org.mule.construct.AbstractPipeline$2@7dc628cf
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.997 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.DefaultMessageProcessorChain [process:67]
  [:::::]-Invoking DefaultMessageProcessorChain '(inner iterating chain) of 'myappHealthChecks' processor chain'
  [
    org.mule.construct.AbstractPipeline$1
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.997 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.DefaultMessageProcessorChain [process:67]
  [:::::]-Invoking DefaultMessageProcessorChain '(inner iterating chain) of 'myappHealthChecks' processor chain'
  [
    org.mule.construct.processor.FlowConstructStatisticsMessageProcessor,
    org.mule.construct.DynamicPipelineMessageProcessor
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.998 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.DefaultMessageProcessorChain [process:67]
  
  [:::::]-Invoking DefaultMessageProcessorChain '(inner iterating chain) of 'myappHealthChecks' processor chain'
  
  [
    JerseyResourcesComponent{myappHealthChecks.component.745295748},
    org.mule.routing.requestreply.AsyncReplyToPropertyRequestReplyReplier
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.998 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.InterceptingChainLifecycleWrapper [process:67]
  [:::::]-Invoking InterceptingChainLifecycleWrapper 'wrapper for Component interceptor processor chain for :myappHealthChecks.component.745295748'
  [
    org.mule.component.AbstractComponent$1$1@ae65900
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.998 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.DefaultMessageProcessorChain [process:67]
  [:::::]-Invoking DefaultMessageProcessorChain '(inner iterating chain) of Component interceptor processor chain for :myappHealthChecks.component.745295748'
  [
    org.mule.component.AbstractComponent$1$1@ae65900
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:01.999 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.module.jersey.JerseyResourcesComponent [buildRequest:273]
  [:::::]-Base URI: http://myapp-sl2.qal2.dca.diginsite.net:8889/myapp/v2/
  2021-02-24;22:42:01.999 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.module.jersey.JerseyResourcesComponent [buildRequest:274]
  [:::::]-Complete URI: http://myapp-sl2.qal2.dca.diginsite.net:8889/myapp/v2/status
  2021-02-24;22:42:02.000 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.simple.ObjectToInputStream [transform:411]
  [:::::]-Applying transformer _ObjectToInputStream (org.mule.transformer.simple.ObjectToInputStream)
  2021-02-24;22:42:02.000 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.simple.ObjectToInputStream [transform:412]
  [:::::]-Object before transform: /myapp/v2/status
  2021-02-24;22:42:02.000 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.simple.ObjectToInputStream [transform:424]
  [:::::]-Object after transform: java.io.ByteArrayInputStream@5a8c3df9
  2021-02-24;22:42:02.000 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.AbstractTransformer [checkTransformerReturnClass:197]
  [:::::]-The transformed value is of expected type. Type is: ByteArrayInputStream
  2021-02-24;22:42:02.022 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.DefaultMuleMessage [applyAllTransformers:1543]
  [:::::]-Using TransformerTemplate{this=879b82b, name='null', ignoreBadInput=false, returnClass=SimpleDataType{type=java.lang.Object, mimeType='*/*', encoding='null'}, sourceTypes=[]} to transform payload.
  2021-02-24;22:42:02.022 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.TransformerTemplate [transform:112]
  [:::::]-Applying transformer TransformerTemplate (org.mule.transformer.TransformerTemplate)
  2021-02-24;22:42:02.023 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.TransformerTemplate [transform:155]
  [:::::]-Object after transform: org.mule.module.jersey.JerseyResourcesComponent$2@71782a9a
  2021-02-24;22:42:02.023 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transformer.TransformerTemplate [checkReturnClass:187]
  [:::::]-The transformed object is of expected type. Type is: JerseyResourcesComponent$2
  2021-02-24;22:42:02.024 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.InterceptingChainLifecycleWrapper [process:67]
  [:::::]-Invoking InterceptingChainLifecycleWrapper 'wrapper for InboundEndpoint 'http://0.0.0.0:8889/myapp/v2' response chain'
  [
    org.mule.endpoint.inbound.InboundExceptionDetailsMessageProcessor,
    org.mule.routing.requestreply.ReplyToPropertyRequestReplyReplier
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:02.024 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.processor.chain.SimpleMessageProcessorChain [process:67]
  [:::::]-Invoking SimpleMessageProcessorChain
  [
    org.mule.endpoint.inbound.InboundExceptionDetailsMessageProcessor,
    org.mule.routing.requestreply.ReplyToPropertyRequestReplyReplier
  ] with event MuleEvent: 0-9104fcc1-7734-11eb-a6b5-005056a03556, stop processing=false, http://0.0.0.0:8889/myapp/v2
  2021-02-24;22:42:02.024 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.http.transformers.MuleMessageToHttpResponse [transform:112]
  [:::::]-Applying transformer MuleMessageToHttpResponse (org.mule.transport.http.transformers.MuleMessageToHttpResponse)
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.http.transformers.MuleMessageToHttpResponse [transform:155]
  [:::::]-Object after transform: org.mule.transport.http.HttpResponse@5a938f07
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.http.transformers.MuleMessageToHttpResponse [checkReturnClass:187]
  [:::::]-The transformed object is of expected type. Type is: HttpResponse
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.mule.transport.servlet.ServletResponseWriter [ensureContentTypeHeaderIsSet:190]
  [:::::]-Using Content-Type from message header = text/plain
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$CommitCallback@1feedc9e generate: NEED_HEADER (null,[p=0,l=0,c=0,r=0],false)@START
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$CommitCallback@1feedc9e generate: FLUSH ([p=0,l=131,c=8192,r=131],[p=0,l=0,c=0,r=0],false)@COMMITTED
  2021-02-24;22:42:02.025 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-write: WriteFlusher@18e402ed{IDLE} [HeapByteBuffer@5534dd6[p=0,l=131,c=8192,r=131]={&lt;&lt;&lt;HTTP/1.1 500 Serv...t-Length: 0||||&gt;&gt;&gt;|http.status: 200...}]
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-update WriteFlusher@18e402ed{WRITING}:IDLE--&gt;WRITING
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-flushed 131 SelectChannelEndPoint@62b1924c{/10.102.144.96:4680&lt;r-l&gt;/10.102.146.111:8889,o=true,is=false,os=false,fi=FillInterest@1dcf1e2a{false,null},wf=WriteFlusher@18e402ed{WRITING},it=30000}{HttpConnection@6a6d1194{FILLING},g=HttpGenerator{s=COMMITTED},p=HttpParser{s=END,0 of 0}}{io=0,kio=0,kro=1}
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-flushed true
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-update WriteFlusher@18e402ed{IDLE}:WRITING--&gt;IDLE
  2021-02-24;22:42:02.026 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-org.eclipse.jetty.server.HttpConnection$CommitCallback@1feedc9e generate: DONE ([p=131,l=131,c=8192,r=0],[p=0,l=0,c=0,r=0],false)@COMMITTED
  2021-02-24;22:42:02.027 [qtp1853662226-95 - /myapp/v2/status] DEBUG org.eclipse.jetty [debug:80]
  [:::::]-RESPONSE /myapp/v2/status  500 handled=true
  </code></pre>
  <p>Same code runs fine in one environment and not working in one environment.</p>