-
1. Re: Got NoClassDefFoundError when deployed to production ser
chrismalan Nov 9, 2006 4:54 AM (in response to kingcu)Hi Kingcu,
Which class is not found?
All I can recommend is a step by step drill-down to find the problem.
1)Get the name of the specific class not found, e.g., xyz.dkl.Wonderful.class
2)Find out in which jar this class is
3)Make sure that jar is on your classpath at the production server
Hope this helps -
2. Re: Got NoClassDefFoundError when deployed to production ser
kingcu Nov 9, 2006 9:09 AM (in response to kingcu)The class is PiePlot, which is part of JFreeChart.jar, and this jar IS there in the WAR file. I thought any class under WEB-INF/lib is automatically under the classpath, otherwise it would have failed on my local machine also. Or maybe I am missing something like the difference between running inside the IDE and on the server. So, how to check the classpath on the server?
Thanks,
Tong -
3. Re: Got NoClassDefFoundError when deployed to production ser
kingcu Nov 9, 2006 9:43 AM (in response to kingcu)Just got my problem fixed, it's because JFreeChart calls Java2D, which requires a display environment, which is not available on the Linux server. So, I changed the batch file to add -Djava.awt.headless=true to tell JVM to use a headless display. See below link for details:
http://java.sun.com/products/java-media/2D/reference/faqs/index.html#Q_I_have_an_application_that_rea