Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting Nulpointer in xml file parsing

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my main activity



i am getting nullpointer exception at below line.



below is the xml my file



i am getting whole xml file in below line

 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sam liyanage wrote:i am getting nullpointer exception at below line.

Past the actual stack trace. A null pointer exception always happens for the same reason: a variable you are dereferencing on a line doesn't point to an Object. You are not dereferencing any variables on that line, so that line can not be the line actually causing the exception.
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve.Problem solve now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic