Skip to main content

Generating JAXB classes

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-12-08


My xml:

I have an xml for which I want to generate JAXB classes. Unfortunately I don't have access to xsd for this xml.

Could someone please share steps to generate JAXB classes for a xml. What I have tried is:

1) Generate the xsd from this xml using XML to XSD Generater Online -

2) Use the Maven JAXB plugin "org.jvnet.jaxb2_commons"

The problem I faced with my approach was that:

Since the xml has root element and one of the child element as same name, the JAXB processor fails on reaching the child "Catalog" tag. Even though it had successfully processed the root "Catalog" tag.

Any pointers would of great help.