jax rs - Add JSON provider for CXF JAX-RS in Spring Boot properties or YAML file -


how move endpoint.setprovider(new jacksonjsonprovider()); application properties file?

 @bean     public server rsserver() {         jaxrsserverfactorybean endpoint = new jaxrsserverfactorybean();         endpoint.setbus(bus);         endpoint.setprovider(new jacksonjsonprovider());         endpoint.setservicebeans(aslist(new customerservicedefault()));         endpoint.setaddress("/");         endpoint.setfeatures(aslist(new swagger2feature()));         return endpoint.create();     } 

first if haven't done already, have add dependency provider:

    <dependency>         <groupid>org.codehaus.jackson</groupid>         <artifactid>jackson-jaxrs</artifactid>         <version>1.9.0</version>     </dependency> 

then need add package jackson entity providers jax-rs scanning (org.codehaus.jackson.jaxrs in case), other packages created. i'm using yaml configuration , class scanning opposed component scanning, , here how looks:

cxf:   path: /services   servlet.init:      service-list-path: /info   jaxrs:     classes-scan: true     classes-scan-packages: com.yourcompany.package.with.your.handlers,org.codehaus.jackson.jaxrs 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -