Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-2871

ClassCastException using atom-abdera binding

    XMLWordPrintableJSON

Details

    Description

      If you use the atom-abdera binding with a reference that points to an RSS feed rather than an atom feed, you get a ClassCastException rather than a reasonable error. This occurs in the Tuscany feed-aggregator sample, but the exception is being swallowed in the java implementation.

      From FeedAggregator.composite in the feed-aggregator sample (the uri points to an RSS 2.0 feed):
      <reference name="atomFeed1">
      <tuscany:binding.atom uri="http://www.oreillynet.com/pub/feed/35"/>
      </reference>

      The following code in AtomBindingInvoker (346-348) results in the ClassCastException:
      Document<Feed> doc = abderaParser.parse(new InputStreamReader(getMethod.getResponseBodyAsStream()));
      parsing = true;
      Feed feed = doc.getRoot();

      doc.getRoot() returns an instance of org.apache.abdera.parser.stax.FOMExtensibleElement rather than Feed.

      AggregatorImpl in the feed-aggregator sample is swallowing the exception here (85-89):
      if (atomFeed1 != null) {
      try

      { entries.addAll(atomFeed1.getFeed().getEntries()); }

      catch (Exception e) {}
      }

      Attachments

        Activity

          People

            lresende Luciano Resende
            bdaniel Brent Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: