tsgrp / OpenAnnotate

TSG's Browser-based Annotation Tool
8 stars 4 forks source link

AEV Fails with NPE when exporting doc with annotations for some PDFs #931

Closed gsteimer closed 2 years ago

gsteimer commented 2 years ago

Customers have seen a NPE when attempting to utilize the Annotated PDF Download action on some PDFs:

image

The OC error is:

2021-10-01 09:32:52,482 28533426    ajp-apr-8009-exec-5 INFO    OpenPdfOverlayEngine    Total Fonts = 2915, Total Font Families = 163
2021-10-01 09:32:52,576 28533520    ajp-apr-8009-exec-5 DEBUG   OpenPdfOverlayEngine    Working on Page 1 of 133
2021-10-01 09:32:52,607 28533551    ajp-apr-8009-exec-5 DEBUG   OpenPdfOverlayEngine    No overlays are configured... skipping OpenOverlay
2021-10-01 09:32:52,607 28533551    ajp-apr-8009-exec-5 DEBUG   OpenOverlayUtil ***** NON-CACHED applyOverlays call COMPLETED ****
2021-10-01 09:32:53,154 28534098    ajp-apr-8009-exec-5 ERROR   AbstractXFDFAnnotationImpl  Error getting the annotated PDF.
java.lang.NullPointerException
    at com.aspose.pdf.internal.l9p.lb.lI(Unknown Source)
    at com.aspose.pdf.internal.l8f.l0p.lI(Unknown Source)
    at com.aspose.pdf.internal.l8f.l0t.lI(Unknown Source)
    at com.aspose.pdf.internal.l0k.l0if.lI(Unknown Source)
    at com.aspose.pdf.ADocument.lf(Unknown Source)
    at com.aspose.pdf.ADocument.saveInternal(Unknown Source)
    at com.aspose.pdf.Document.saveInternal(Unknown Source)
    at com.aspose.pdf.ADocument$3.lI(Unknown Source)
    at com.aspose.pdf.internal.l90h.lf.lf(Unknown Source)
    at com.aspose.pdf.internal.l90h.lj.lI(Unknown Source)
    at com.aspose.pdf.ADocument.save(Unknown Source)
    at com.aspose.pdf.Document.save(Unknown Source)
    at com.tsgrp.opencontent.universal.annotation.AbstractXFDFAnnotationImpl.getAnnotatedPDF(AbstractXFDFAnnotationImpl.java:1388)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
    at com.sun.proxy.$Proxy272.getAnnotatedPDF(Unknown Source)
    at com.tsgrp.opencontent.universal.annotation.RESTAnnotation.setHeadersAndGetAnnotatedPdf(RESTAnnotation.java:787)
    at com.tsgrp.opencontent.universal.annotation.RESTAnnotation.getAnnotatedPDF(RESTAnnotation.java:670)
...
2021-10-01 09:32:53,154 28534098    ajp-apr-8009-exec-5 ERROR   RESTService Error getting the annotated PDF.
com.tsgrp.opencontent.core.exception.OCRuntimeException: Error getting the annotated PDF.
    at com.tsgrp.opencontent.universal.annotation.AbstractXFDFAnnotationImpl.getAnnotatedPDF(AbstractXFDFAnnotationImpl.java:1523)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
    at com.sun.proxy.$Proxy272.getAnnotatedPDF(Unknown Source)
    at com.tsgrp.opencontent.universal.annotation.RESTAnnotation.setHeadersAndGetAnnotatedPdf(RESTAnnotation.java:787)
    at com.tsgrp.opencontent.universal.annotation.RESTAnnotation.getAnnotatedPDF(RESTAnnotation.java:670)
...
Caused by: java.lang.NullPointerException
    at com.aspose.pdf.internal.l9p.lb.lI(Unknown Source)
    at com.aspose.pdf.internal.l8f.l0p.lI(Unknown Source)
    at com.aspose.pdf.internal.l8f.l0t.lI(Unknown Source)
    at com.aspose.pdf.internal.l0k.l0if.lI(Unknown Source)
    at com.aspose.pdf.ADocument.lf(Unknown Source)
    at com.aspose.pdf.ADocument.saveInternal(Unknown Source)
    at com.aspose.pdf.Document.saveInternal(Unknown Source)
    at com.aspose.pdf.ADocument$3.lI(Unknown Source)
    at com.aspose.pdf.internal.l90h.lf.lf(Unknown Source)
    at com.aspose.pdf.internal.l90h.lj.lI(Unknown Source)
    at com.aspose.pdf.ADocument.save(Unknown Source)
    at com.aspose.pdf.Document.save(Unknown Source)
    at com.tsgrp.opencontent.universal.annotation.AbstractXFDFAnnotationImpl.getAnnotatedPDF(AbstractXFDFAnnotationImpl.java:1388)
gsteimer commented 2 years ago

Here is an example PDF that fails: https://edge2.tsgrp.com/ocms/Stage/insuranceClaim/workspace://SpacesStore/d3d70704-1b8b-4b2d-a2b5-2e86e5c6cf41%7Cworkspace://SpacesStore/a4574903-d936-4d5f-9071-24dc7bd03617

gsteimer commented 2 years ago

See also: https://alfresco.atlassian.net/browse/MNT-22638

gsteimer commented 2 years ago

Moved to Jira: https://alfresco.atlassian.net/browse/SEP-73