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

Option -Xcollection-setter-injector does not work #26

Open
istvan-hegedus opened this issue Jul 25, 2023 · 1 comment
Open

Option -Xcollection-setter-injector does not work #26

istvan-hegedus opened this issue Jul 25, 2023 · 1 comment

Comments

@istvan-hegedus
Copy link

istvan-hegedus commented Jul 25, 2023

I tried to configure the wsdl2java plugin with -Xcollection-setter-injector as follows:

wsdl2java {
	options.add("-xjc-Xcollection-setter-injector")
	wsdlDir = layout.projectDirectory
	includesWithOptions = ["src/main/resources/wsdl/service.wsdl" : ["-wsdlLocation", "http://localhost/wsdl/service.wsdl"]
	cxfVersion = "4.0.2"
	useJakarta = true
}

Without the option everything works as expected, but with the option I got the following exception:

...
Caused by: java.lang.NoSuchMethodError: 'com.sun.xml.bind.api.impl.NameConverter com.sun.tools.xjc.model.Model.getNameConverter()'
        at com.sun.tools.xjc.addon.collection_setter_injector.PluginImpl.declareMethod(PluginImpl.java:169)
        at com.sun.tools.xjc.addon.collection_setter_injector.PluginImpl.run(PluginImpl.java:142)
        at com.sun.tools.xjc.model.Model.generateCode(Model.java:262)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:255)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:67)
        at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:445)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:711)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:259)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:156)
        at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:402)
        at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
        at com.github.bjornvester.wsdl2java.Wsdl2JavaWorker.execute(Wsdl2JavaWorker.kt:18)
...

Before migration from javax to jakarta stuff we used net.java.dev.vcc.thirdparty:collection-setter-injector:0.5.0-1. I tried to use org.andromda.thirdparty.jaxb2_commons:collection-setter-injector:1.0, but the result is the same.

Do you have any idea what kind of collection-setter-injector we could use?

Thank you for your help in advance.

@istvan-hegedus
Copy link
Author

I forked the org.andromda.thirdparty.jaxb2_commons:collection-setter-injector:1.0 with a simple modification of import com.sun.xml.bind.api.impl.NameConverter; => import org.glassfish.jaxb.core.api.impl.NameConverter; in the com.sun.tools.xjc.addon.collection_setter_injector.PluginImpl and it started to work.
If you know an already patched artifact, let me know. Thanks!

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

No branches or pull requests

1 participant