2011-05-09 45 views
2

我曾嘗試使用http://groovy.codehaus.org/GroovyWS常規的Web服務

在我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 

任何人都可以幫我什麼gonig?爲什麼我會得到這個異常以及如何解決它?

感謝

--MB

回答

2

好像你正在進入一個依賴瘋狂。看看這個LinkageError(我已經添加了一些強調)你的錯誤信息:

錯誤執行腳本編譯:裝載機約束違反接口itable初始化:解決方法時,「org.apache.xerces.dom.NodeImpl.getChildNodes()Lorg/w3c/dom/NodeList;」的類加載器(的org/codehaus/groovy/grails/cli/support/GrailsRootLoader實例)當前類,org/apache/xerces/dom/NodeImpl,類裝載器(實例),用於連接org/w3c/dom/Node都在簽名

爲了使事情所使用的類型org/w3c/dom/NodeList不同類的對象更加清楚一點(如果這不是已經是這樣了),你的兩個依賴之間有衝突dencies。由於您似乎使用Grails,我傾向於告訴您,您使用的GroovyWS版本與您當前安裝的Grails不兼容。你有沒有嘗試使用Grails命令行安裝groovyWS?我的意思是,打電話install-dependency?如果不是,我建議你用電話替換你的依賴關係

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

這樣,Grails會使用它自己的兼容性機制。

如果這還不夠,請嘗試在that guide中查看如何排除違規依賴關係。

編輯您也可以按照this blog entry的一些建議。