A failure of a long-running step by java.lang.NullPointerException

  • KM02851821
  • 30-Jun-2017
  • 21-May-2021

Summary

A long-running step may fail with java.lang.NullPointerException due to hard-coded session timeout value

Error

A long-running step may fail with java.lang.NullPointerException like this: 

YYYY-MM-DD 00:52:46,923 [1_WorkerExecutionThread-15_163909919] (ReflectionAdapterImpl.java:72) ERROR - Failed to run the action! Class: com.hp.oo.execution.control.actions.contentexecution.ContentExecutionActions, method: executeContentAction, reason: Failed to execute content action: com.hp.oo:oo-base-plugin:1.8.0 -> telnetOp
Reason: null

java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor1075.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at io.cloudslang.worker.execution.reflection.ReflectionAdapterImpl.executeControlAction(ReflectionAdapterImpl.java:62)
    at io.cloudslang.worker.execution.services.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:326)
    at io.cloudslang.worker.execution.services.ExecutionServiceImpl.execute(ExecutionServiceImpl.java:80)
    at io.cloudslang.worker.management.services.SimpleExecutionRunnable.executeRegularStep(SimpleExecutionRunnable.java:159)
    at io.cloudslang.worker.management.services.SimpleExecutionRunnable.run(SimpleExecutionRunnable.java:119)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at io.cloudslang.worker.management.services.WorkerThreadFactory$1.run(WorkerThreadFactory.java:33)
    at java.lang.Thread.run(Thread.java:745)
Caused by: io.cloudslang.score.exceptions.FlowExecutionException: Failed to execute content action: com.hp.oo:oo-base-plugin:1.8.0 -> telnetOp
Reason: null
    at com.hp.oo.execution.control.actions.contentexecution.ContentExecutionActions.executeContentAction(ContentExecutionActions.java:147)
    ... 14 more
Caused by: java.lang.NullPointerException
    at com.hp.oo.maven.PluginAdapterImpl.updateSessionContext(PluginAdapterImpl.java:358)
    at com.hp.oo.maven.PluginAdapterImpl.execute(PluginAdapterImpl.java:250)
    at com.hp.oo.execution.control.actions.contentexecution.ContentExecutionActions.executeContentAction(ContentExecutionActions.java:97)
    ... 14 more

Cause

The failure happens due to time-out(30 min by default) of an internal session.

Fix

As a workaround, try to increase the timeout value. The value is hardcoded in META-INF/spring/newAgentContext.xml in the following jar files:

[newAgentContext.xml]
<bean id="sessionTimeout" class="java.lang.Long">
    <constructor-arg type="long" value="7200000"/>
</bean>

[jar files]
OO_HOME/central/tomcat/webapps/oo/WEB-INF/lib/engine-webapp-10.*.jar
OO_HOME/ras/lib/oo-worker-standalone-support-10.*.jar