Bug 443992 - Test for Network connectivity issue for just one feed gave a NPE
Test for Network connectivity issue for just one feed gave a NPE
Status: CLOSED NOTABUG
Product: Red Hat Collaboration Applications
Classification: Retired
Component: Blog Aggregator (Show other bugs)
1.0
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Collaboration Tools
Sudhir Mallamprabhakara
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-24 10:40 EDT by Sudhir Mallamprabhakara
Modified: 2008-10-13 15:19 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-24 16:16:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sudhir Mallamprabhakara 2008-04-24 10:40:44 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. modified the batch process to include an invalid feed for testing network
connectivity by giving something like www.edhatmagazine instead of
www.redhatmagazine.com
2. executed the batch process
3.
  
Actual results:
# /usr/share/www-app-blogs-beachead/www-app-blogs-beachead.sh
java.lang.NullPointerException
        at
com.redhat.www.blogs.beachhead.SyndEntryImplComparator.compare(SyndEntryImplComparator.java:9)
        at
com.redhat.www.blogs.beachhead.SyndEntryImplComparator.compare(SyndEntryImplComparator.java:6)
        at java.util.Arrays.mergeSort(Arrays.java:1284)
        at java.util.Arrays.mergeSort(Arrays.java:1295)
        at java.util.Arrays.mergeSort(Arrays.java:1295)
        at java.util.Arrays.mergeSort(Arrays.java:1295)
        at java.util.Arrays.mergeSort(Arrays.java:1295)
        at java.util.Arrays.sort(Arrays.java:1223)
        at java.util.Collections.sort(Collections.java:159)
        at
com.redhat.www.blogs.beachhead.RSSAggregator.readFeed(RSSAggregator.java:50)
        at
com.redhat.www.blogs.beachhead.RSSAggregator.readFeed(RSSAggregator.java:72)
        at com.redhat.www.blogs.beachhead.Main.main(Main.java:114)
/var/www/www.redhat.com/dhtml/beachead/today-tmp.html:1: HTML parser
error : Document is empty

^
blog beachhead temp file generation failed
[batch1.webqa-colo.redhat.com] [09:35:47 AM]

Expected results:


Additional info:
Comment 1 Bret McMillan 2008-04-24 16:16:20 EDT
The error above doesn't match the www.edhatmagazine.com case:


java -classpath
target/www-app-blogs-beachead.jar:/usr/share/java/jakarta-commons-lang.jar:/usr/share/java/rome-0.9.jar:/usr/share/java/jdom.jar
com.redhat.www.blogs.beachhead.Main src/main/resources/template.html 5 
'http://www.edhatmagazine.com/?feed=rss2'
'http://www.kidsguide.gr/index.php?option=com_rss&feed=RSS2.0&no_html=1' >
ampersand.html; xmllint ampersand.html --valid --noout --nonet; if [ "$?" != "0"
]; then echo "oh crap"; fi
java.net.UnknownHostException: www.edhatmagazine.com
        at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:159)
        at java.net.Socket.connect(Socket.java:569)
        at java.net.Socket.connect(Socket.java:519)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:405)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:241)
        at sun.net.www.http.HttpClient.New(HttpClient.java:322)
        at sun.net.www.http.HttpClient.New(HttpClient.java:334)
        at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:806)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:747)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:672)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1020)
        at com.sun.syndication.io.XmlReader.<init>(XmlReader.java:174)
        at com.sun.syndication.io.XmlReader.<init>(XmlReader.java:151)
        at
com.redhat.www.blogs.beachhead.RSSAggregator.readFeed(RSSAggregator.java:46)
        at
com.redhat.www.blogs.beachhead.RSSAggregator.readFeed(RSSAggregator.java:71)
        at com.redhat.www.blogs.beachhead.Main.main(Main.java:114)
ampersand.html:1: parser error : Document is empty

^
ampersand.html:1: parser error : Start tag expected, '<' not found

^
oh crap





So, when given a bad hostname, the code raises an java.net.UnknownHostException,
and the app exits with an error code.  So long as the error code is non-zero,
and the email gets sent to me, then it's working fine.

Not sure how you generated the NullPointerException... if you can replicate,
please re-open this bug.
Comment 2 David Lawrence 2008-10-13 11:54:53 EDT
Changing product to "Red Hat Collaboration Applications".

Note You need to log in before you can comment on or make changes to this bug.