3

I'm trying to to use xjc to generate my classes after my xsd and I've got stuck in this error: 'MyType' is already defined.

This MyType is a complexType that I have in 2 different XSD's. In my search on google, everyone said to make a bindind in a xjb file to correct this. I've tried but it keeps failing. Here's the xjb:

   <jaxb:bindings schemaLocation="myfile.xsd" node="/xs:schema">
    <jaxb:bindings node="//xs:complexType[@name='MyType']">
      <jaxb:class name="MyType2" />
    </jaxb:bindings>
   </jaxb:bindings>

I've tried using this for both types in both xsd's and still not working. I have no idea what I can do to fix this. Thanks for helping.

Augusto
  • 1,234
  • 1
  • 16
  • 35
  • 1
    possible duplicate of [Is there a way to deal with duplicate element definitions across multiple .xsd files in JAXB?](http://stackoverflow.com/questions/6681265/is-there-a-way-to-deal-with-duplicate-element-definitions-across-multiple-xsd-f) –  Jun 27 '12 at 18:59

1 Answers1

1

I had this same problem a while ago, the only solution that I could find out is was to process the files separately or modify one of the .xsd files and rename the duplicate to something else.

Community
  • 1
  • 1