IBM BPM, V8.0.1, All platforms > Troubleshooting and support > Troubleshooting administration tasks and tools > Troubleshooting BPEL processes and human tasks > Troubleshooting the execution of BPEL processes

Uninitialized variable or NullPointerException in a Java snippet

Using an uninitialized variable in a BPEL process can result in diverse exceptions.


Symptoms

Exceptions such as:


Reason

All variables in a BPEL process have the value null when a process is started, the variables are not pre-initialized. Using an uninitialized variable inside a Java snippet or Java expression leads to a NullPointerException.


Resolution

The variable must be initialized before it is used. This can be done by specifying an initial value when you define the variable, specifying an assign activity, for example, the variable needs to occur on the to-spec of an assign, or the variable can be initialized inside a Java snippet.

Troubleshooting the execution of BPEL processes