Natta
Natta

Reputation: 775

Grails application won't run

After installing export plugin i can not run grails application and get this

java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at grails.util.PluginBuildSettings.getPluginInfos(PluginBuildSettings.groovy:123)
at grails.util.PluginBuildSettings.getPluginInfos(PluginBuildSettings.groovy)
at grails.util.PluginBuildSettings$getPluginInfos.callCurrent(Unknown Source)
at grails.util.PluginBuildSettings.getPluginInfo(PluginBuildSettings.groovy:167)
at grails.util.PluginBuildSettings$getPluginInfo.callCurrent(Unknown Source)
at grails.util.PluginBuildSettings.getPluginInfoForSource(PluginBuildSettings.groovy:208)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:302)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:824)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:521)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:497)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:474)
at _GrailsEvents_groovy.run(_GrailsEvents_groovy:54)
at _GrailsEvents_groovy$run.call(Unknown Source)
at _GrailsClean_groovy$run.call(Unknown Source)
at _GrailsClean_groovy.run(_GrailsClean_groovy:29)
at _GrailsClean_groovy$run.call(Unknown Source)
at _GrailsPlugins_groovy$run.call(Unknown Source)
at _GrailsPlugins_groovy.run(_GrailsPlugins_groovy:32)
at _GrailsPlugins_groovy$run.call(Unknown Source)
at _GrailsRun_groovy$run.call(Unknown Source)
at _GrailsRun_groovy.run(_GrailsRun_groovy:31)
at _GrailsRun_groovy$run.call(Unknown Source)
at RunApp.run(RunApp.groovy:25)
at RunApp$run.call(Unknown Source)
at gant.Gant.prepareTargets(Gant.groovy:606)
Error loading event script from file [/home/natalia/.grails/1.3.7/projects/MEM1.1/plugins/tomcat-1.3.7/scripts/_Events.groovy] loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
Error executing script RunApp: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
    at java.lang.Class.getDeclaredMethods(Class.java:1791)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
    at grails.util.PluginBuildSettings.getPluginInfos(PluginBuildSettings.groovy:123)
    at grails.util.PluginBuildSettings.getPluginInfos(PluginBuildSettings.groovy)
    at grails.util.PluginBuildSettings$getPluginInfos.callCurrent(Unknown Source)
    at grails.util.PluginBuildSettings.getPluginInfoForName(PluginBuildSettings.groovy:180)
    at grails.util.PluginBuildSettings$getPluginInfoForName.call(Unknown Source)
    at _PluginDependencies_groovy$_run_closure1.doCall(_PluginDependencies_groovy:66)
    at _PackagePlugins_groovy$_run_closure2.doCall(_PackagePlugins_groovy:69)
    at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:81)
    at RunApp$_run_closure1.doCall(RunApp.groovy:28)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:590)
    at gant.Gelpant.executeTargets(Gant.groovy:589)
Error executing script RunApp: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"

What is wrong? Please help...

Upvotes: 4

Views: 4848

Answers (3)

Lucas
Lucas

Reputation: 617

Adding this in BuildConfig.groovy worked for me:

inherits("global") {
  excludes "xml-apis"
}

Source: http://arrogantprogrammer.blogspot.com.ar/2010/07/grails-linkageerror-for.html

Upvotes: 3

Ganesh Krishnan
Ganesh Krishnan

Reputation: 7395

SaxParseException is loaded by the JVM and I guess the plugin is loading an older version. Just add the excludes parameter to the plugin

Run grails "dependency-report" to find out which jar is causing the problem.

Upvotes: 0

Grooveek
Grooveek

Reputation: 10094

That seems to be the result of a classpath hell...

Two dependencies link the same jar with different versions

Check your dependencies, spot the guilty jar (which seems to be a Sax Parser) and remove this linkage in your BuildConfig.groovy

Cheers

Grooveek

Upvotes: 2

Related Questions