You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sree (JIRA)" <ji...@apache.org> on 2012/07/16 16:54:35 UTC

[jira] [Created] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Sree created CXF-4426:
-------------------------

             Summary: Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
                 Key: CXF-4426
                 URL: https://issues.apache.org/jira/browse/CXF-4426
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.6.1
         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
            Reporter: Sree


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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-4426.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.0
                   2.6.2
                   2.5.5
                   2.4.9
         Assignee: Sergey Beryozkin

There was a dormant bug in JSONProvider which got exposed after the transition to CXF 2.6.2, with the providers now given the class types exactly as they are typed in the signature, as a result the actual class type obtained from the object (returned from the adapter) was lost which is now fixed.
As a side note, few of the adapter classes in the test web app have no public qualifiers, so that was causing the issues too
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>            Assignee: Sergey Beryozkin
>             Fix For: 2.4.9, 2.5.5, 2.6.2, 2.7.0
>
>         Attachments: CXF26-JSON-RESPONSE.JPG, CXF261-JSON-RESPONSE.JPG, InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sree (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sree updated CXF-4426:
----------------------

    Attachment: CXF261-JSON-RESPONSE.JPG
                CXF26-JSON-RESPONSE.JPG

These are the screen shots for CXF2.6 and CXF 2.6.1.

The same service fails when using 2.6.1
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>         Attachments: CXF26-JSON-RESPONSE.JPG, CXF261-JSON-RESPONSE.JPG, InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416258#comment-13416258 ] 

Sergey Beryozkin commented on CXF-4426:
---------------------------------------

> So do I have to wait for the 2.6.2 version to get a fix for this issue ?
Yes. Alternatively, register a custom JSONProvider which overrides writeTo method and delegates to the super class except that it uses 'object.getClass()' as a second parameter, where 'object' is the name of the first parameter
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>            Assignee: Sergey Beryozkin
>             Fix For: 2.4.9, 2.5.5, 2.6.2, 2.7.0
>
>         Attachments: CXF26-JSON-RESPONSE.JPG, CXF261-JSON-RESPONSE.JPG, InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sree (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sree updated CXF-4426:
----------------------

    Attachment: InterfaceWS.zip

This is the source of the Project I have created to test this bug.

Please change the cxf.version property to 2.6.1 to test and see that JSON content doesnt get rendered.
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>         Attachments: InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sree (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415205#comment-13415205 ] 

Sree commented on CXF-4426:
---------------------------

I built the project using the maven clean package command with the profile of dev.
Once the project is built it generates an InterfaceWS.war file in the target folder.

I copied it to the webapp folder of tomcat and started tomcat server.
The log file location would be under tomcat-logs folder.

The end point to test is  http://localhost:<TOMCAT_PORT>/InterfaceWS/HI/sayHi
Please post the following content - Use SOAPUI ot any mechanism that can send a post request to the above URL.

<In>
<inputName>
	<nameValue>sa</nameValue>
</inputName>
</In>

The source provided can be rebuilt with CXF version 2.6.1 and then the above steps are to be redone.
The screen shots are attached which testify the output that I received.

Let me know in case additional clarification is required.

Cheers,
Sree
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>         Attachments: CXF26-JSON-RESPONSE.JPG, CXF261-JSON-RESPONSE.JPG, InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4426) Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly

Posted by "Sree (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416226#comment-13416226 ] 

Sree commented on CXF-4426:
---------------------------

Sergey,
            So do I have to wait for the 2.6.2 version to get a fix for this issue ?
Please let me know if I have to wait for it - in such a  case I will push my code to QA with the 2.6.0 version ( since that version doesn't break the jSON).

Thanks for that public qualifiers hint , I will fix that and see if it works with 2.6.1.

Thank you very much for taking a look at this on a short notice - I really appreciate your help !!

Let me know !!

Cheers,
Sathish
                
> Unable to Render JSON Content using CXF version 2.6.1 - XML content gets rendered properly
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-4426
>                 URL: https://issues.apache.org/jira/browse/CXF-4426
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Windows 7 , 64 Bit,Tomcat 6 Server
>            Reporter: Sree
>            Assignee: Sergey Beryozkin
>             Fix For: 2.4.9, 2.5.5, 2.6.2, 2.7.0
>
>         Attachments: CXF26-JSON-RESPONSE.JPG, CXF261-JSON-RESPONSE.JPG, InterfaceWS.zip
>
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira