Closed waldeinburg closed 6 months ago
I have the same problem. Thank you for finding out the cause.
I've created an issue https://issues.apache.org/jira/browse/CXF-8580
Do you know if there's a workaround?
I'm using
Here's the basics from my pom.xml
<dependencies>
...
<dependency>
<groupId>org.apache.cxf.xjc-utils</groupId>
<artifactId>cxf-xjc-runtime</artifactId>
<version>${apache-cxf-xjc.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
...
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${apache-cxf-plugin.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<defaultOptions>
<noAddressBinding>true</noAddressBinding>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/schemas/simple-schema.wsdl</wsdl>
<extraargs>
<extraarg>-xjc-Xts</extraarg>
<!-- This arg causes an error -->
<extraarg>-xjc-Xgroup-contract</extraarg>
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-xjc-verbose</extraarg>
<extraarg>-keep</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.codesup.util</groupId>
<artifactId>jaxb2-rich-contract-plugin</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-ts</artifactId>
<version>${apache-cxf-xjc.version}</version>
</dependency>
</dependencies>
</plugin>
Should be looking for an alternative way to determine the output path of generated group interfaces... Maybe try to filer out "null" grammars when scanning the schema tree...
The root cause seems to be than an InputSource passed to an XPathExpression MUST have a valid SystemID pointing to a file or URI where the content is located. The WSDL tool spoils that.
Fixed in 4.0.1-SNAPSHOT
When using group-contracts with Maven cxf-codegen-plugin the build fails with the following
BadCommandLineException
(included below with the first line of the stack trace with-X
Maven option set):The plugin seems to collide with a hack in
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding
:The
CFG_NO_ADDRESS_BINDING
value is null and theCFG_XJC_ARGS
is of course not null because it contains-Xgroup-contract
. This means thatGroupInterfacePlugin::generateDummyGroupUsages
will receive one input source, the dummy "null" value, and then findIncludeMappings will crash.This is a quite puzzling hack. It's not that there's no input schemas; everything builds fine when removing groupt-contract from the plugin list (leaving other arguments to trig the conditional above). Will you implement a workaround or should I report this as a bug to Apache CXF, trying to make them make another workaround for the supposed issue with parseArgument?