IBM Support

HTTP 500 errors when using REST API's for WebSphere Presence Server

Troubleshooting


Problem

When using the IBM WebSphere Presence Server V7.0 REST API's, all requests fail with a HTTP 500 error returned to the client.

Symptom

The REST requests fail with messages similar to those listed below:

BNFHeadersImp 3 getHeaderAsString(s): PresenceHttpResposneId [null]
GatewayServle E response id was not found for the HTTP request
HttpResponseM 1 setStatusCode(sc): Status code: 500

webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet
Error]-[GatewayServlet]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: SRVE0295E: Error reported: 500
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:637)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1180)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1162)
at com.ibm.presence.rest.servlets.GatewayServlet.service(GatewayServlet.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)

Cause

Two possible causes include:

  • The IBMWebSpherePresenceServerRESTPlugin.jar is unreachable or not loaded into the cache at startup. This can be caused by corruption of the cache. The following lines will be present in the trace.log when the plugin initializes correctly during startup of the server:

    PresenceChann 2 Created Presence channel: PresenceChannel, weight: 0
    PresenceChann 3 Created new chain: PresenceChain in group: com.ibm.ws.runtime.WebContainerImpl:
    PresenceChann 3 Channel #1: TCP_2
    PresenceChann 3 Channel #2: HTTP_2

  • The proxy is sending the request to an incorrect port, specifically the WebSphere Application Server admin console port 9061. This is a result of not utilizing the chain with the PresenceChannel defined in it.

    Chain without PresenceChannel:
    [5/31/11 19:04:47:049 EDT] 00000000 WSChannelFram A CHFW0019I: The Transport Channel Service has started chain SOAPAcceptorChain1.
    [5/31/11 19:04:46:969 EDT] 00000000 TCPChannel I TCPC0001I: TCP Channel TCP_1 is listening on host * (IPv4) port 9061.

    Chain with PresenceChannel:
    [5/31/11 19:04:47:091 EDT] 00000000 WSChannelFram A CHFW0019I: The Transport Channel Service has started chain PresenceChain.
    [5/31/11 19:04:46:982 EDT] 00000000 TCPChannel I TCPC0001I: TCP Channel TCP_2 is listening on host * (IPv4) port 9081.


Note: The actual IBMWebSpherePresenceServerRESTPlugin.jar can be found in <was_home>/plugins directory.

Resolving The Problem

For the IBMWebSpherePresenceServerRESTPlugin.jar issue, follow the steps below to clear and reload the cache, enabling the plugin to load and initialize properly.

  1. Shutdown the entire environment (server, proxy, nodes, and DM)
  2. Run the following commands on each profile, including proxies and DM profiles, in the Presence cluster:
    - From the directory <wasroot>/profile/profilename/bin run the command "./osgiCfgInit.sh".
    - Then run the command "./clearClassCache.sh".
  3. After running the commands on all profiles restart the environment.

For the port issue, disable the WCInboundAdmin and WCInboundAdminSecure transport chains from the admin console. Select Server Types -> WebSphere application servers -> the Presence Server -> Web container transport chains. For both chains, uncheck the Enabled box.

[{"Product":{"code":"SS2PTT","label":"WebSphere Presence Server"},"Business Unit":{"code":"BU005","label":"IoT"},"Component":"Presence Server","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF002","label":"AIX"}],"Version":"7.0","Edition":""}]

Product Synonym

Presence WPS

Document Information

Modified date:
17 June 2018

UID

swg21461909