Uploaded image for project: 'WildFly Maven Plugin'
  1. WildFly Maven Plugin
  2. WFMP-48

SAX2 driver class org.apache.xerces.parsers.SAXParser not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • Maven Plugin
    • None
    • Hide

      Try to add rat-plugin and exclude everything */.* as a workaround that you do not have ASF license in headers.

      <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <executions>
              <execution>
                  <id>rat-check</id>
                  <goals>
                      <goal>check</goal>
                  </goals>
                  <configuration>
                      <excludes combine.children="append">
                          <exclude>**/README.md</exclude>
                          <exclude>.git/**/*</exclude>
                          <exclude>**/.idea</exclude>
                          <exclude>**/.svn/**/*</exclude>
                          <exclude>src/test/resources/**/*</exclude>
                          <exclude>**/*.jj</exclude>
                          <exclude>src/test/resources/**/*.css</exclude>
                          <exclude>**/*.iml</exclude>
                          <exclude>**/*.ipr</exclude>
                          <exclude>**/*.iws</exclude>
                          <exclude>**/*.tag</exclude>
                          <exclude>**/*.releaseBackup</exclude>
                          <exclude>**/*.versionsBackup</exclude>
                          <exclude>**/*.next</exclude>
                          <exclude>**/release.properties</exclude>
                          <exclude>**/dependency-reduced-pom.xml</exclude>
                          <exclude>**/buildNumber.properties</exclude>
                          <exclude>.mvn/timing.properties</exclude>
                          <exclude>.gitignore</exclude>
                          <exclude>**/META-INF/services/*</exclude>
                      </excludes>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      
      Show
      Try to add rat-plugin and exclude everything * / .* as a workaround that you do not have ASF license in headers. <plugin> <groupId> org.apache.rat </groupId> <artifactId> apache-rat-plugin </artifactId> <executions> <execution> <id> rat-check </id> <goals> <goal> check </goal> </goals> <configuration> <excludes combine.children= "append" > <exclude> **/README.md </exclude> <exclude> .git/**/* </exclude> <exclude> **/.idea </exclude> <exclude> **/.svn/**/* </exclude> <exclude> src/test/resources/**/* </exclude> <exclude> **/*.jj </exclude> <exclude> src/test/resources/**/*.css </exclude> <exclude> **/*.iml </exclude> <exclude> **/*.ipr </exclude> <exclude> **/*.iws </exclude> <exclude> **/*.tag </exclude> <exclude> **/*.releaseBackup </exclude> <exclude> **/*.versionsBackup </exclude> <exclude> **/*.next </exclude> <exclude> **/release.properties </exclude> <exclude> **/dependency-reduced-pom.xml </exclude> <exclude> **/buildNumber.properties </exclude> <exclude> .mvn/timing.properties </exclude> <exclude> .gitignore </exclude> <exclude> **/META-INF/services/* </exclude> </excludes> </configuration> </execution> </executions> </plugin>

      Cloned from https://github.com/wildfly/wildfly-maven-plugin/issues/105

      This goal fails org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha8:execute-commands
      because of java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

      This did not happen in Version 1.0.2.

      As soon as I remove apache-rat-plugin the issue disappears. The problem is that this plugin checks the license and must be available.

      What refactoring change in source code could cause this error in Alpha version?

      If I keep the rat-plugin and use Xerces dependency and set a system property, then everything is okay but it is again wrong if I use Maven property instead of system property.
      -Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser

      <dependency>
          <groupId>com.sun.org.apache</groupId>
          <artifactId>jaxp-ri</artifactId>
          <version>1.4</version>
      </dependency>
      

      This is full stack trace

      Caused by: java.lang.ExceptionInInitializerError
      	at __redirected.__JAXPRedirected.initAll(__JAXPRedirected.java:81)
      	at org.wildfly.plugin.cli.ModuleEnvironment.initJaxp(ModuleEnvironment.java:69)
      	at org.wildfly.plugin.cli.CommandExecutor.executeCommands(CommandExecutor.java:99)
      	at org.wildfly.plugin.cli.CommandExecutor.execute(CommandExecutor.java:73)
      	at org.wildfly.plugin.cli.CommandExecutor.execute(CommandExecutor.java:92)
      	at org.wildfly.plugin.cli.ExecuteCommandsMojo.execute(ExecuteCommandsMojo.java:91)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
      	... 26 more
      Caused by: java.lang.RuntimeException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
      	at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
      	at __redirected.__XMLReaderFactory.<clinit>(__XMLReaderFactory.java:66)
      	... 33 more
      Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
      	at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
      	... 35 more
      

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: