• Post Reply Bookmark Topic Watch Topic
  • New Topic

XStream - convert the XML to Java Object Error  RSS feed

 
Muralidharan Kandasamy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the XStream to convert the XML into java object. It's working well on most cases, but for certain messages it's giving the error as mentioned below. I'm using the xStream-1.3.jar. Please share your thoughts.

---- Debugging information ----
cause-exception : java.lang.NullPointerException
cause-message : null
class : com.MyParentObject
required-type : com.MyChildObject
path : /com/MyParentObject/MyChildObject
-------------------------------

Due to this error, the conversion process stops abruptly and not processing anything further.
 
Muralidharan Kandasamy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is been resolved. The issue is in the java code. The XML attributes are 9, but the java is having only 8 attributes in the pojo class. So while converting the XML into Java it's thrown the XStreamException. By adding the missing element into java solved the issue.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!