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

Free Support Forum - aspose.com

NoClassDefFoundError when trying to extract image from pdf in Glassfish 7.1.1

Hi there,

we are trying to extract scanned images from a pdf. In a test scenario (unit test) this works like a charm, but once we try to include this into our web application things change for the worse.

I created a simple example where you can see that issue. The Unit test works and once you deploy and run this on a JBoss 7.1.1 (we haven’t tested any other application servers since this is our target system), it crashes.

Can you please investigate this issue?

Hi Scherge,


Thanks for your inquiry. I am preparing the required platform
to simulate the environment as of yours. As soon as everything is setup, I will
test the issue on my end and will post my results here for your kind reference.


We are sorry for the inconvenience caused.<o:p></o:p>


Best Regards,

Hi Scherge,

We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for Java 4.6.0 and AS JBoss 7.1.1., We have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWJAVA-34074 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

Hello Tilal,


are there any news on this issue?

Hi Scherge,


Thanks for your patience.<o:p></o:p>

The development team has been busy resolving other priority issues and I am afraid the above stated problem is not yet resolved. Nevertheless, as soon as I have some updates regarding its resolution, I would be more than happy to update you with the status of correction. Please be patient and spare us little time.

We are sorry for this delay and inconvenience.

Hi Nayyer,


are there any news on this issue? We are currently using a rather crude hack to bypass this issue and would like to implement the correct way to do this.

Best regards

Hi Scherge,


Thanks for your inquiry. I am afraid your issue is still not resolved due to other priority tasks. However, we have requested our development team to complete the investigation of the issue and share an ETA at their earliest. We will update you as soon as we get a feedback.

Thanks for your patience and cooperation.

Best Regards,

Hello Tilal,


did you get any update on the estimation?

Hi there,


Thanks for your inquiry. I am afraid the development team still has not completed the investigation due to other priority tasks. We will update you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

Hi Scherge,


Thanks for your patience.

The development team has further investigated the issue reported earlier and as per our observations, the exception: java.lang.ClassNotFoundException indicates that Aspose.Pdf for Java library has not been found. This is not a problem of our library. You should put our jar file into your servlet correctly, by default it is the path: WebContent\WEB-INF\lib</span>

Also, we have found some bugs in your code:

1) overloaded method init(…) - did not cause parent super method that blocks the whole process initialization. It is better to delete empty overload or comment it.

// /**<o:p></o:p>

// * @see Servlet#init(ServletConfig)

// */

// public void init(ServletConfig config) throws ServletException {

// // TODO Auto-generated method stub

// }

2) the next code returns null;

InputStream is = HelloWorld.class.getResourceAsStream("/Boom.pdf");

so it is better to use another way to get a resource file:

javax.servlet.ServletContext context = getServletContext();

InputStream is =
context.getResourceAsStream(
"/Boom.pdf");

3) The Boom.pdf file should be placed into WebContent folder.

4) aspose-pdf-9.3.0-jdk16.jar and javax.servlet-3.0.jar libs should to be placed into WebContent\WEB-INF\lib\ folder

Thanks Nayyar,

i will pass this info on :slight_smile: