我尝试使用http://groovy.codehaus.org/GroovyWS

在我的BuildConfig.groovy中,我添加了:编译'org.codehaus.groovy.modules:groovyws:0.5.2'

然后,我进入“刷新依赖关系”,下载了很多东西之后,我得到了:

Error executing script Compile: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.NodeImpl.getChildNodes()Lorg/w3c/dom/NodeList;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/dom/NodeImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Node have different Class objects for the type org/w3c/dom/NodeList used in the signature
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.NodeImpl.getChildNodes()Lorg/w3c/dom/NodeList;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/dom/NodeImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Node have different Class objects for the type org/w3c/dom/NodeList used in the signature
    at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at org.apache.ivy.util.XMLHelper.parseToDom(XMLHelper.java:196)
    at org.apache.ivy.plugins.parser.m2.PomReader.<init>(PomReader.java:95)
    at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:118)
    at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:108)
    at org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(DefaultRepositoryCacheManager.java:659)
    at org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(ModuleDescriptorMemoryCache.java:68)
    at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(DefaultRepositoryCacheManager.java:676)
    at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(DefaultRepositoryCacheManager.java:993)
    at org.apache.ivy.plugins.resolver.BasicResolver.parse(BasicResolver.java:546)
    at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:266)
    at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:503)
    at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
    at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
    at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:287)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:696)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:769)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:769)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
    at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
    at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:576)
    at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:237)
    at org.apache.ivy.core.resolve.ResolveEngine$resolve.call(Unknown Source)
    at grails.util.BuildSettings$_getDefaultCompileDependencies_closure9.doCall(BuildSettings.groovy:293)
    at grails.util.BuildSettings$_getDefaultCompileDependencies_closure9.doCall(BuildSettings.groovy)
    at grails.util.BuildSettings.getDefaultCompileDependencies(BuildSettings.groovy:293)
    at grails.util.BuildSettings.getCompileDependencies(BuildSettings.groovy:278)
    at _GrailsClasspath_groovy$_run_closure8.doCall(_GrailsClasspath_groovy:130)
    at _GrailsClasspath_groovy$_run_closure8.doCall(_GrailsClasspath_groovy)
    at _GrailsClasspath_groovy.setClasspath(_GrailsClasspath_groovy:190)
    at _GrailsClasspath_groovy$_run_closure1.doCall(_GrailsClasspath_groovy:39)
    at _GrailsEvents_groovy.run(_GrailsEvents_groovy:50)
    at _GrailsEvents_groovy$run.call(Unknown Source)
    at _GrailsArgParsing_groovy$run.call(Unknown Source)
    at _GrailsArgParsing_groovy.run(_GrailsArgParsing_groovy:29)
    at _GrailsArgParsing_groovy$run.call(Unknown Source)
    at _GrailsInit_groovy$run.call(Unknown Source)
    at _GrailsInit_groovy.run(_GrailsInit_groovy:37)
    at _GrailsInit_groovy$run.call(Unknown Source)
    at _GrailsCompile_groovy$run.call(Unknown Source)
    at _GrailsCompile_groovy.run(_GrailsCompile_groovy:28)
    at _GrailsCompile_groovy$run.call(Unknown Source)
    at Compile.run(Compile.groovy:25)
    at Compile$run.call(Unknown Source)
    at gant.Gant.prepareTargets(Gant.groovy:606)
Error executing script Compile: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.NodeImpl.getChildNodes()Lorg/w3c/dom/NodeList;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/dom/NodeImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Node have different Class objects for the type org/w3c/dom/NodeList used in the signature

任何人都可以帮助我解决什么问题?为什么会出现此异常以及如何解决?

谢谢

--MB

最佳答案

似乎您正在进入依赖疯狂状态。查看您关于此 LinkageError 的错误消息(我已经强调了一些内容):



为了使事情更加清楚(如果还不是这样的话),您的两个依赖项之间存在冲突。当您似乎使用Grails时,我倾向于对您说,您使用的GroovyWS版本与您当前的Grails安装不兼容。您是否尝试过使用Grails命令行安装groovyWS?我的意思是打电话给 install-dependency 吗?如果没有,我建议您通过致电来代替您的依赖

install-dependency org.codehaus.groovy.modules:groovyws

这样,Grails将使用其自己的兼容性机制。

如果这还不够,请尝试在that guide中查看如何排除有问题的依赖关系。

编辑您也可以遵循this blog entry的一些建议。

07-27 13:45