| 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
|
 |
 |
|
|
subject: Help me understand this error
|
|
|