Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5406

ClassCastException in AtomPojoProvider when an Atom entry is returned with a media-type of application/atom+xml (no type parameter)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.7
    • 3.0.0-milestone1, 2.7.9
    • JAX-RS
    • None
    • Unknown

    Description

      According to RFC5023 (section 12) a server SHOULD return a type parameter on the media-type when returning an Atom Entry (e.g. application/atom+xml;type=entry). However, it is not mandatory that the server do this and RFC5023 states:

      If not specified, the type is assumed to be unspecified, requiring
      Atom processors to examine the root element to determine the type of
      Atom document.

      However, AtomPojoProvider simply assumes that when no type parameter is present that the content is a feed and throws a ClassCastException when it ends up trying to cast the Entry returned by Abdera into a Feed.

      Also AtomPojoProvider's check on the type parameter value is case-senstitive where RFC5023 states that:

      Neither the parameter name nor its value are case sensitive.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            dale.peakall Dale Peakall
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: