关于linux问题的Grails:无法找到SAXParserFactory的提供程序

时间:2010-06-22 15:40:31

标签: java linux grails

在我们的linux机器(Bamboo服务器和笔记本电脑)上运行最近启动的Grails(1.3.1)应用程序失败,但“找不到javax.xml.parsers.SAXParserFactory的提供程序”。这都使用maven或独立。在使用JDK 1.6_020的OS X和Windows开发机器上,问题不会发生。

使用-Djaxp.debug=1 VM参数时,日志显示未选择任何特定的SAXParserFactoryImpl实施,并使用该回退值com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

Linux机器上的JDK 1.6_020确实在其中一个.jar文件中包含com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl。但是,运行的grails会因javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found

而失败

欢迎任何有关如何找到此问题的确切原因的线索。

THX, 鲁

环境:

  • Grails 1.3.1(使用Maven或独立构建)
  • Sun JDK 1.6_020或Sun JDK 1.6_014
  • Ubuntu(最新版本)

来自Bamboo的部分堆栈跟踪:

    Embedded error: java.lang.reflect.InvocationTargetException
Provider for javax.xml.parsers.SAXParserFactory cannot be found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to start Grails
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to start Grails
    at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:285)
    at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:194)
    at org.grails.maven.plugin.MvnCompileMojo.execute(MvnCompileMojo.java:41)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:119)
    at org.grails.maven.plugin.AbstractGrailsMojo.runGrails(AbstractGrailsMojo.java:277)
    ... 21 more
Caused by: java.lang.reflect.InvocationTargetException
    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.GrailsBuildHelper.execute(GrailsBuildHelper.java:113)
    ... 22 more
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
    at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
    at groovy.xml.FactorySupport$2.run(FactorySupport.java:56)
    at java.security.AccessController.doPrivileged(Native Method)
    at groovy.xml.FactorySupport.createFactory(FactorySupport.java:33)
    at groovy.xml.FactorySupport.createSaxParserFactory(FactorySupport.java:54)
    at groovy.util.XmlSlurper.<init>(XmlSlurper.java:97)
    at groovy.util.XmlSlurper.<init>(XmlSlurper.java:93)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

0 个答案:

没有答案