转自:http://www.codeorg.cn/article/detail/qa/542
在进行activiti环境搭建时总是抛出java.lang.NoClassDefFoundError: org.joda.time.ReadablePeriod错误信息,仔细观察该错误信息是NoClassDefFoundError(类没有找到错误),说明是缺少必要的jar文件。
错误信息:
2015-1-31 21:31:06 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [activiti.cfg.xml]
Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadablePeriod
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initBusinessCalendarManager(ProcessEngineConfigurationImpl.java:1078)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:376)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:362)
at com.bug315.ActivitiTest01.main(ActivitiTest01.java:11)
Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadablePeriod
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 4 more
解决办法:
将joda-time-2.7-no-tzdb.jar、joda-time-2.7.jar导入到项目的classpath下面即可解决(jar文件你可以到网上下载)。