Sergey,
I'm using 3.1.7-SNAPSHOT and have set both properties. Should
3.1.7-SNAPSHOT bring in jackson-jaxrs-json-provider? I had to explicitly
set it as a gradle dependency and construct a JacksonJsonProvider.
* build.gradle
compile group: 'com.fasterxml.jackson.jaxrs', name:
'jackson-jaxrs-json-provider', version: '2.7.5'
* CxfConfig.java
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.adp.vsldh.api.HelloController;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@Configuration
public class CxfConfig {
@Bean
public HelloController hello() {
return new HelloController();
}
@Bean
public JacksonJsonProvider jsonProvider() {
return new JacksonJsonProvider();
}
}
Otherwise, I get the following:
No message body writer has been found for class
com.adp.vsldh.api.GreetingData, ContentType: application/json
On Fri, Jun 24, 2016 at 6:01 AM, Sergey Beryozkin <[email protected]>
wrote:
> At the moment 2 properties are supported:
>
>
> http://cxf.apache.org/docs/springboot.html#SpringBoot-AdditionalConfiguration.1
>
> "cxf.path" can be used to customize a servlet URI pattern,
> "cxf.jaxrs.component-scan" can be used to auto-discover the providers -
> both properties are used in the demos linked to from CXF wiki.
>
> Use the latter if you'd like Jackson be auto-installed, otherwise create
> it directly on the endpoint as one of the demos shows.
>
> Sergey
>
>
> On 24/06/16 02:39, Christopher Gardner wrote:
>
>> Thanks. That helped. Now is there any reference for the following:
>>
>> * cxf properties that can be set in application.properties
>> * Examples of configuring Jackson for converting Response entities to
>> json.
>>
>>
>>
>> On Thu, Jun 23, 2016 at 4:43 AM, Sergey Beryozkin <[email protected]>
>> wrote:
>>
>> On 23/06/16 00:22, Christopher Gardner wrote:
>>>
>>> Has anyone on this list been able to get the
>>>> cxf-spring-boot-starter-jaxrs
>>>> working with gradle? If so, what did you do?
>>>>
>>>> See a demo done by Vedran,
>>>>
>>> https://github.com/vpavic-samples/spring-boot-cxf-jaxrs
>>>
>>> which has gradle scripts, he has a demo for JAXWS too in case someone is
>>> interested
>>>
>>> Sergey
>>>
>>>
>>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>