• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question JAXB 2.0 ValidationEventHandler

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am unmarshalling an xml using JAXB 2.0 as below:


If the input xml is invalid it shows the exception message saying:


This exception says that the name element is not expected which is fine. If this is the case then i need to the parent node of the element where the exception occurred and should perform some business logic. I am not able to get the parent node. I tried this:

but, I get null. How do i get the parent node?

Could anyone please help me out.

Thanks,
Suku
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sukumar Gaade,

I have the same problem? Have you solved it?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use a different method and supply the class you expect.



Sukumar Gaade wrote:Hi,

I am unmarshalling an xml using JAXB 2.0 as below:


If the input xml is invalid it shows the exception message saying:


This exception says that the name element is not expected which is fine. If this is the case then i need to the parent node of the element where the exception occurred and should perform some business logic. I am not able to get the parent node. I tried this:

but, I get null. How do i get the parent node?

Could anyone please help me out.

Thanks,
Suku

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic