Grails hello world,执行bootstraps java链接错误时出错

时间:2012-04-03 10:24:26

标签: java-ee grails

我正在尝试在我的系统上创建一个hello world grails应用程序。我创建了一个全新的grails安装并运行命令grails create-app racetrack但是当我运行我的应用程序时,我收到以下错误:

 ERROR context.GrailsContextLoader  - Error executing bootstraps: java.lang.LinkageError: Class org/w3c/dom/NamedNodeMap violates loader constraints
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.LinkageError: Class org/w3c/dom/NamedNodeMap violates loader constraints
        at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
        at grails.spring.BeanBuilder.beans(BeanBuilder.java:573)
        at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:519)
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
        at grails.web.container.EmbeddableServer$start.call(Unknown Source)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
        at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
        at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
        at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
        at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
        at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
        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.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.LinkageError: Class org/w3c/dom/NamedNodeMap violates loader constraints
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
        at java.lang.Class.getDeclaredMethods(Class.java:1763)
        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.spring.DynamicElementReader.invokeMethod(DynamicElementReader.groovy:121)
        ... 26 more

有谁知道出了什么问题或我能做些什么来解决它?感谢。

1 个答案:

答案 0 :(得分:0)

我的第一个猜测是你的类路径中有一个冲突的jar。尝试删除任何可能与org/w3c/dom/NamedNodeMap相关的罐子(可能是重复的罐子),例如xerces,xml-api,xalan等。

对于hello world应用程序来说,这不应该发生,但是可以使用它来玩......很好!