I am using JAXBElement<…> because of missing @XmlRootElement annotation in generated classes for given XSDs (which I cannot modify) but Spring is still giving me the java.lang.IllegalStateException: No adapter for endpoint […]. Marshaller is defined as follows:
<bean id="marsh" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<propety name="packagesToScan" value="com.foo.*.schemas" />
</bean>
In the log I can see that spring has loaded all schemas, if I trace to endpointMap on startup I can see it there, but when a request comes there is no suitable adapter …
anyone facing the same?
Well I can see it now, if the contextPath property isn’t used then it is not set (is null) in jaxb2marshaller instance and following private method doesn’t work as expected:
so the JAXBElement<> trick doesn’t work here 🙁