Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Null pointer exception error in copyObject



NullPointerException in copyObject() method in CompiledProcessBase has an underlying NonSerializableException.

Developer suggests change in this method to throw back original exception without eating the underlying cause. Right now, writeObject in copyObject() is throwing NonSerializableException

Error Messages

Nullpointer Exception

Steps to Reproduce

Any workflow file will have below line for serializing the context variable:

if(mto != null) {

If mto here is not implementing Serializable, copyObject() is throwing NullPointerException which are see in console and process canceled screen.

Root Cause

NullPointerException in copyObject method of CompiledProcessBase class has an underlying NonSerializableException. Here, writeObject method throws NonSerializableException (if the context variable passed in Compiled workflow does not implement Serializable). This further becomes NullpointerException because of the object is being null. NullPointerException is seen in the server console and process screen.


HFix-904 has been provided which address the above issue by adding null checks, try-catch block and LogHelper.error statements in copyObject method of CompiledProcessBase class.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us