Uploaded image for project: 'CXF XJC Utils'
  1. CXF XJC Utils
  2. CXFXJC-29

ClassNotFoundException: XSDToJavaRunner

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Not A Bug
    • 3.2.2
    • None
    • Maven Plugin
    • None

    Description

      I'm trying to set up a simple project that should generate xsdtojava using cxf-xjc-plugin. The project also uses spring-boot.

      Result during mvn package:

      [INFO] Building jar: /tmp/cxf-xjc-plugin3386923426289303800.jar
      [DEBUG] Error: Could not find or load main class org.apache.cxf.maven_plugin.XSDToJavaRunner
      [DEBUG] Caused by: java.lang.ClassNotFoundException: org.apache.cxf.maven_plugin.XSDToJavaRunner
      

      This is strange, because on classpath I can clearly see the XSDToJavaRunner.class.

      My java project dir is: javaExecutable = /usr/lib/jvm/java-11-openjdk-amd64/bin/java, and

      java -version shows: OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)

      I tried throwing the cxf-xjc-plugin, several jaxb-* libraries into <dependency> maven node as follows, but the error remains the same. What am I missing here?

          <?xml version="1.0" encoding="UTF-8"?>
          <project xmlns="http://maven.apache.org/POM/4.0.0"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
              <modelVersion>4.0.0</modelVersion>
          
              <groupId>com.test</groupId>
              <artifactId>cxfxjc-test</artifactId>
              <version>1.0.0</version>
          
              <parent>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-starter-parent</artifactId>
                 <version>2.1.0.RELEASE</version>
              </parent>
          
              <dependencies>
                  <dependency>
                      <groupId>javax.xml.bind</groupId>
                      <artifactId>jaxb-api</artifactId>
                      <version>2.2.11</version>
                  </dependency>
                  <dependency>
                      <groupId>com.sun.xml.bind</groupId>
                      <artifactId>jaxb-core</artifactId>
                      <version>2.2.11</version>
                  </dependency>
                  <dependency>
                      <groupId>com.sun.xml.bind</groupId>
                      <artifactId>jaxb-impl</artifactId>
                      <version>2.2.11</version>
                  </dependency>
          
                  <dependency>
                      <groupId>org.apache.cxf</groupId>
                      <artifactId>cxf-core</artifactId>
                      <version>3.2.6</version>
                  </dependency>
          
                  <dependency>
                      <groupId>org.apache.cxf</groupId>
                      <artifactId>cxf-xjc-plugin</artifactId>
                      <version>3.2.2</version>
                  </dependency>
      
                  <dependency>
                        <groupId>org.glassfish.jaxb</groupId> 
                        <artifactId>jaxb-runtime</artifactId>
                  </dependency>
              </dependencies>
          
              <build>
                  <plugins>
                      <plugin>
                          <groupId>org.apache.cxf</groupId>
                          <artifactId>cxf-xjc-plugin</artifactId>
                          <version>3.2.2</version>
                          <executions>
                              <execution>
                                  <id>generate-sources</id>
                                  <phase>generate-sources</phase>
                                  <goals>
                                      <goal>xsdtojava</goal>
                                  </goals>
                                  <configuration>
                                      <xsdOptions>
                                          <xsdOption>
                                              <xsd>src/main/resources/test.xsd</xsd>
                                          </xsdOption>
                                      </xsdOptions>
                                  </configuration>
                              </execution>
                          </executions>
          
                          <dependencies>
                              <dependency>
                                  <groupId>org.apache.cxf</groupId>
                                  <artifactId>cxf-xjc-plugin</artifactId>
                                  <version>3.2.2</version>
                              </dependency>
                          </dependencies>
                      </plugin>
                  </plugins>
              </build>
          </project>
      

      Attachments

        1. CXFXJC-29.tar
          9 kB
          Freeman Yue Fang

        Activity

          People

            ffang Freeman Yue Fang
            membersound member sound
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: