java.lang.ClassNotFoundException: org.joda.time.ReadablePartial

半世苍凉 提交于 2019-12-01 18:06:06

问题


I'm using Eclipse Luna with Jaspersoft Studio plugin 6.2.2 to developer reports for web application. No problem to run one basic blank report from Eclipse plugin, but when I load this jrxml from java class, I receive the message:

Servlet.service() for servlet [default] in context with path [/insurance] threw exception [Filter execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.joda.time.ReadablePartial
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)  

I'm using the code:

JasperDesign jasperDesign = JRXmlLoader.load(fileName);

What's this error?


回答1:


Sounds like you're missing the Joda-Time dependency. GitHub project for Joda-Time available here.

As per documentation, to get the latest Joda-Time jar you can do:

Maven:

<dependency>
  <groupId>joda-time</groupId>
  <artifactId>joda-time</artifactId>
  <version>2.9.4</version>
</dependency>

Gradle:

compile 'joda-time:joda-time:2.9.4'

Or you can manually download the latest jar from here and add it to your classpath.



来源:https://stackoverflow.com/questions/37713168/java-lang-classnotfoundexception-org-joda-time-readablepartial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!