title: Jaxb2Marshaller for multiple packages with the same classes
body: <p>I have 2 xsd schemas and generated java classes from them like this:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-xjc-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;generate-sources&lt;/id&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;xsdtojava&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;xsdOptions&gt;
                              &lt;xsdOption&gt;
                                  &lt;xsd&gt;${basedir}/src/main/resources/xsd/schema/1.xsd&lt;/xsd&gt;
                                  &lt;bindingFile&gt;${basedir}/src/main/resources/xsd/binding/1.xjb&lt;/bindingFile&gt;
                                  &lt;packagename&gt;foo.bar.1&lt;/packagename&gt;
                              &lt;/xsdOption&gt;
                              &lt;xsdOption&gt;
                                  &lt;xsd&gt;${basedir}/src/main/resources/xsd/schema/2.xsd&lt;/xsd&gt;
                                  &lt;bindingFile&gt;${basedir}/src/main/resources/xsd/binding/2.xjb&lt;/bindingFile&gt;
                                  &lt;packagename&gt;foo.bar.2&lt;/packagename&gt;
                              &lt;/xsdOption&gt;
                          &lt;/xsdOptions&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>This schemas has same classes, that's why i sorted them to different packages. 
  I try to create Jaxb2Marshaller for this packages like this:</p>
  
  <pre><code>@Bean
  public Jaxb2Marshaller jaxb2Marshaller() {
      Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
  
      marshaller.setPackagesToScan("foo.bar.1","foo.bar.2");
  
      marshaller.setMarshallerProperties(new HashMap&lt;String, Object&gt;() {{
          put(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true);
      }});
  
      return marshaller;
  }
  </code></pre>
  
  <p>but got the following exception</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'jaxb2Marshaller' defined in class path resource: Invocation of init method failed; nested exception is 
      org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is 
      javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: 
      com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 51 counts of IllegalAnnotationExceptions. 
      The element name {}Initial has more than one mapping.
  </code></pre>
  
  <p>I think that i should create separate marshaller for each package, but may be exists solution how to do it with one marshaller.</p>