Dear Servoy,
We are experiencing some issues/difficulties with the generation of reports through a headless client.
Our current production setup is synchronous execution, but this can add anywhere from 10s tot a few minutes where the UI is blocked.
We are trying to move it to a background job, however any attempt at using blobs or base64 for images has been less than successful.
The funky part is that the headless client when ran in the IDE works as expected, an image appears on the report.
However, when running in our test environment (a docker container built through Servoy cloud pipeline) the resulting report has “null” instead of an image.
I’ve double checked, the data is there. I am seeing differing behaviour between the developer’s application server and your docker template’s application server in this regard.
The imageExpression line in our report for adding images is:
I would really appreciate any tips and best practice information regarding the use of blobs in jasperreports with the JSFoundset.
what if you use java.awt.Image as type instead of java.io.InputStream for the imageExpression, and load it like:
?
Sadly this is not a solution and behaves exactly the same.
Something weird also seems to be going on with upgrading to newer versions of the plugin through jenkins-customs/custom-jars/plugins/.
I get errors like classes from itext (com.lowagie.) not being found (like FopGlyphProcessor) in the execution.
As if not all the dependencies are shipped with the docker container image or the dependency resolution is incorrect.
which version of Servoy and jasper do you use?
so, in the IDE it works, no errors, but when deployed (so a war file) it doesn’t; can you check for all errors you see when deployed? maybe an exception prevents the image to be displayed…
Servoy version is previous LTS, aka 2022.3.8.
The plugin was on 6.17, then 6.17_01 and now I managed to get “Servoy JasperReports Plugin 2022.3.1_6.20.0” to work.
But I’m back to square one.
I’ve been able to ascertain where it goes wrong by running the report in both from client interaction and background job.
When executed from the ngClient in the browser, the resulting PDF contains the expected image.
When executed from the headlessclient originating from a background job, the resulting image is not an image but the text “null”.
This seems headless client/background job specific. Which makes the generation of PDFs from a background job impossible for now.
I’m going to open an official ticket in Jira, but before that I’ll try to execute the same with a built from version 2023.3.6 to rule out “outdated software bugs”.
Hi g.collette,
this sounds like an issue with images we’ve encountered with Aspose for Word library.
Try adding this java option to your Tomcat instance:
-Djava.awt.headless=true
After that restart Tomcat of course.
Hope that helps.
Ah, I suppose I will need to add that to the fargate task definition in the environment properties under JAVA_OPTS and not CATALINA_OPTS?
This worked:
In tomcat/bin folder
Open: tomcat9w.exe
Java tabpanel > Java options, add:
-Djava.awt.headless=true
We run our application in AWS in a docker container obtained through the servoy admin cloud pipelines.
I tried running with both Java_OPTS and CATALINA_OPTS with -Djava.awt.headless=true, but lamentably to no avail.
Still, thank you for your input and suggestions.
I’ve opened an official ticket in Jira.