0

Websphere Plugin does not return the http custom error code 422 to the client,instead shows a 500 error message. This is on WAS 8.5.5.9,IBM Http Server.

Dilip
  • 365
  • 1
  • 6
  • 18
  • Works just fine here, what was the result in http_plugin.log? Can you enable TRACE in plugin-cfg.xml? – covener May 06 '16 at 11:15
  • Yes,I've enabled trace. This was the error in the plugin log. – Dilip May 06 '16 at 13:26
  • [Tue May 03 07:41:10 2016] 00005838 00001efc - DETAIL: HTTP/1.1 422 [Tue May 03 07:41:10 2016] 00005838 00001efc - ERROR: lib_htresponse: htresponseRead: Response code 422 received. Error occured in reading response 2. [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: lib_htresponse: htresponseSetError: Setting the error to: |INVALID_FORMAT|(3, Line: 772) [Tue May 03 07:41:10 2016] 00005838 00001efc - ERROR: ws_common: websphereExecute: Failed to read from a new stream; App Server may have gone down during read – Dilip May 06 '16 at 13:31
  • [Tue May 03 07:41:10 2016] 00005838 00001efc - TRACE: ws_common: ServerActionfromReadRC: Request timed out. Won't retry since PostBufferSize is 0. [Tue May 03 07:41:10 2016] 00005838 00001efc - STATS: ws_server: serverSetFailoverStatus: Server SI0VM1893Node02_VKS : pendingRequests 0 failedRequests 1 affinityRequests 0 totalRequests 0. [Tue May 03 07:41:10 2016] 00005838 00001efc - ERROR: ESI: getResponse: failed to get response: rc = 11 [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: ESI: esiHandleRequest: failed to get response – Dilip May 06 '16 at 13:32
  • [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: ESI: esiRequestUrlStackDestroy [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: ESI: cacheURL: '/vks/rest/1/profile' [Tue May 03 07:41:10 2016] 00005838 00001efc - DETAIL: ESI: esiRequestPopUrl: '/vks/rest/1/profile' [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: ESI: esiUrlDestroy: '/vks/rest/1/profile' [Tue May 03 07:41:10 2016] 00005838 00001efc - ERROR: [10.4.103.136://vks/rest/1/profile] ws_common: websphereHandleRequest: Failed to handle request rc=11 – Dilip May 06 '16 at 13:32
  • [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: ws_common: websphereCloseConnection [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: lib_stream: destroyStream: Destroying the stream [Tue May 03 07:41:10 2016] 00005838 00001efc - DEBUG: lib_rio: rclose: socket 4064 closed [Tue May 03 07:41:10 2016] 00005838 00001efc - DETAIL: ws_common: websphereEndRequest: Ending the request – Dilip May 06 '16 at 13:33

1 Answers1

0

However you are setting that 422 status, you need to make sure a word follows the status code. In my test, if you use HTTPServletResponse#setStatus and an unknown status code for example, WAS adds the word "Undefined" at least.

The safest way is to use HTTPServletResponse#sendError which requires a status code and a reason string.

covener
  • 17,402
  • 2
  • 31
  • 45
  • Okay. The actual error message from the browser/applcation is: Error -status:500 -error:undefined -exception:undefined -message:undefined instead of the 422 response – Dilip May 06 '16 at 14:49
  • That's not really pertinent. Your log says the status line was " HTTP/1.1 422" which is invalid. There needs to be a reason-phrase after the status code. sendError() requires you supply both. How do you generate the 422 in your code? – covener May 07 '16 at 02:35
  • Okay. I will have to check. Thanks. – Dilip May 09 '16 at 09:22
  • Also,it works fine when I access the application server directly. – Dilip May 12 '16 at 06:09