Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to handle defined type 'javax.xml.datatype.Duration' #3

Open
VickF opened this issue Mar 4, 2014 · 1 comment
Open

Unable to handle defined type 'javax.xml.datatype.Duration' #3

VickF opened this issue Mar 4, 2014 · 1 comment

Comments

@VickF
Copy link

VickF commented Mar 4, 2014

Hi,

Thanks for the quick reply to the previous question. That helped me to get schemagen to run on a large XSD we received from another organization. There was only one type of error; on fields of type "xs:duration."

The error we get when fields fo type "xs:duration" are present is:

"Unable to handle defined type 'javax.xml.datatype.Duration'"

See com.nokia.util.avro.schemagen.SchemagenHelper.java, line 243.

This links shows the JAXB mapping for "xs:duration" is 'javax.xml.datatype.Duration', which makes sense.

http://docs.oracle.com/javase/tutorial/jaxb/intro/bind.html

This link shows the XML definition of "duration" type, with example values:

http://www.w3.org/TR/xmlschema-2/#duration

This class seems to create a Duration for us, but only after we do the work of parsing out the individual fields from the string.

http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/datatype/DatatypeFactory.html

As a workaround, I edited the .xsd file to say these fields are of type xs:string.

Thanks,
Vick

@UnquietCode
Copy link
Contributor

Some 'special' xml types like dates and big numbers are handled specially.

There is room to add a test for (what I presume will come out as) javax.xml.datatype.Duration. Assuming JAXB provides that, the question is, what avro type does this need to become?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants