我的问题是我发出的每个grails命令,即使只是grails help
,也会产生javax.xml.parsers.FactoryConfigurationError
。我想使用JVM系统属性 - Djaxp.debug=1
(记录为here)来解决SAXParserFactoryImpl
的查找方式。但是,如此添加指令:grails -Djaxp.debug=1 help
不会产生额外的调试信息。
从grails命令行获取jaxp调试语句是否需要额外的步骤?有没有其他方法可以发现我收到此错误的原因?
以下是我收到的错误的完整堆栈跟踪:
Error executing script War: Provider for javax.xml.parsers.SAXParserFactory cannot be found
javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
at org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:150)
at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:412)
at org.apache.ivy.core.settings.IvySettings.loadDefault(IvySettings.java:440)
at org.apache.ivy.Ivy.configureDefault(Ivy.java:433)
at org.apache.ivy.core.IvyContext.getDefaultIvy(IvyContext.java:201)
at org.apache.ivy.core.IvyContext.getIvy(IvyContext.java:179)
at org.apache.ivy.core.IvyContext.getSettings(IvyContext.java:215)
at org.apache.ivy.core.module.status.StatusManager.getCurrent(StatusManager.java:42)
at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.<init>(DefaultModuleDescriptor.java:198)
at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.newDefaultInstance(DefaultModuleDescriptor.java:103)
at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.newDefaultInstance(DefaultModuleDescriptor.java:63)
at org.codehaus.groovy.grails.resolve.AbstractIvyDependencyManager.createModuleDescriptor(AbstractIvyDependencyManager.java:249)
at org.codehaus.groovy.grails.resolve.AbstractIvyDependencyManager$createModuleDescriptor.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
at org.codehaus.groovy.grails.resolve.IvyDependencyManager.parseDependencies(IvyDependencyManager.groovy:602)
at org.codehaus.groovy.grails.resolve.DependencyDefinitionParser$parseDependencies.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:776)
at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:682)
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.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:671)
at grails.util.BuildSettings$loadConfig$0.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:653)
at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:630)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:284)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:135)
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.GrailsStarter.rootLoader(GrailsStarter.java:234)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
Error executing script War: Provider for javax.xml.parsers.SAXParserFactory cannot be found
谢谢。
答案 0 :(得分:3)
几个月前我遇到了同样的问题。 事实证明,我的应用程序中有另一个SAXParser *库。对我来说,它是一个较新的GPars库。所以我删除它,它再次工作。 我真的不知道,如果有可能同时使用这两种实现......