3 Replies Latest reply on Oct 15, 2015 7:30 PM by Eric Stricker


    Eric Stricker

      I am trying to merge a PDF and XML to make an interactive PDF document. The next step will be to apply the RE key.

      For the merge data I created a standalone JAVA class as a package. The jsp is able to call the package, but I retrieve an error on line 74  doc = outputService.generatePDFOutput(inputPDF, inputXML, option);


      Error: (First few lines)


      03.11.2014 14:59:40.523 *ERROR* [0:0:0:0:0:0:0:1 [1414997980341] POST /content/ReaderExtensions/ApplyUsageRights.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

      java.lang.NullPointerException: null
          at apps.readerextensions.components.dummy.readerextensions.mergeData.generatePDFOutput(merge Data.java:82)
          at org.apache.jsp.apps.readerextensions.components.dummy.readerextensions.POST_jsp._jspServi ce(POST_jsp.java:219)
          at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
          at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:502)
          at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:449)
          at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :281)
          at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:102)

      • 0. Re: generatePDFOutput
        Eric Stricker Level 1

        Thanks for the response. I got some time to go over this and have narrow down the issue to the following:


        1. from a HTTP page I upload a PDF document.

        2. From the "Submit" button I call a POST.jsp page. 

        3. From the POST.jsp I like to call some custom java classes to be re-used. 

        Problem: If I code the storage of the the PDF document  to the repository in the POST.jspI have no problems, but once I move the code to a bundle-java class I receive a java.lang.nulpointerException: null. Why is it that I cannot pass the aemfd.document.document from the POST.jsp to a class file to do all the work for me?

        The error stack is the same are is printed above.