File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Help me understand this error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Help me understand this error" Watch "Help me understand this error" New topic
Author

Help me understand this error

zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 141

Hello guys,

I am trying to parse a simple web service in XML using the SAX parser, I am getting the following errors in Logcat

Caused by: java.lang.NullPointerException
11-09 16:05:10.019: E/AndroidRuntime(6409): at com.home.tut.ForecastDataHandler.endElement(ForecastDataHandler.java:136)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:160)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatParser.append(Native Method)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:521)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:482)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:320)
11-09 16:05:10.019: E/AndroidRuntime(6409): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:277)

I have done parsing earlier successfully i am not clear tough what the error is here does this line "com.home.tut.ForecastDataHandler.endElement" something is going wrong in the endElement method
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 2686

Is com.home.tut.ForecastDataHandler.endElement your code? What happens on that line? Because something there is null that you weren't expecting to be null, but we can't tell what that is without seeing the code.
zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 141

Problem Solved! The service that i was parsing had duplicate tags under two different categories and since i was setting the related tags true or false based on which tag it was in, it resulted in an error. Thanks Matthew for taking interest

Regards,
Zoheb
 
IntelliJ Java IDE
 
subject: Help me understand this error
 
Threads others viewed
list view problem
need to find distance between given two cities
reading XML layout contains a SurfaceView
ERROR/AndroidRuntime(706): java.lang.RuntimeException: Unable to start activity
how to get a longitude & latitude from a given address
IntelliJ Java IDE