Unable to access REST API heartbeat in Spectrum 10.4.3

book

Article ID: 212923

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

After upgrade to 10.4.3, when sending REST API heartbeat, the system response is a HTTP 403 error:

java.io.IOException:

: https://xxxxxspsv001.xxxxx.gov.sg/spectrum/cryptoj.jnlp

at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
...

The issue is that an error is generated when accessing http://<OneClick_hostname>:<port>/spectrum/restful/heartbeat . This responds with error code 500.

Environment

DX NetOps Spectrum 20.2..x

Resolution

The following exceptions are being continuously generated whenever an attempted REST API call is made:

Mar 29, 2021 12:54:55 PM org.apache.catalina.core.ApplicationContext log

SEVERE: Servlet.init() for servlet [CXFServlet] threw exception

java.lang.NumberFormatException: null

        at java.lang.Integer.parseInt(Integer.java:542)

        at java.lang.Integer.parseInt(Integer.java:615)

        at com.ca.spectrum.restful.servlet.framework.CXFNonSpringJaxrsServlet.setSchemasLocations(CXFNonSpringJaxrsServlet.java:44)

        at org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet.init(CXFNonSpringJaxrsServlet.java:149)

        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)

        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)

        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:983)

        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4902)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5211)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)

        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1133)

        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1866)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

This is due to the ThreadPoolSize parameter being read in as null instead of some proper integer value and hence this exception is thrown.

The ThreadPoolSize value is read from:

$SPECROOT/tomcat/webapps/spectrum/WEB-INF/web.xml

In the section:

<init-param> 

<param-name>ThreadPoolSize</param-name> 

<param-value>20</param-value> 

</init-param> 

Check the value of ThreadPoolSize in the web.xml file. By default, its value should be 20 as shown above.

If its empty, then that is the root cause of this issue. If so, change it to 20 and then restart Spectrum Tomcat.

Additional Information

KB : REST API is no longer working after Spectrum upgrade