[ERROR] Two declarations cause a collision in the ObjectFactory class.
[ERROR] (Related to above error) This is the other declaration.
原因主要在于数据的绑定,简单来说在<tagA>下面有<BC>,而<tagAB>下面有<C>
wsimport -Xendorsed -extension -keep -Xnocompile -target 2.1 -b SomeService.xjb "http://HostName/SomeService.wsdl"
SomeService.xjb:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings version="2.1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc">
<jaxb:globalBindings
generateElementClass="false"
mapSimpleTypeDef="false"
generateMixedExtensions="false"
optionalProperty="primitive">
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="http://Hostname/SomeService.xsd" node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="name.own.defined.package" />
</jaxb:schemaBindings>
<jaxb:bindings node=".//xs:complexType[@name='Customer']/xs:sequence/xs:element[@name='Mobile']">
<jaxb:factoryMethod name="MobileNum" />
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
数据绑定JAXB的参考文档:
JAXB Guide - Dealing with errors
没有评论:
发表评论