ANT 找不到 org.dbunit.ant.DbUnitTask
因此,我正在编写一个 ant 构建文件来运行一些测试,并且我使用以下行对于 MXUnit 没有任何问题:
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="../mxunit/ant/lib/mxunit-ant.jar"/>
但是当我从 http://sourceforge.net/projects/dbunit/files/ 并将其放在与 相同的目录中mxunit-ant.jar
,然后将以下行添加到 ANT 构建文件中:
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpath="../mxunit/ant/lib/dbunit-2.4.8.jar"/>
我在 Eclipse 中看到一条警告:
taskdef 类需要的类 org.dbunit.ant.DbUnitTask 不能 找到:org/slf4j/LoggerFactory
当我提取 jar 文件时,它确实有 org.dbunit.ant.DbUnitTask 类..所以我对 ANT 抱怨的内容感到非常困惑..知道问题是什么吗?
So I'm writing a ant build file to run some tests, and I use the following line without any issue for MXUnit:
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="../mxunit/ant/lib/mxunit-ant.jar"/>
But when I download dbunit-2.4.8.jar
from http://sourceforge.net/projects/dbunit/files/ and put it in the same directory as mxunit-ant.jar
, then added the following line to the ANT build file:
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpath="../mxunit/ant/lib/dbunit-2.4.8.jar"/>
For which I see a warning in Eclipse that says:
taskdef A class needed by class
org.dbunit.ant.DbUnitTask cannot be
found: org/slf4j/LoggerFactory
When I extract the jar file it does have the org.dbunit.ant.DbUnitTask class.. so I'm very confused as to what ANT is complaining about.. any idea what the issue is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您需要确保满足 DbUnit 的所有 依赖项,并安装dbunit-2.4.8.jar。
您引用的类
org/slf4j/LoggerFactory
未找到的具体错误表明您没有 SLF4J 类。 (可能需要最新版本的 slf4j-api.jar。)It looks like you need to make sure all the dependencies of DbUnit are satisfied, as well as installing the dbunit-2.4.8.jar.
The specific error you quote with class
org/slf4j/LoggerFactory
not being found suggests that you don't have the SLF4J classes needed. (Probably the latest version of slf4j-api.jar is needed there.)