Код: Выделить всё
org.apache.cxf
cxf-xjc-plugin
generate-sources
generate-sources
xsdtojava
${basedir}/src/main/resources/xsd/schema/1.xsd
${basedir}/src/main/resources/xsd/binding/1.xjb
foo.bar.1
${basedir}/src/main/resources/xsd/schema/2.xsd
${basedir}/src/main/resources/xsd/binding/2.xjb
foo.bar.2
Я пытаюсь создать Jaxb2Marshaller для этих пакетов следующим образом:
Код: Выделить всё
@Bean
public Jaxb2Marshaller jaxb2Marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan("foo.bar.1","foo.bar.2");
marshaller.setMarshallerProperties(new HashMap() {{
put(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true);
}});
return marshaller;
}
Код: Выделить всё
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.
Подробнее здесь: https://stackoverflow.com/questions/514 ... me-classes