I am getting a NullPointerException when I try to visit the home page of 
my web application. Root cause:

java.lang.NullPointerException
at wicket.markup.parser.XmlPullParser.parse(XmlPullParser.java:390)
at wicket.markup.MarkupParser.readAndParse(MarkupParser.java:196)
at wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:279)
at 
wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:354)
at wicket.markup.MarkupCache.getMarkup(MarkupCache.java:198)
at wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:106)
at 
wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:827)
at wicket.markup.html.WebPage.commonInit(WebPage.java:235)
at wicket.markup.html.WebPage.<init>(WebPage.java:120)
at 
com.mycompany.newscomments.CommentHomePage.<init>(CommentHomePage.java:27)
...

I traced it back to the parse method in XmlPullParser, specifically 
where the xmlReader is closed in the finally block:

finally
                {
                        resource.close();
                        this.xmlReader.close();
                }

I think this exception can be avoided by changing:

    this.xmlReader.close();

to:

    if (this.xmlReader != null) this.xmlReader.close();

However, what is causing the xmlReader object to be null?

Is there a way to redirect these errors to a log file instead of 
displaying them on screen?

Thanks,
August


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to