Running a recently started Grails (1.3.1) application fails on both our linux machines (Bamboo server & laptop) with the exception "Provider for javax.xml.parsers.SAXParserFactory cannot be found". This both using maven or standalone. On our OS X and Windows developments machines using JDK 1.6_020 the problem does not occur.
When using the -Djaxp.debug=1
VM parameter the log shows that no specific SAXParserFactoryImpl
implementation is chosen, and that fallback value com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
is used.
JDK 1.6_020 on the linux machine does indeed contain com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
in one of its .jar files. However running grails fails with javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
Any clues on how to find the exact cause for this problem are welcome.
Thx, Ruben
Environment:
- Grails 1.3.1 (build with Maven or standalone)
- Sun JDK 1.6_020 or Sun JDK 1.6_014
- Ubuntu (recent version)
Partial stack trace from 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)