I am using Jasper plugin in my Grails project. The application works well when running within NetBeans. But after deploying to Tomcat everything except reports works well. When I try to run a report (jasper) the hell breaks out. It gives "Class not found error.
2014-01-29 09:47:43,280 [http-bio-8080-exec-10] ERROR errors.GrailsExceptionResolver - ClassNotFoundException occurred when processing request: [GET] /Ensign/jasper/index
org.joda.time.ReadableInstant.
Stacktrace follows:
java.lang.ClassNotFoundException: org.joda.time.ReadableInstant
at java.lang.Class.forName(Class.java:270)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
at net.sf.jasperreports.functions.FunctionsBundle.addFunctionClass(FunctionsBundle.java:84)
at net.sf.jasperreports.functions.FunctionsBundle.<init>(FunctionsBundle.java:54)
at net.sf.jasperreports.functions.FunctionsRegistryFactory.createRegistry(FunctionsRegistryFactory.java:76)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:239)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:214)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:162)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:133)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:105)
at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:81)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:407)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:824)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
The versions I am using are Grails 2.2.4 Jasper plugin 1.7.0 Tomcat 7.0.34
Has anyone come across this issue? Any help or direction would be much appreciated.
It seems that in the server you are missing the Joda Time library.
Download the joda-time.jar file and put it in the $TOMCAT_HOME/lib/ directory. Then restart your Tomcat and the error should be gone.