I decided to convert one of my servicemix services over to cxf which was
working great on xfire.  I added the cxf wsdl2java plugin for maven like
this:

<plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>${cxf-version}</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-bindings-soap</artifactId>
            <version>${cxf-version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <configuration>
              <sourceRoot>${project.build.directory
}/generated-sources/jaxws</sourceRoot>
              <wsdlOptions>
                <wsdlOption>

<wsdl>${basedir}/src/main/resources/CommunicationService.wsdl</wsdl>
                  <extraargs>
                    <extraarg>-verbose</extraarg>
                  </extraargs>
                </wsdlOption>
              </wsdlOptions>
            </configuration>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

and got this exception:

WSDLToJava Error : java.lang.NullPointerException

org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(
WSDLToJavaContainer.java:242)
        at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(
ToolRunner.java:83)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171)
        at org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(
WSDL2JavaMojo.java:186)
        at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(
WSDL2JavaMojo.java:102)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:443)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:480
)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java
:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
        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:585)
        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: java.lang.NullPointerException
        at org.apache.cxf.tools.util.SOAPBindingUtil.getSoapHeaders(
SOAPBindingUtil.java:199)
        at org.apache.cxf.binding.soap.SoapBindingFactory.initializeMessage(
SoapBindingFactory.java:507)
        at
org.apache.cxf.binding.soap.SoapBindingFactory.initializeBindingOperation(
SoapBindingFactory.java:493)
        at org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(
SoapBindingFactory.java:468)
        at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildBinding(
WSDLServiceBuilder.java:490)
        at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(
WSDLServiceBuilder.java:264)
        at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(
WSDLServiceBuilder.java:154)
        at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(
WSDLServiceBuilder.java:143)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(
WSDLToJavaContainer.java:161)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(
WSDLToJavaContainer.java:234)
        ... 23 more

I decided since coincidentally, CXF is failing on header code again (and
since my service doesn't actually have any), I thought I would take out the
dependency cxf-rt-bindings-soap which I had put in the plugin.  When I did,
this error went away.

Does the plugin  somehow detect a class in that jar can cause it to go
haywire?  I would think it shouldn't matter if I include that dependency or
not?

Reply via email to