Thanks Sergey. I will update CXF.

Regards,
Kasun Dilunika.

http://www.dilunika.com/

On Mon, Nov 10, 2014 at 10:08 PM, Sergey Beryozkin [via CXF] <
[email protected]> wrote:

> As far as I recall CXF 2.7.8 or earlier was not able to pick up newer
> Jacksons, you probably need to upgrade to CXF 2.7.13 or 3.0.2
>
> Cheers, Sergey
> On 10/11/14 16:21, jkdilunika wrote:
>
> > I have configured JacksonJsonProvider to CXF REST server bean. But what
> I
> > notice is CXF does not pick the configured JSON provider. It always
> returns
> > 405 with following warning.
> >
> > [qtp260261822-13 - /os/v3/token] WARN
> org.apache.cxf.jaxrs.utils.JAXRSUtils
> > - No message body reader has been found for request class TokenRequest,
> > ContentType : application/json.
> >
> > I have pasted the code blocks I am using. Can some one explain me where
> have
> > I gone wrong here?
> >
> >
> ------------------------------------------------------------------------------------------------------------------------
>
> >
> > CXF Server
> > =========
> >
> > public void start(){
> >
> >          JAXRSServerFactoryBean serverFactory = new
> JAXRSServerFactoryBean();
> >          serverFactory.setServiceBean(new IdentityService());
> >          serverFactory.setAddress("http://10.30.9.56:9000/os";);
> >          serverFactory.setProviders(Arrays.asList(new
> > JacksonJsonProvider()));
> >
> >          BindingFactoryManager manager =
> > serverFactory.getBus().getExtension(BindingFactoryManager.class);
> >          JAXRSBindingFactory factory = new JAXRSBindingFactory();
> >          factory.setBus(serverFactory.getBus());
> >
>  manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID,
> > factory);
> >          Server server = serverFactory.create();
> >
> >
> >          LOGGER.info("Server Started on URL http://10.30.9.56:9000/os";);
>
> > }
> >
> > Resource Class
> > =========
> >
> > @Path("/v3")
> > public class IdentityService {
> >
> >      @POST
> >      @Path("/token")
> >      @Consumes(MediaType.APPLICATION_JSON)
> >      @Produces(MediaType.APPLICATION_JSON)
> >      public Response createToken(TokenRequest token){
> >
> >          TokenResponse tokenResponse = new
> > TokenResponse("we54er4564355re645654",
> > Arrays.asList("identity:http://10.1.2.4:4000","compute:
> http://10.1.2.4:5000";));
> >
> >          return Response.ok(tokenResponse).build();
> >      }
> > }
> >
> > Request POJO
> > =========
> >
> > @JsonRootName("tokenRequest")
> > public class TokenRequest {
> >
> >      private String accessKey;
> >
> >      private String password;
> >
> >      // getters and setters
> > }
> >
> >
> > Request Sent
> > ========
> >
> > POST /v3/token (Content-Type : application/json) { "accessKey": "kasun",
> > "password": "secret" }
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-REST-Server-does-not-pick-JacksonJsonProvider-tp5750919.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/CXF-REST-Server-does-not-pick-JacksonJsonProvider-tp5750919p5750922.html
>  To unsubscribe from CXF REST Server does not pick JacksonJsonProvider, click
> here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5750919&code=a2FzdW5kaWx1bmlrYUBnbWFpbC5jb218NTc1MDkxOXwtNjEyMjQyMTg2>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-REST-Server-does-not-pick-JacksonJsonProvider-tp5750919p5750959.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to