Closed golden-mango closed 6 months ago
Version of the plugin 1.18
Hi, have you tried using a later version of the plugin? It is quite difficult to debug earlier versions...
I'm receiving this error too.
[INFO] --- jaxws-maven-plugin:2.6:wsimport (simple-schema) @ my-project ---
[INFO] Processing: file:/Users/username/projects/myproject/src/main/resources/schemas/simple-schema.wsdl
[INFO] jaxws:wsimport args: [
-keep,
-s,
'/Users/username/projects/myproject/target/generated-sources/wsimport',
-d,
'/Users/username/projects/myproject/target/classes',
-verbose,
-encoding,
UTF-8,
-extension,
-Xnocompile,
-B-Xgroup-contract,
-verbose,
"file:/Users/username/projects/myproject/src/main/resources/schemas/simple-schema.wsdl"
]
parsing WSDL...
[ERROR] Interface ErrorResponse, defined by group declaration {http://www.example.com/schemas/gggg}errorResponse has no implementation.
line 25 of file:/Users/username/projects/myproject/src/main/resources/schemas/simple-schema.wsdl
[ERROR] No interface found for model group errorResponse converted name was ErrorResponse
line 25 of file:/Users/username/projects/myproject/src/main/resources/schemas/simple-schema.wsdl
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.mojo.jaxws.Invoker.main(Invoker.java:80)
Caused by: com.sun.tools.ws.wscompile.AbortException
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:114)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2268)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:168)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:111)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:414)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:175)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:153)
... 5 more
Plugin definition:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<extension>true</extension>
<!-- <xdebug>true</xdebug>-->
<verbose>true</verbose>
<keep>true</keep>
<detail>true</detail>
</configuration>
<executions>
<execution>
<id>simple-schema</id>
<goals>
<goal>wsimport</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/resources/schemas/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>simple-schema.wsdl</wsdlFile>
</wsdlFiles>
<args>
<xjcArg>-B-Xgroup-contract</xjcArg>
<!-- add verbose workaround https://github.com/mklemm/jaxb2-rich-contract-plugin/issues/47 -->
<arg>-verbose</arg>
</args>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.codesup.util</groupId>
<artifactId>jaxb2-rich-contract-plugin</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
</plugin>
I'm using an external wsdl file, and it's huge and ancient, so it might not be defined correctly? Here's a stripped down version that reproduces the issue:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.com/schemas/gggg"
targetNamespace="http://www.example.com/schemas/gggg">
<wsdl:types>
<xs:schema
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:matrix="http://www.example.com/schemas/gggg"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.example.com/schemas/gggg"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="2.1">
<xs:annotation>
<xs:appinfo>
<jaxb:globalBindings generateIsSetMethod="true">
<xjc:serializable uid="1"/>
</jaxb:globalBindings>
</xs:appinfo>
</xs:annotation>
<xs:group name="errorResponse">
<xs:sequence>
<xs:element name="error" type="matrix:errorType"/>
</xs:sequence>
</xs:group>
<xs:element name="orderResponse" type="matrix:orderSaveResponseType"/>
<xs:complexType name="orderSaveResponseType">
<xs:choice>
<xs:group ref="matrix:errorResponse"/>
<xs:element name="succes" type="xs:string"/>
</xs:choice>
</xs:complexType>
<xs:element name="orderRequest">
<xs:complexType>
<xs:complexContent>
<xs:extension base="matrix:baseElement">
<xs:sequence>
<xs:element name="hash" type="xs:string"/>
<xs:element minOccurs="0" name="targetWebshop" type="xs:long"/>
<xs:element name="orderReference" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="errorType">
<xs:sequence>
<xs:element name="code" type="xs:int"/>
<xs:element name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType abstract="true" name="baseElement">
<xs:sequence>
<xs:element name="externalId" type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="orderResponse">
<wsdl:part element="tns:orderResponse" name="orderResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="orderRequest">
<wsdl:part element="tns:orderRequest" name="orderRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Order">
<wsdl:operation name="order">
<wsdl:input message="tns:orderRequest" name="orderRequest">
</wsdl:input>
<wsdl:output message="tns:orderResponse" name="orderResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OrderSoap11" type="tns:Order">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="order">
<soap:operation soapAction=""/>
<wsdl:input name="orderRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="orderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OrderService">
<wsdl:port binding="tns:OrderSoap11" name="OrderSoap11">
<soap:address location="https://zys.asd.com:443/llll/services"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Here's the output of mvn clean compile -X -e
```mvn clean compile -X -e
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /usr/local/Cellar/maven/3.8.1/libexec
Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.annotation.* < plexus.core
[DEBUG] Imported: javax.annotation.security.* < plexus.core
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
[DEBUG] Imported: javax.inject.* < plexus.core
[DEBUG] Imported: org.apache.maven.* < plexus.core
[DEBUG] Imported: org.apache.maven.artifact < plexus.core
[DEBUG] Imported: org.apache.maven.classrealm < plexus.core
[DEBUG] Imported: org.apache.maven.cli < plexus.core
[DEBUG] Imported: org.apache.maven.configuration < plexus.core
[DEBUG] Imported: org.apache.maven.exception < plexus.core
[DEBUG] Imported: org.apache.maven.execution < plexus.core
[DEBUG] Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG] Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG] Imported: org.apache.maven.model < plexus.core
[DEBUG] Imported: org.apache.maven.monitor < plexus.core
[DEBUG] Imported: org.apache.maven.plugin < plexus.core
[DEBUG] Imported: org.apache.maven.profiles < plexus.core
[DEBUG] Imported: org.apache.maven.project < plexus.core
[DEBUG] Imported: org.apache.maven.reporting < plexus.core
[DEBUG] Imported: org.apache.maven.repository < plexus.core
[DEBUG] Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG] Imported: org.apache.maven.settings < plexus.core
[DEBUG] Imported: org.apache.maven.toolchain < plexus.core
[DEBUG] Imported: org.apache.maven.usability < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG] Imported: org.codehaus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.* < plexus.core
[DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.component < plexus.core
[DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG] Imported: org.codehaus.plexus.container < plexus.core
[DEBUG] Imported: org.codehaus.plexus.context < plexus.core
[DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG] Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG] Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG] Imported: org.eclipse.aether.* < plexus.core
[DEBUG] Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG] Imported: org.eclipse.aether.collection < plexus.core
[DEBUG] Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG] Imported: org.eclipse.aether.graph < plexus.core
[DEBUG] Imported: org.eclipse.aether.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.installation < plexus.core
[DEBUG] Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG] Imported: org.eclipse.aether.repository < plexus.core
[DEBUG] Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG] Imported: org.eclipse.aether.spi < plexus.core
[DEBUG] Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG] Imported: org.eclipse.aether.version < plexus.core
[DEBUG] Imported: org.fusesource.jansi.* < plexus.core
[DEBUG] Imported: org.slf4j.* < plexus.core
[DEBUG] Imported: org.slf4j.event.* < plexus.core
[DEBUG] Imported: org.slf4j.helpers.* < plexus.core
[DEBUG] Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.8.1/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/username/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.8.1/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/username/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/username/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/username/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.project:my-project:jar:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-starter-parent:pom:2.5.3: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-dependencies:pom:2.5.3: (none)
[DEBUG] Looking up lifecycle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.project:my-project:jar:1.0-SNAPSHOT
[DEBUG] Tasks: [clean, compile]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ----------< com.project:my-project >----------
[INFO] Building my-project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for ossrh-snapshots (http://oss.sonatype.org/content/repositories/snapshots).
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project: com.project:my-project:1.0-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile, runtime]
[DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins) : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean)
[DEBUG] Style: Regular
[DEBUG] Configuration:
edit1: fix xjc arg (related to https://github.com/mklemm/jaxb2-rich-contract-plugin/issues/47), update log output after re-running command edit2: add non-verbose log of error, fix for #47 edit3: add mvn version
Ah, I think the cause is described in https://github.com/mklemm/jaxb2-rich-contract-plugin/issues/59
group-interface-plugin is a bit tricky currently because it assumes that all the relevant schema files have been encountered on the command line before the plugin is activated, i.e. no matter how you launch XJC, the "-Xgroup-interface" option must appear AFTER the name of the schema file(s) in the argument list. I'm currently trying to fix this, but it isn't so easy because XJCs plugin interface only provides 2 activation lifecycle callbacks, which are both not exactly suitable for what I have to do at plugin startup. I you have the chance, try rearranging command line option for XJC so that -Xgroup-interface is last.
Release 4.2.0, which should fix many of the issues with group-contract-plugin, including this one, will be released later this week.
Fixed in 4.1.1
Hi, I was wondering what is needed in an xsd file to generate an interface with an implementation. In the documentation for generating an interface with an attributeGroup, the example given is:
However, when I try to generate an interface with: