Jun 29th, 2006, 03:32 PM
Problem with Spring JAXB Version?
Hi. I'm not sure yet if Spring is using an older? newer? version of JAXB, or there is some other JAXB config setting I'm missing. Anyway, the symptom is this:
Using the airline project as a template, if I try to generate the JAXB source code for simpleTypes with enumerations, such as this:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:enumeration value="Y" />
<xsd:enumeration value="N" />
...using Spring WS (recent download), JAXB doesn't generate the classes for the simpleTypes, and later, when I deploy the war, I get this error in the tomcat log:
simpleType org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name ... to a(n) 'type definition' component
...since it can't find the class associated with the simpleType.
However, if I create a test project in Eclipse, and use the JAXB from Sun's JWSDP2.0, it generates a YorNTyp.java, as I would expect.
I notice that the airline.xsd contains a simpleType with enumeration, but that it is not prefixed, i.e. is using a default namespace, which I am not.
This got me curious as to which version of JAXB Spring is using for the Web Services, but more importantly, how can I fix my problem without having to change my xml schema a lot?
Jun 29th, 2006, 03:51 PM
In case someone else encounters this, changing the restriction base to "NCName" works around the problem. Ex:
<enumeration value="Y" />
<enumeration value="N" />
Not sure why yet, since base="NCName" is ultimately derived from base="string", according to my Xml Schema book.
Jun 30th, 2006, 01:53 AM
We actually use JAXB 2.0.1 from https://jaxb.dev.java.net/