java.lang.NoClassDefFoundError in web application

I am receiving the following error when calling a method that uses Aspose.Cells.

java.lang.NoClassDefFoundError: com/aspose/cells/Workbook

The method works outside of the application container, but the class cannot be found when inside the web application. I have tried various ways of deploying the jar with the application and all result in the same error.

This is the trial version of Aspose.Cells.

Thank you for considering Aspose.

Well, I think it has nothing to do with Aspose.Cells. To deploy jar in web application, the simplest way is to put the jar file under %application-root%/WEB-INF/lib. I think you can try to access other libs, such as try to access classes in log4j or dom4j, to check whether you can successfully access those classes. Using Aspose.Cells.jar is just same as using other libs like log4j, dom4j and so on.

Thank You & Best Regards,

Actually, we are using several other libraries with no problems. As I mentioned in my initial post we had tried deploying the application in many ways... including with the jar in the WEB-INF/lib folder -without success. This problem only occurrs with Aspose.Cells. Thanks.

Thank you for considering Aspose.

Well, it’s a very strange issue as we have our online demos working abs fine while using Aspose.Cells jar in the %application-root%/WEB-INF/lib. We have used Tomcat for our web demos and Aspose.Cells is working fine.

Following is the link to our online demos for your reference:
https://github.com/aspose-cells/Aspose.Cells-for-Java

Also, you may download our demos and try them in your environment and check if they work fine. Following is the link to the downloadable demos:

http://www.aspose.com/community/files/51/file-format-components/aspose.cells-for-.net-and-java/entry161647.aspx

Thank You & Best Regards,

Would you be able to direct me to, or provide, a full list of dependencies the Aspose.Cells jar relies on? Thanks.

Thank you for considering Aspose.

Well, I don’t know what you mean by “dependencies the Aspose.Cells jar relies on”. Aspose.Cells.Jar works independently and it does not depend on any other Jar or classes. Please create your own class Workbook and create its archive as Aspose.Cells.Jar and use it in your WEB/INF folder and try to access it and see if it can be accessed. Also, please make sure that you are using the right version of the jar as per the jdk installed for your web server. As there are two jar files supplied in the installation path, one for jdk 1.4 and other for jdk 5.0. It is just to make sure that you are using the right jar file.

Thank You & Best Regards,

As i stated previously we have no problem accessing any other libraries in our web application - only Aspose.Cells. We are using the JDK 1.4 version. The reason I was asking about potential dependencies is because sometimes conflicts and cause NoClassDefFound errors. I think we can close this topic as you are unable to provide any useful information regarding this problem with your product. Thanks.

Hi,

Well, to be more accurate, Aspose.Cells for Java actually depends on the dom4j library while processing Excel2007 and ODS file formats. But, I am afraid this dependency might not have anything to do with your problem/issue because the exception that you got is the application cannot find and load the com.aspose.cells.Workbook class. As a side note, you can try to create one simple class named just as com.aspose.cells.Workbook and archive it as Aspose.Cells.jar to replace our component and check whether this application can find and load this class or not.
Thank you.

Thanks for the reply.

I have tried your suggestion and the class loaded without exceptions. Perhaps some more details will help with this issue, the application is deployed in oc4j 10g 10.1.2.0.2 running on j2re1.4.2_19.

Thank you for considering Aspose.

Which version of Aspose.Cells for Java for JDK1.4 are you using? We have tested some versions of our component with both Tomcat 5 and oc4j 10g 10.1.2.0.2 with JDK1.4.2_11 and they all worked fine. Attached “MyJsp.jsp” is my simple jsp page for test. When this page is loaded completely, an excel file gets generated “res.xls”. Would you please try our latest version attached?

Thank You & Best Regards,

Thanks for helping me troubleshoot this issue. It turns out the was that I had not included Aspose.Cells in the manifest file for the jar that uses Aspose in the web application (as is the practice with all of our other libraries), therefore, there really is not a problem here with Aspose of course - but an error on my part. I would like to point out, however, that I did not use the new jar you recently provided (Aspose.CellsV2.1.0.12 – JDK 1.4); I discovered an issue that you may be interested in. If you view the V2.1.0.12 screenshot attached you will see that there is some kind of problem with the checkboxes where two checkboxes seem to be layered over each other. The other screenshot was produced with the version of Aspose.Cells I downloaded initially via the trial page (not sure the version number).

Thank you for considering Aspose.

Its good to know that your issue got resolved. For your mentioned issue regarding checkboxes, we have found the issue after an initial test,. We will look into it and fix it soon.

Thank You & Best Regards,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issues regarding the checkboxes.

Thank You & Best Regards,