Oct 25th, 2007, 09:44 AM
JAXB2 generation - separate
I have a couple of XSDs, one being Domain.xsd. The other XSDs import Domain.xsd. The other XSDs are generated into their own packages. So subsequently JAXB2 generation includes Domain.xsd, which results in duplicate copies of objects in Domain.xsd. Excluding Domain.xsd from the maven generation doesn't work. Is it possible to tell the org.jvnet.jaxb2.maven2 maven-jaxb2-plugin to only generate objects in the explicit XSD and not any imported files?
Oct 25th, 2007, 10:20 AM
Secondly, is it possible to add contextPaths property to AbstractJaxbMarshaller?
Oct 26th, 2007, 04:37 AM
No, because the JAXBContext object does not support that. See http://java.sun.com/javase/6/docs/ap...va.lang.String)
Originally Posted by mmccaskill
You can define multiple JAXB Marshallers, though, each with their own context path.
Oct 26th, 2007, 08:09 AM
Seems like slightly more configuration but I'll opt for using the classesToBeBound property. I can't imagine that creating/using multiple marshallers is cheap. Plus I'd have to have multiple MarshallingEndpointAdapters, right? Possibly multiple PayloadRootAnnotationMethodEndpointMappings?
Thanks for the help.
Oct 27th, 2007, 04:38 AM
Yes, that would mean that you define two adapters, but not two endpoint mappings.
Oct 30th, 2007, 10:47 PM
On the server that makes sense. But WebServiceGatewaySupport only allows using one Marshaller & Unmarshaller. Not sure how that would work out.
Oct 31st, 2007, 09:14 AM
If you go with multiple MarshallingMethodEndpointAdapters beware of the bug I ran into last night...
Oct 31st, 2007, 09:26 AM
Hey thanks for that. Patch looks good too. But unless the WebServiceGatewaySupport can support multiple marshallers I can't use this route. Unless I dig into the source and make it work. Hmmm.