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

Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.1
    • 2.4.9, 2.5.5, 2.6.2, 2.7
    • JAX-RS
    • None
    • Windows 7 , 64 Bit,Tomcat 6 Server

    • Unknown

    Description

      I am trying to generate a JAX-RS webservice which takes an Interface as an Input and renders an Interface as an output.These interfaces are handled with the @XmlJavaTypeAdapter annotation

      I used CXF version 2.6.1 to generate my service. When I deployed my service to Tomcat6. I was able to access the service. I used SOAPUI/browser to get my application/xml response. I was successful with it.

      But when I requested the browser the application/json response (using the _type=json) , it gave me an Illegal Annotation exception. The detailed exception was - JAXB cannot handle interfaces.

      I switched the CXF jar version to 2.6.0 , rebuilt the war, redeployed the application. I was able to render the XML as well as the JSON content.

      I will provide the two separate WAR files and also the code behind it.
      The only difference would be the CXF version property in the POM file.

      Can someone please help with this ?

      Cheers,
      Sree

      Attachments

        1. CXF261-JSON-RESPONSE.JPG
          75 kB
          Sree
        2. CXF26-JSON-RESPONSE.JPG
          90 kB
          Sree
        3. InterfaceWS.zip
          17 kB
          Sree

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            neo Sree
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: