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

JAXRSOutInterceptor throws ClassCastException with ContentTypeOutInterceptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.6
    • 2.2.7, 2.3
    • JAX-RS
    • None
    • Windows XP SP3
      jdk1.5.0_15
      Tomcat 5.5
      Spring 2.5.6

    Description

      In my spring xml If I use ContentTypeOutInterceptor with following syntax
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      <jaxrs:server ...>
      ...
      <jaxrs:inInterceptors>
      <bean class="org.apache.cxf.binding.http.interceptor.ContentTypeOutInterceptor"/>
      </jaxrs:inInterceptors>
      ...
      </jaxrs:server
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

      Then that results into ClassCastException. The Exception is thrown by following code from serializeMessage method of JAXRSOutInterceptor.java
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>
      MultivaluedMap<String, Object> responseHeaders =
      (MultivaluedMap)message.get(Message.PROTOCOL_HEADERS);
      <<<<<<<<<<<<<<<<<<<<<<<<<<<<

      It seems the ContentTypeOutInterceptor uses HashMap object to store Message.PROTOCOL_HEADERS value, but JAXRSOutInterceptor expects MultivaluedMap.

      My feeling is we should fix ContentTypeOutInterceptor. But as I am new to CXF, I am filing a bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            uttam1105 Uttam Phalnikar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: