DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10911>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10911 unchecked NullPointer in search component Summary: unchecked NullPointer in search component Product: Cocoon 2 Version: 2.0.3 Platform: Other OS/Version: Linux Status: NEW Severity: Minor Priority: Other Component: sitemap components AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I tried to set up Cocoon2 v.2.0.3 in chrooted enviroment. Everything worked fine, except of lucene search example. That was my fault (I didn't copy /etc/resolv.conf to chroot jail), but I noticed that the problem is more general. The null pointer occures when Indexer cannot resolv a domain. From the "public List build(URL url)" in SimpleLuceneXMLIndexerImpl.java: --- URLConnection contentURLConnection = contentURL.openConnection(); String contentType = contentURLConnection.getContentType(); int index = contentType.indexOf(';'); --- if openConnection() fails (i.e. domain cannot be resolved, broken link...) contentType.indexOf(';') throws an NullPointerException that is not catched anyware, and the index creation fails (no page is displayed). Solution: --------- change above code to: --- URLConnection contentURLConnection = contentURL.openConnection(); if ( contentURLConnection == null ) return java.util.Collections.EMPTY_LIST; String contentType = contentURLConnection.getContentType(); if ( contentType == null ) return java.util.Collections.EMPTY_LIST; int index = contentType.indexOf(';'); --- -- pozdrawiam, -> m@j <- [http://silence.kernelpanic.pl/] PS. sorry for poor english. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]