We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.PDF hangs when used with Glassfish 4

Hi there,

I’m currently experiencing a problem with Aspose.PDF and Glassfish 4. I’m using the following (simple) snippet to add text to a new PDF file.

ByteArrayOutputStream baos = new ByteArrayOutputStream();
com.aspose.pdf.Document pdf = new com.aspose.pdf.Document();
Page page = pdf.getPages().add();
TextFragment fragment = new TextFragment(“example”);

As soon as I reach the TextFragment line I end up nowhere, everything hangs. I can not step into, over or anything. Furthermore there is no exception or anything in the server.log.

When enabling glassfish classloader logging to check if the classes are loaded at all I found the followin entries:

[Loaded com.aspose.pdf.internal.ms.System.z133 from file:/home/imaadm/glassfish4/glassfish/domains/ima_develop_95/lib/aspose-pdf-10.6.2.jar]
[Loaded com.aspose.pdf.internal.ms.System.z107 from file:/home/imaadm/glassfish4/glassfish/domains/ima_develop_95/lib/aspose-pdf-10.6.2.jar]
<dependency_failed type=‘leaf_type’ ctxk=‘java/lang/NullPointerException’ witness=‘com/aspose/pdf/internal/ms/System/z107’ stamp=‘227.866’/>
<dependency_failed type=‘leaf_type’ ctxk=‘java/lang/NullPointerException’ witness=‘com/aspose/pdf/internal/ms/System/z107’ stamp=‘227.866’/>

I also checked Aspose.PDF 10.8.0, same result.

We’re additionally using Aspose.Cells, Slides, Words and Email in the same application, all of them are working fine, it’s just the PDF module that somehow does nothing.

Glassfish 4 is running on CentOS 6.3 with Java 1.8.

Kind regards,

Hi Tim,

Thanks for contacting support and sorry for the delayed response.

We have not yet tested the compatibility of Aspose.Pdf for Java with GlassFish but for the sake of correction, I have logged an investigation ticket as PDFNEWJAVA-35279 in
our issue tracking system. We will further look into the details of this
problem and will keep you updated on the status of correction. Please be
patient and spare us little time. We are sorry for this inconvenience.

Hi Nayyer,

just for your information: We’ve been running Aspose modules in our EJB application for years now. This is the first time we’ve had an issue and this only occurs on one single domain. The classloader issue was all I found out about, so I redirected the information to you guys since I cannot debug the NPE that occurs because I obviously do not have the source code :-).

Kind regards,

Hi Tim,

Thanks for your feedback. We will look into the issue and will update you our findings asap.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,

I have an update from our side: a colleague of mine found out that the aforementionen behaviour only happens in case the package “fontconfig” is missing on the Linux system.

Hope that helps!

Kind regards,

Hi Tim,

Thanks you very much for sharing your findings. I have passed on your finding with the product team and will notify you as soon as we made some significant progress towards issue resolution.

Thanks for your patience and cooperation.

Best Regards,