title: How to consume grails REST web service in grails web application?
body: <p>I have successfully created grails REST web service. It is working and returning data in XML format(http://localhost:9001/GISServerRESTfulService/layout/show). But when I try to access this service in another grails web application even after adding HTTPBuilder-0.5.3 jar files it is not running. It is giving following dependency resolving error: </p>
  
  <pre><code>Base Directory: C:\Pojects\Java Projects\GrailsRESTfulClient
  Resolving dependencies...
  Dependencies resolved in 703ms.
  Running script C:\grails\scripts\RunApp.groovy
  Error executing script RunApp: 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 &lt;bootloader&gt;) 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 &lt;bootloader&gt;) 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 org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:767)
          at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:866)
          at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:773)
          at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
          at org.apache.log4j.LogManager.&lt;clinit&gt;(LogManager.java:127)
          at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
          at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
          at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
          at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
          at org.springframework.core.io.support.PathMatchingResourcePatternResolver.&lt;clinit&gt;(PathMatchingResourcePatternResolver.java:169)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:169)
          at grails.util.PluginBuildSettings.class$(PluginBuildSettings.groovy)
          at grails.util.PluginBuildSettings.$get$$class$org$springframework$core$io$support$PathMatchingResourcePatternResolver(PluginBuildSettings.groovy)
          at grails.util.PluginBuildSettings.&lt;clinit&gt;(PluginBuildSettings.groovy:62)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:169)
          at _GrailsSettings_groovy.class$(_GrailsSettings_groovy)
          at _GrailsSettings_groovy.$get$$class$grails$util$PluginBuildSettings(_GrailsSettings_groovy)
          at _GrailsSettings_groovy.run(_GrailsSettings_groovy:78)
          at _GrailsSettings_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at _GrailsClasspath_groovy$run.call(Unknown Source)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at _GrailsClasspath_groovy.run(_GrailsClasspath_groovy:33)
          at _GrailsClasspath_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at _GrailsEvents_groovy$run.call(Unknown Source)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at _GrailsEvents_groovy.run(_GrailsEvents_groovy:31)
          at _GrailsEvents_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at _GrailsClean_groovy$run.call(Unknown Source)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at _GrailsClean_groovy.run(_GrailsClean_groovy:29)
          at _GrailsClean_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at _GrailsPlugins_groovy$run.call(Unknown Source)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at _GrailsPlugins_groovy.run(_GrailsPlugins_groovy:32)
          at _GrailsPlugins_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at _GrailsRun_groovy$run.call(Unknown Source)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at _GrailsRun_groovy.run(_GrailsRun_groovy:31)
          at _GrailsRun_groovy$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
          at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
          at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at RunApp.run(RunApp.groovy:25)
          at RunApp$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
          at gant.Gant.prepareTargets(Gant.groovy:606)
          at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeWithGantInstance(GrailsScriptRunner.java:663)
          at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:526)
          at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:310)
          at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:135)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
          at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
  Error executing script RunApp: 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 &lt;bootloader&gt;) for interface org/w3c/dom/Node have different Class objects for the type org/w3c/dom/NodeList used in the signature
  </code></pre>
  
  <p>I am very new to grails and groovy. Anyone having idea how to solve it ?</p>
  
  <p>Thanks in advance.</p>