Grails应用程序将无法运行

时间:2011-05-11 14:28:33

标签: grails

安装导出插件后,我无法运行grails应用程序并获取此

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"

有什么问题?请帮忙......

3 个答案:

答案 0 :(得分:2)

这似乎是类路径地狱的结果......

两个依赖项将同一个jar链接到不同的版本

检查您的依赖项,找到有罪的jar(似乎是Sax Parser)并在BuildConfig.groovy中删除此链接

干杯

Grooveek

答案 1 :(得分:2)

在BuildConfig.groovy中添加它对我有用:

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

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

答案 2 :(得分:0)

SaxParseException由JVM加载,我猜这个插件正在加载旧版本。 只需将excludes参数添加到插件

即可

运行grails“dependency-report”以找出导致问题的jar。