#java.lang.NoClassDefFoundError:org/apache/commons/digester/Digester [英] #java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester

查看:250
本文介绍了#java.lang.NoClassDefFoundError:org/apache/commons/digester/Digester的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我越来越 java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester错误,并且这个错误困扰了我一个多月.我已经尝试了所有可用的Digester版本,并且还在类路径中检查了重复的JAR.

I am getting java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester error and I am stuck with this error for more than a month. I have tried all Digester versions available and I also checked for duplicate JARs in classpath.

我通过iReport-5.6.0设计了报告,并使用了 iReport-5.6.0\ireport\modules\ext和其他必需的JAR.

I have designed the report through iReport-5.6.0 and I used the JARs from the iReport-5.6.0\ireport\modules\ext and other required JARs.

错误日志:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:108)
    at net.sf.dynamicreports.examples.JasperMongoDBConnection.main(JasperMongoDBConnection.java:30)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.digester.Digester
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

推荐答案

如果抛出NoClassDefFoundError,则应检查是否在类路径中正确加载了所需的jar,或者您正在混合使用的版本和类名可能不同(或这是行为). 检查您要添加的Digester jar是否是必需的.

If NoClassDefFoundError is thrown you should check that needed jars are properly loaded in the classpath, or maybe you are mixing versions and class names may be different (or it's behavior). Check if the Digester jar you are adding is the one that is needed.

检查这些罐子是否正确装入:

Check if these jar are correctly loaded:

jasperreports-.jar;
jasperreports-javaflow.jar;
commons-beanutils.jar;
commons-collections.jar;
commons-logging.jar;
commons-digester.jar

在eclipse实例下查看jasper report plugin文件夹.在此文件夹中搜索公共摘要" jar,然后在您的项目中复制相同的jar(和其他列出的jar).

Take a look on jasper report plugin folder under your eclipse instance. Search for the commons digester jar inside this folder and copy the same jar (and the other of listed jars) in your project.

这篇关于#java.lang.NoClassDefFoundError:org/apache/commons/digester/Digester的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆