2017-06-05 1 views
1

Ich habe eine Reihe von XSD-Dateien und ich habe sie zu meinem Projekt hinzugefügt, um Klassen von ihnen mit JAXB zu generieren. Ich benutze JDeveloper 11, JDK 1.6 und JAXB 2.0. Eine XSD-Datei importiert andere XSD-Dateien, so dass ich das Inhaltsmodell der Hauptdatei erzeuge, jedoch bekomme ich diesen Fehler An error was encountered while migrating JAXB. Property "Any" is already defined. Use <jaxb:property> to resolve this conflict.Generieren von JAXB-Klassen aus XSD Problem

Der Rest der Datei kann Typen desselben Namens enthalten.

Ich habe auch versucht, alle xs:any Elemente in der Wahl zu kommentieren und nur eine, auch die entsprechenden Importe auskommentieren, und war in der Lage, die Jaxb-Klassen zu generieren. Aber wenn ich noch eins hinzufüge, dann bekomme ich den Fehler.

Ich habe das gleiche mit JDeveloper 12c und Eclipse versucht, aber das gleiche passiert ist.

Was könnte das Problem hier sein, ich habe auch versucht, das Problem nachschlagen, aber nichts gefunden, was für mich arbeiten könnte.

Im Folgenden finden Sie die wichtigsten XSD-Datei

<?xml version="1.0" encoding="UTF-8"?> 
<!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Legal Notices 

SWIFT [email protected] All rights reserved. 

This schema is a component of MyStandards, the SWIFT collaborative Web application used to manage 
standards definitions and industry usage. 

This is a licensed product, which may only be used and distributed in accordance with MyStandards License 
Terms as specified in MyStandards Service Description and the related Terms of Use. 

Unless otherwise agreed in writing with SWIFT SCRL, the user has no right to: 
- authorise external end users to use this component for other purposes than their internal use. 
- remove, alter, cover, obfuscate or cancel from view any copyright or other proprietary rights notices appearing in this physical medium. 
- re-sell or authorise another party e.g. software and service providers, to re-sell this component. 

This component is provided 'AS IS'. SWIFT does not give and excludes any express or implied warranties 
with respect to this component such as but not limited to any guarantee as to its quality, supply or availability. 

Any and all rights, including title, ownership rights, copyright, trademark, patents, and any other intellectual 
property rights of whatever nature in this component will remain the exclusive property of SWIFT or its 
licensors. 

Trademarks 
SWIFT is the trade name of S.W.I.F.T. SCRL. 
The following are registered trademarks of SWIFT: the SWIFT logo, SWIFT, SWIFTNet, SWIFTReady, Accord, Sibos, 3SKey, Innotribe, the Standards Forum logo, MyStandards, and SWIFT Institute. 
Other product, service, or company names in this publication are trade names, trademarks, or registered trademarks of their respective owners. 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Group: T2S 
Collection: T2S_UDFS_2.1_head.002 
Usage Guideline: head.002.001.01_T2S 
Base Message: DRAFT2head.002.001.01 
Date of publication: 01 October 2015 
URL: https://www2.swift.com/mystandards/standardsPractices/mpDescription.xhtml?marketpractice=mp/mx/_LIiBQGg_EeWfEYThn8bcRQ/_LIiBQWg_EeWfEYThn8bcRQ 
Generated by the MyStandards web platform [http://www.swift.com/mystandards] on 2015-11-09T09:46:56+00:00 
T2S notices : null 
--> 
<!-- 
Being not available on MyStandards, this XSD file of "head.002.001.01" message has been remade based 
on the "head.002.001.01" PDF description and the "DRAFT2head.002.001.01" XSD file produced and used 
by T2S 
The XSD file for "ISO20022+" id based and the remade "head.002.001.01" : 
- encapsulation of the signature in a "Sgntr" tag 
- encapsulation of the payload in a "Any" tag 
- restriction of the payload namespaces to ISO20022+ namespaces (SEPA and ISO20022+ reports) 
- strict version : import of namespaces + strict validation required 
--> 
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:head.002.001.01" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:head.002.001.01"> 
    <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03" schemaLocation="pacs.002.001.03.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.003.001.02" schemaLocation="pacs.003.001.02.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.02" schemaLocation="pacs.004.001.02.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.007.001.02" schemaLocation="pacs.007.001.02.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.02" schemaLocation="pacs.008.001.02.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:camt.029.001.03" schemaLocation="camt.029.001.03.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:camt.056.001.01" schemaLocation="camt.056.001.01.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:acmt.022.001.02" schemaLocation="acmt.022.001.02.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRA" schemaLocation="pacs.002.001.03CRA.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRB" schemaLocation="pacs.002.001.03CRB.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRT" schemaLocation="pacs.002.001.03CRT.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03FKO" schemaLocation="pacs.002.001.03FKO.xsd"/> 
    <xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRG" schemaLocation="pacs.002.001.03CRG.xsd"/> 
    <xs:element name="Xchg" type="BusinessFileHeaderV01"/> 
    <xs:complexType name="ApplicationSpecifics1"> 
     <xs:sequence> 
      <xs:element maxOccurs="1" minOccurs="0" name="SysUsr" type="Max140Text"/> 
      <xs:element maxOccurs="1" minOccurs="0" name="Sgntr" type="ISO20022PlusSgntr"/> 
      <xs:element name="TtlNbOfDocs" type="Number"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="BusinessFileHeaderV01"> 
     <xs:sequence> 
      <xs:element name="PyldDesc" type="PayloadDescription1"/> 
      <xs:element maxOccurs="unbounded" minOccurs="0" name="Pyld" type="ExchangePayload1"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="ExchangePayload1"> 
     <xs:sequence> 
      <xs:element name="Any" type="ISO20022PlusAnyPayload"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="ISO20022PlusAnyPayload"> 
     <xs:choice> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.003.001.02" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.004.001.02" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.007.001.02" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.02" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:camt.029.001.03" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:camt.056.001.01" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:acmt.022.001.02" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRA" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRB" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRT" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03FKO" processContents="strict"/> 
      <xs:any namespace="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03CRG" processContents="strict"/> 
     </xs:choice> 
    </xs:complexType> 
    <xs:complexType name="ISO20022PlusSgntr"> 
     <xs:sequence> 
      <xs:any namespace="http://www.w3.org/2000/09/xmldsig#" processContents="strict"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:simpleType name="ISODateTime"> 
     <xs:restriction base="xs:dateTime"/> 
    </xs:simpleType> 
    <xs:complexType name="ManifestDetails1"> 
     <xs:sequence> 
      <xs:element name="DocTp" type="Max35Text"/> 
      <xs:element name="NbOfDocs" type="Number"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:simpleType name="Max140Text"> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="140"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Max256Text"> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="256"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Max35Text"> 
     <xs:restriction base="xs:string"> 
      <xs:minLength value="1"/> 
      <xs:maxLength value="35"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:simpleType name="Number"> 
     <xs:restriction base="xs:decimal"> 
      <xs:totalDigits value="18"/> 
      <xs:fractionDigits value="0"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:complexType name="PayloadDescription1"> 
     <xs:sequence> 
      <xs:element name="PyldDtls" type="PayloadDetails1"/> 
      <xs:element maxOccurs="1" minOccurs="0" name="ApplSpcfcInf" type="ApplicationSpecifics1"/> 
      <xs:element name="PyldTpDtls" type="PayloadTypeDetails1"/> 
      <xs:element maxOccurs="unbounded" minOccurs="0" name="MnfstDtls" type="ManifestDetails1"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="PayloadDetails1"> 
     <xs:sequence> 
      <xs:element name="PyldIdr" type="Max35Text"/> 
      <xs:element name="CreDtAndTm" type="ISODateTime"/> 
      <xs:element maxOccurs="1" minOccurs="0" name="PssblDplctFlg" type="TrueFalseIndicator"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="PayloadTypeDetails1"> 
     <xs:sequence> 
      <xs:element name="Tp" type="Max256Text"/> 
     </xs:sequence> 
    </xs:complexType> 
    <xs:simpleType name="TrueFalseIndicator"> 
     <xs:restriction base="xs:boolean"/> 
    </xs:simpleType> 
</xs:schema> 

Antwort

0

Dieser Fehler ist Ihnen zu sagen, dass Sie eine JAXB Einbindemappe verwenden müssen, den Namen der Sammlung zu ändern mit jedem der xs zugeordnet werden: alle Zeilen aus ihren Standard Wert von "Beliebig".

fand ich eine Dokumentation auf der Oracle-Website unter https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html

Ich fand auch diese verwandte Stackoverflow Antwort, die nützlich sein sollte (es ein Beispiel für eine vollständige Bindungs ​​Datei mit einem jaxb hat: Eigenschaft Element definiert): https://stackoverflow.com/a/4394185/265237

Sobald Sie eine verbindliche Datei geschrieben haben, werden Sie es zu XJC neben Ihrem XSD übergeben müssen, die Kommandozeilen-Version dieser wäre:

xjc schema.xsd -b bindings.xjb 
Verwandte Themen