fix bug 451629 and created unit test for cancel status to output error

fix bug 451629 and created unit test for cancel status to output error on document object


Signed-off-by: sguan <sguan@actuate.com>