Introduction
Hi, I had a project that was working perfectly.
I am using apache cxf
and the generated client code was working perfectly.
However, since yesterday I downloaded new versions of the WSDL and XSD and it seems to be failing.
Configuration
My plugin pom.xml entry is the following:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.3</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>
${basedir}/src/interface.wsdl
</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Stacktrace
And the error I am getting is the following:
javax.xml.bind.JAXBException: trans is not a valid property on class org.test.GetCons
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:934) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.glassfish.JAXBRIContextWrapper.getElementPropertyAccessor(JAXBRIContextWrapper.java:106) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.sei.BodyBuilder$DocLit.<init>(BodyBuilder.java:227) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.sei.StubHandler.<init>(StubHandler.java:117) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.DatabindingImpl.initStubHandlers(DatabindingImpl.java:145) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:90) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404) ~[na:1.8.0_60]
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386) ~[na:1.8.0_60]
at javax.xml.ws.Service.getPort(Service.java:119) ~[na:1.8.0_60]
Questions
- How do I debug this?
- Is it due to some inconsistency in the new wsdl and xml files?
- The code was working fine previously.
I cannot upload the wsdl and xsd files as they are confidential.
Update
I noticed that one change has been the following:
The working definition created a java comment like:
* <element name="trans" type="{http://server/}trans" minOccurs="0"/>
And now the broken one does the following:
* <element name="trans" type="{http://server/}trans" minOccurs="0" form="qualified"/>