Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Getting null value while unmarshalling an XML String

Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to convert XML String to Java object using JaxB Unmarshall.
But when I print the values I am getting the null values.
I have tried values options like using annotation @XmlElement at field , getter and setter level.
Added @XmlAccessorType(XmlAccessType.FIELD).
Added constructor.

But nothing works.

This is my XML String I am trying to convert to Java object.

My Response java object is

My Unmarshalling code is

After executing the Xml2Object class I am getting the following output.

Can you please help to resolve the issue why null values were printed.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic