当我从数据库中检索数据时,似乎没有问题。但是当我生成jasper报告时,它给出了以下Exception。这适用于MySQL,但不适用于MS-SQL。要求是MS-SQL。请帮我一个。为什么我们这样普遍得到这样的Excepton: -
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
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)
答案 0 :(得分:1)
检查classpath
中是否存在以下依赖关系:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.8<version>
</dependency>
答案 1 :(得分:0)
您可以添加库jar(约旦时间), 链接下载https://sourceforge.net/projects/joda-time/files/joda-time/2.4/
答案 2 :(得分:-2)