HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › enabling debug throws error
- This topic has 5 replies, 2 voices, and was last updated Jul 29, 2024
21:19:36 by mdevc.
-
AuthorPosts
-
July 29, 2024 at 20:11#38447
I am using (evaluating) PD4ML 4.0.20 to replace our use of PD4ML v3. I am having issues loading images and external CSS files in a JSP file.
Our structure:
/WEB-INF/views/templates/report_template.jsp
/styles/report_style.css
/images/report_image.pngIn the past we’ve used the JSP standard library tags <c:url value=”/styles/report_style.css”/> with great success. This no longer seems to work with PD4ML v4.
I’ve tried relative paths, such as:
../../../styles/report_style.css
../../../images/report_image.pngwhich does not seem to work.
Embedded styles work fine.
I wanted to track down where PD4ML was trying to get the images from, so I added the following to the pd4ML:transform tag.
debug=”true”
This generated a 500 error. The partial stack trace is shown below.
Stacktrace:] with root cause
java.lang.NumberFormatException: For input string: “true”
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at com.pd4ml.taglib.PD4MLTransformerTag.setDebug(y:2448)Thoughts and solutions would be greatly appreciated.
July 29, 2024 at 20:26#38448Hi! Starting with PD4ML v4.0, the debug attribute requires a numeric value: a bitmask to enable certain aspects of logging. The value 255 enables a lot.
For easier migration to v4 you can keep pd4ml_tl.jar from PD4ML v3 and keep your JSPs unchanged (debug=”true” will act as debug=”255″). PD4ML v4 JAR includes PD4ML v3 API wrapper, so it will translate PD4ML v3 API calls coming from pd4ml_tl.jar to the new v4 API.
July 29, 2024 at 20:33#38449Hi! Starting with PD4ML v4.0, the debug attribute requires a numeric value: a bitmask to enable certain aspects of logging. The value 255 enables a lot.
For easier migration to v4 you can keep pd4ml_tl.jar from PD4ML v3 and keep your JSPs unchanged (debug=”true” will act as debug=”255″). PD4ML v4 JAR includes PD4ML v3 API wrapper, so it will translate PD4ML v3 API calls coming from pd4ml_tl.jar to the new v4 API.
So where is this documented?
Will including the pd4ml_tl.jar from pd4ml v3 allow us to use the new CSS / HTML / Accessibility features of v4?
July 29, 2024 at 20:51#38450So where is this documented?
The taglib URL doc is https://pd4ml.com/taglibdoc/
But as I see there is an inconsistence there with what I wrote above. I need to clarify that with the development.Will including the pd4ml_tl.jar from pd4ml v3 allow us to use the new CSS / HTML / Accessibility features of v4?
Ah, no… PD4ML v3 API “knows” nothing about PDF/UA output option. But CSS/HTML new features are there.
July 29, 2024 at 21:10#38452Hi! Starting with PD4ML v4.0, the debug attribute requires a numeric value: a bitmask to enable certain aspects of logging. The value 255 enables a lot.
For easier migration to v4 you can keep pd4ml_tl.jar from PD4ML v3 and keep your JSPs unchanged (debug=”true” will act as debug=”255″). PD4ML v4 JAR includes PD4ML v3 API wrapper, so it will translate PD4ML v3 API calls coming from pd4ml_tl.jar to the new v4 API.
Just as a note: Setting debug=”255″ provides no debugging information when running under Tomcat (nothing in catalina.out or localhost). There are no errors when generating the PDF, but there is no output in the logs. I’ll try running Tomcat with debug mode to see if that helps.
July 29, 2024 at 21:19#38453Hi! Starting with PD4ML v4.0, the debug attribute requires a numeric value: a bitmask to enable certain aspects of logging. The value 255 enables a lot.
For easier migration to v4 you can keep pd4ml_tl.jar from PD4ML v3 and keep your JSPs unchanged (debug=”true” will act as debug=”255″). PD4ML v4 JAR includes PD4ML v3 API wrapper, so it will translate PD4ML v3 API calls coming from pd4ml_tl.jar to the new v4 API.
Just as a note: Setting debug=”255″ provides no debugging information when running under Tomcat (nothing in catalina.out or localhost). There are no errors when generating the PDF, but there is no output in the logs. I’ll try running Tomcat with debug mode to see if that helps.
I’ve confirmed that running Tomcat under DEBUG mode does generate the debugging information. I am now parsing through that to figure out why styles and images are not being loaded. However that’s an issue for another thread.
Thanks for the pointers.
-
AuthorPosts
You must be logged in to reply to this topic.