2013-03-08 105 views
1

我有它运行TestNG的testCase.But运行它显示像下面一个从ANT运行TestNG测试用例给DomSource不能被推断?

[testng] Error 
[testng] DOMSource cannot be processed: check that saxon8-dom.jar is on the classpath 
[testng] [GeneralXMLOutput] [Error] DOMSource cannot be processed: check that saxon8- dom.jar is on the classpath 

我的lib文件夹是有JDOM-0.7.jar,萨克森 - 8.7.jar,SaxonLiasion.jar错误而蚂蚁的任务,与xml有关。这是一个jar文件依赖冲突吗?

如何解决此错误?

Ant任务

<target name="runTests" depends="compile"> 
    <testng classpath="${test.classpath}:${build.dir}"> 
     <xmlfileset dir="${basedir}" includes="testng.xml" /> 
    </testng> 
</target> 

我已经在一些其他类javax.xml.transform.Transformer中使用API​​从rt.jar中和萨克森也有变压器的API。(Whethter创建一个问题吗?)

Regards,

回答

1

消息很清楚:检查saxon8-dom是否在类路径中。从你所说的话来看,事实并非如此。

但是撒克逊8.7是一个古老的发行版,无论如何,现在的版本是9.4。最近发布的版本包括主JAR文件中的DOM支持 - 之前保持独立的原因是因为DOM API在JDK 1.4和JDK 1.5之间以不兼容的方式进行了更改,而当Saxon放弃对JDK 1.4的支持时,此问题就消失了。

相关问题