Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jaxws-maven-plugin 3.0.0 incompatible with jaxb2-basics #279

Open
RomainPruvostMHH opened this issue Sep 21, 2021 · 2 comments · May be fixed by #678
Open

jaxws-maven-plugin 3.0.0 incompatible with jaxb2-basics #279

RomainPruvostMHH opened this issue Sep 21, 2021 · 2 comments · May be fixed by #678

Comments

@RomainPruvostMHH
Copy link

Hi,

In your example here https://eclipse-ee4j.github.io/metro-jax-ws/jaxws-maven-plugin/examples/using-jaxb-plugins.html, you suggest to use the library org.jvnet.jaxb2_commons:jaxb2-basics to enable xjc-plugins.
But it doesn't work because jaxb2-basics is using the ol Jaxb implementation (javax.xml.bind.*).
I tested your example and I got this error :

[INFO] --- jaxws-maven-plugin:3.0.0:wsimport (default) @ client ---
[INFO] Processing: file:/C:/client-ws-soap/src/main/resources/wsdl/sample.wsdl
[INFO] jaxws:wsimport args: [-keep, -s, 'C:\client-ws-soap\target\generated-sources\wsimport', -d, 'C:\client-ws-soap\target\classes', -encoding, UTF-8, -Xnocompile, -p, com.client, -wsdllocation, /wsdl/sample.wsdl, -B-XtoString, -b, 'C:\client-ws-soap\src\main\resources\binding\binding-score-decision.xml', "file:/C:/client-ws-soap/src/main/resources/wsdl/sample.wsdl"]
analyse du 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.jvnet.jax_ws_commons.jaxws.Invoker.main(Invoker.java:74)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at org.jvnet.jaxb2_commons.plugin.inheritance.InheritancePlugin.getCustomizationElementNames(InheritancePlugin.java:40)
	at org.jvnet.jaxb2_commons.plugin.AbstractPlugin.getCustomizationURIs(AbstractPlugin.java:98)
	at com.sun.tools.xjc.reader.AbstractExtensionBindingChecker.<init>(AbstractExtensionBindingChecker.java:71)
	at com.sun.tools.xjc.reader.ExtensionBindingChecker.<init>(ExtensionBindingChecker.java:51)
	at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:205)
	at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:351)
	at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:98)
	at com.sun.xml.xsom.impl.parser.ParserContext.<init>(ParserContext.java:74)
	at com.sun.xml.xsom.parser.XSOMParser.<init>(XSOMParser.java:83)
	at com.sun.tools.xjc.ModelLoader.createXSOMParser(ModelLoader.java:378)
	at com.sun.tools.xjc.ModelLoader.createXSOMParser(ModelLoader.java:386)
	at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:468)
	at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:239)
	at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:65)
	at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:112)
	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
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

Did you know a solution to generate the toString method without the library org.jvnet.jaxb2_commons:jaxb2-basics ?

kind regards,
Romain

@baromojm
Copy link

Hi: I'm now facing the same issue. Did you ever find a solution? Thanks,

@laurentschoelens
Copy link

laurentschoelens commented Jan 4, 2024

Hello, by searching some info about the jaxws-maven-plugin, found this issue.
You can now use the latest version of jaxb2-basics which is now part of the jaxb-tools repository (former repository of only the maven-jaxb2-plugin)

You can follow the migration guide on how to get the latest version and new groupId/artifactId associated with former versions.

Feel free to contact us if needed 😉

laurentschoelens added a commit to laurentschoelens/metro-jax-ws that referenced this issue Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants