This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Problem with JAXB if new tag is added to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic

Problem with JAXB if new tag is added to XML

Nisha lakshminaraya
Ranch Hand

Joined: Feb 23, 2010
Posts: 30

I have XSD file where i am defining all the XML tags.I am compiling schema to generate all the java class's. I have added new tag to XML and not defined same in XSD. But when i am trying to unmarshall i am getting an error saying "Element not found"

Please help me to solve this

bala nannaka
Ranch Hand

Joined: Apr 02, 2007
Posts: 49
When you unmarshall the xml to generate the java class the Jaxb uses your scema to generate the handlers for each element type and generate a equivalent jave types for that. If you had a new element in xml and not updated in your schema it doen't know to generate a equivalent java type and throws the exception . Please make sure of your all xml elements are matching with the given schema.
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

I'm locking this duplicate post -- if you want to discuss the question, please reply to the other copy here:
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Problem with JAXB if new tag is added to XML
Similar Threads
Spring web flow : Unable to locate Spring NamespaceHandler
XSD help
Can I check whether a particular pattern of character is there in the attribute
Importing multiple external XSD files
XSD validation in XML