Thread lock when using PDF Java 21.2 and Java 11

Hello,

We are trying to move to Java 11 and we have found that Aspose PDF Java (latest version and previous versions) is getting stuck. Its fine with Java 9. This is happening on AWS linux, Windows and Mac OS.
The following stack trace:

Blockquote
java.lang.Thread.State: WAITING
at java.lang.Object.wait(Native Method)
- waiting on java.lang.Object@46ccb9dc
at java.lang.Object.wait(Object.java:328)
at com.aspose.pdf.internal.l57n.l3k.lI()
at com.aspose.pdf.internal.l57n.l3k.dc_()
at com.aspose.pdf.internal.l33l.lh.lI()
at com.aspose.pdf.internal.l33l.lk.dispose()
at com.aspose.pdf.internal.html.dom.Document.navigate()
at com.aspose.pdf.internal.html.dom.Document.()
at com.aspose.pdf.internal.html.HTMLDocument.()
at com.aspose.pdf.internal.html.HTMLDocument.()
at com.aspose.pdf.l6h.lI()
at com.aspose.pdf.l6h.lI()
at com.aspose.pdf.ADocument.lI()
at com.aspose.pdf.ADocument.()
at com.aspose.pdf.Document.()

We are using the following code:

Blockquote
InputStream targetStream = new ByteArrayInputStream(html.getBytes(“UTF-8”));
HtmlLoadOptions htmloptions = new HtmlLoadOptions();
htmloptions.setInputEncoding(“UTF-8”);
Font font = FontRepository.findFont(“Arial”);
font.setEmbedded(true);
htmloptions.getPageInfo().getDefaultTextState().setFont(font);
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(targetStream, htmloptions);

The following html is being used as input and can be downloaded from here: https://customerservices.glasscubes.com/share/s/83goi9kln635uvugkr73d5ank

@waynepope2020

The API is fully optimized to be used with Java 11 however, for some classes an external dependency should be included to add classpath of the Class: javax.xml.bind.annotation.adapters.HexBinaryAdapter , which was deleted from JRE.

For example:

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>

Furthermore, some API Classes are using JDK internal API i.e. java.base and java.desktop but, removal of such dependencies has been scheduled already and we will be modifying API code accordingly to make it more efficient.

A ticket as PDFJAVA-37957 has already been logged in our issue tracking system for Java 11 Support and it is under the phase of investigation. Furthermore, we have logged another ticket as PDFJAVA-40281 dedicated for the issue you are facing. We will look into details of it and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.