NullPointerException is received in workflow function

Technote (FAQ)


This document applies only to the following language version(s):

Dutch, English, French, German, Japanese, Korean, Simplified Chinese, Spanish

Question

Why do I receive a NullPointerException when moving an item through collaboration areas

Cause

One of the possible causes would be that the workflow script is calling a variable which is not initialized.

For example, the code fragment below if used in workflow scripts will throw a NullPointerException


//var myOutput = createOtherOut("/debug.txt");
// variable myOutput is not initialized and will cause NullPointerException if called
myOutput.writeln("this is a debugging statement");
// myOutput.save("/debug.txt")


Above code would generate exception stack trace that looks similar to the one shown below

2011-01-31 12:20:06,941 [WorkflowEventProcessorEventId72304] ERROR com.ibm.ccd.common.error.AustinException - CWPCM0002E:Generic error / Exception: Generic Error, Exception:java.lang.NullPointerException
at
WPCSUCCESS12964935105740.ScriptFunction__OUT(WPCSUCCESS12964935105740.java:1039)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.ccd.common.interpreter.engine.Script.runFunction(Script.java:550)
at com.ibm.ccd.workflow.common.events.AbstractWorkflowEvent.runScriptFunction(AbstractWorkflowEvent.java:624)
at com.ibm.ccd.workflow.common.events.EndStepEvent.runOutOrTimeoutScript(EndStepEvent.java:806)
at com.ibm.ccd.workflow.common.events.EndStepEvent.runStepScript(EndStepEvent.java:950)
at com.ibm.ccd.workflow.common.events.AbstractWorkflowEvent.runStepScriptInTX(AbstractWorkflowEvent.java:2018)
at com.ibm.ccd.workflow.common.events.AbstractWorkflowEvent.processFullEventWithTransactions(AbstractWorkflowEvent.java:1964)
at com.ibm.ccd.workflow.common.WorkflowRunnable.processWorkflowEventDbRecord(WorkflowRunnable.java:149)
at com.ibm.ccd.workflow.common.WorkflowRunnable.run(WorkflowRunnable.java:93)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
at java.lang.Thread.run(Thread.java:811)

Answer

To solve the NullPointerException error, simply remove or comment out all the scripting operations referencing writer object that is not initialized


Cross reference information
Segment Product Component Platform Version Edition
Information Management InfoSphere Master Data Management Collaboration Server AIX, Linux, Solaris 10.0 All Editions

Product Alias/Synonym

WPC
MDMPIM
MDM Server for PIM
WebSphere Product Center
InfoSphere MDM Server for PIM
InfoSphere Master Data Management Server for Product Information Management

Rate this page:

(0 users)Average rating

Document information


More support for:

InfoSphere Master Data Management Server for Product Information Management
Scripting/API

Software version:

6.0, 6.5, 9.0, 9.1

Operating system(s):

AIX, HP-UX, Linux, Solaris

Software edition:

Enterprise

Reference #:

1474302

Modified date:

2012-11-02

Translate my page

Machine Translation

Content navigation