我在Grails项目中使用Jasper插件。在NetBeans中运行时,该应用程序运行良好。但是在部署到Tomcat之后,除报告之外的一切都运行良好。当我试图运行报告(jasper)时,地狱爆发了。它给出了“未找到类错误。
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)
我使用的版本是 Grails 2.2.4 Jasper插件1.7.0 Tomcat 7.0.34
有没有人遇到过这个问题?任何帮助或指示都将非常感激。
答案 0 :(得分:0)
似乎在服务器中你缺少了Joda Time库。
下载joda-time.jar文件并将其放在$ TOMCAT_HOME / lib /目录中。然后重新启动Tomcat,错误应该消失。