Hi. Problems with included Sax libraries when running from Intellij.
Groovy script that I run on the command line:
> groovy updateMembersLocal.groovy
Groovy 2.2.1. Intellij 13.0.1
I have setup the script in a module in a project that also contains a grails project. Run config has everything removed (make especially):
Module settings are cut back. Purpose - try to get rid of conflicted Sax library.
I get this Sax error:
/System/Library/Frameworks/JavaVM.framework/Home/bin/java -Dtools.jar=/System/Library/Frameworks/JavaVM.framework/Home/lib/tools.jar -Dgroovy.home=/Users/johnrobens/opt/groovy-2.2.1 -Dgroovy.starter.conf=/Users/johnrobens/opt/groovy-2.2.1/conf/groovy-starter.conf -Didea.launcher.port=7538 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Users/johnrobens/opt/groovy-2.2.1/lib/groovy-2.2.1.jar:.:/Users/johnrobens/NetBeansProjects/civiLink/out/production/CiviWart:/Users/johnrobens/NetBeansProjects/civiLink/CiviWart:/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.groovy.tools.GroovyStarter --conf /Users/johnrobens/opt/groovy-2.2.1/conf/groovy-starter.conf --main groovy.ui.GroovyMain /Users/johnrobens/NetBeansProjects/civiLink/CiviWart/updateMembersLocal.groovy
Caught: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/tools/RootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature
java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getParser()Lorg/xml/sax/Parser;" the class loader (instance of org/codehaus/groovy/tools/RootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/Parser used in the signature
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at org.apache.ivy.util.XMLHelper.newSAXParser(XMLHelper.java:62)
at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:133)
at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:109)
at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:99)
The script does have @Grab in it - and intellij is not recognising HTTPBuilder.
@Grapes([
@Grab(group = 'org.codehaus.groovy.modules.http-builder', module = 'http-builder', version = '0.6'),
@Grab('mysql:mysql-connector-java:5.1.27'),
@GrabConfig(systemClassLoader = true)
])
import au.com.interlated.civiLink.civiWart.UpdateCiviCRM
import au.com.interlated.civiLink.civiWart.UpdateCiviLink
import groovy.sql.Sql
import java.sql.*
//import au.com.interlated.civiLink.sync.ChangeRecordBatch
import groovyx.net.http.HTTPBuilder
import groovy.json.JsonBuilder
import static groovyx.net.http.ContentType.URLENC
import groovyx.net.http.HttpResponseException
import groovy.json.JsonSlurper
new RunCiviSync(args)
class RunCiviSync {
How do I run this script?
Thanks for your help.
John