我需要修改xsd中的元素,遗憾的是该元素是java.lang.Object类型。
我尝试使用以下代码段进行绑定。
<jxb:bindings>
<jxb:globalBindings>
<jxb:javaType name="java.lang.String" xmlType="xsd:anyType"/>
</jxb:globalBindings>
</jxb:bindings>
但我收到以下错误
at org.apache.cxf.tools.common.ToolErrorListener.throwToolException(ToolErrorListener.java:87)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:166)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
**Caused by: com.sun.istack.SAXParseException2: undefined simple type "{http://www.w3.org/2001/XMLSchema}anyType".**
at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:82)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.dispatchGlobalConversions(BIGlobalBinding.java:429)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.promoteGlobalBindings(BGMBuilder.java:257)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.<init>(BGMBuilder.java:174)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:114)
at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:415)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:245)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:462)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:714)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:270)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
任何人都可以建议我解决这个问题。