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

Classpath URI's fail using CXF XJC Maven Plugin

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In a Maven Java project with a POM like this:

       
      ...
      
      <plugin>
      	<groupId>org.apache.cxf</groupId>
      	<artifactId>cxf-xjc-plugin</artifactId>
      	<version>2.6.2</version>
      	<executions>
      		<execution>
      			<id>generate-sources</id>
      			<phase>generate-sources</phase>
      			<goals>
      				<goal>xsdtojava</goal>
      			</goals>
      			<configuration>
      				<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
      				<xsdOptions>
      					<xsdOption>
      						<xsd>classpath:/path/to/xsd/document.xsd</xsd>
      						<packagename>org.company.package.whatever</packagename>
      					</xsdOption>
      				</xsdOptions>
      			</configuration>
      		</execution>
      	</executions>
      </plugin>
      
      ...
      

      The execution of Maven goal fails with exceptions like this:

      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.MojoExecutionException
      	at org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.execute(AbstractXSDToJavaMojo.java:320)
      	at org.apache.cxf.maven_plugin.XSDToJavaMojo.execute(XSDToJavaMojo.java:42)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 19 more
      Caused by: java.lang.NullPointerException
      	at org.sonatype.plexus.build.incremental.DefaultBuildContext.getMessage(DefaultBuildContext.java:88)
      	at org.sonatype.plexus.build.incremental.DefaultBuildContext.addMessage(DefaultBuildContext.java:110)
      	at org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo$Listener.error(AbstractXSDToJavaMojo.java:149)
      	at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
      	at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
      	at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
      	at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:233)
      	at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:101)
      	at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:357)
      	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:167)
      	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:113)
      	at com.sun.tools.xjc.Driver.run(Driver.java:313)
      	at org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.execute(AbstractXSDToJavaMojo.java:307)
      	... 22 more
      

      The problem is not produced if classpath: URI's are not used.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                logoff Julio Carlos Barrera
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: