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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.7
    • Fix Version/s: 3.0.0-milestone1, 2.7.9
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: