Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

generatePDFOutput

Avatar

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Eric_Stricker
Level 3

15-10-2015

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(mergeData.java:82)
    at org.apache.jsp.apps.readerextensions.components.dummy.readerextensions.POST_jsp._jspService(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.java:102)

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

160 likes

Total Posts

2,114 posts

Correct Reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

160 likes

Total Posts

2,114 posts

Correct Reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
Sham_HC
Level 10

15-10-2015

You need to use stream and store in repository rather than attempting to create file in file system.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Eric_Stricker
Level 3

15-10-2015

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.

Avatar

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Eric_Stricker
Level 3

15-10-2015

Thanks for the support. I manage to resolve the issue