Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3ACD9200CF7 for ; Mon, 4 Sep 2017 14:35:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37ACA164E44; Mon, 4 Sep 2017 12:35:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5FD77164E4A for ; Mon, 4 Sep 2017 14:35:15 +0200 (CEST) Received: (qmail 20732 invoked by uid 500); 4 Sep 2017 12:35:14 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 20722 invoked by uid 99); 4 Sep 2017 12:35:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2017 12:35:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 03C631829E2 for ; Mon, 4 Sep 2017 12:35:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5DyEAZp2dSd0 for ; Mon, 4 Sep 2017 12:35:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7677E60D2C for ; Mon, 4 Sep 2017 12:35:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id F35C5E0ED9 for ; Mon, 4 Sep 2017 12:35:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0309F24157 for ; Mon, 4 Sep 2017 12:35:02 +0000 (UTC) Date: Mon, 4 Sep 2017 12:35:02 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-11718) Setting camel.dataformat.json-jackson.object-mapper throws exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 04 Sep 2017 12:35:16 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152564#comment-16152564 ] Claus Ibsen commented on CAMEL-11718: ------------------------------------- Ah darn a #xxx is a comment in a yaml file, so we need to support reference lookups without that notation as well. > Setting camel.dataformat.json-jackson.object-mapper throws exception > -------------------------------------------------------------------- > > Key: CAMEL-11718 > URL: https://issues.apache.org/jira/browse/CAMEL-11718 > Project: Camel > Issue Type: Improvement > Components: camel-jackson > Affects Versions: 2.19.2 > Reporter: Roman > Fix For: 2.20.0 > > Attachments: build.zip > > > I wanted to reuse the Jackson object mapper used by Spring MVC but jackson json configuration via YML is not working an causing an exception > {code:none} > camel: > springboot: > name: ${spring.application.name} > dataformat: > json-jackson: > object-mapper: jacksonObjectMapper > spring: > jackson: > property-naming-strategy: com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy > default-property-inclusion: non_null > serialization: > WRITE_DATES_AS_TIMESTAMPS: true > {code} > Throws the following exception: > {noformat} > org.apache.camel.spring.boot.CamelSpringBootInitializationException: org.apache.camel.FailedToCreateRouteException: Failed to create route test-public: Route(test-public)[[From[rest:get:/test?routeId=test-public&... because of java.lang.IllegalArgumentException: Could not find a suitable setter for property: objectMapper as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: com.fasterxml.jackson.databind.ObjectMapper with value jacksonObjectMapper > at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:225) > at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:52) > at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) > at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) > at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) > at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) > at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) > at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) > at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) > at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) > at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) > at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) > at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) > at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) > at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) > at au.com.iag.payments.service.OnlinePaymentsApplicationKt.main(OnlinePaymentsApplication.kt:15) > Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route test-public: Route(test-public)[[From[rest:get:/test?routeId=test-public&... because of java.lang.IllegalArgumentException: Could not find a suitable setter for property: objectMapper as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: com.fasterxml.jackson.databind.ObjectMapper with value jacksonObjectMapper > at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:209) > at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1087) > at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3540) > at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3271) > at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:202) > at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3089) > at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3085) > at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3108) > at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3085) > at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) > at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3022) > at org.apache.camel.spring.boot.RoutesCollector.maybeStart(RoutesCollector.java:242) > at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:217) > ... 15 common frames omitted > Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Could not find a suitable setter for property: objectMapper as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: com.fasterxml.jackson.databind.ObjectMapper with value jacksonObjectMapper > at org.apache.camel.component.jackson.springboot.JacksonDataFormatAutoConfiguration$1.newInstance(JacksonDataFormatAutoConfiguration.java:80) > at org.apache.camel.impl.DefaultDataFormatResolver.createDataFormat(DefaultDataFormatResolver.java:58) > at org.apache.camel.impl.DefaultDataFormatResolver.resolveDataFormat(DefaultDataFormatResolver.java:45) > at org.apache.camel.impl.DefaultCamelContext.resolveDataFormat(DefaultCamelContext.java:4240) > at org.apache.camel.model.rest.RestBindingDefinition.createRestBindingAdvice(RestBindingDefinition.java:122) > at org.apache.camel.impl.DefaultRouteContext.commit(DefaultRouteContext.java:201) > at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1302) > at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:204) > ... 27 common frames omitted > Caused by: java.lang.IllegalArgumentException: Could not find a suitable setter for property: objectMapper as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: com.fasterxml.jackson.databind.ObjectMapper with value jacksonObjectMapper > at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:614) > at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:640) > at org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:497) > at org.apache.camel.component.jackson.springboot.JacksonDataFormatAutoConfiguration$1.newInstance(JacksonDataFormatAutoConfiguration.java:76) > ... 34 common frames omitted > {noformat} > I have also tried with > {code} > ... > object-mapper: "#jacksonObjectMapper" > ... > {code} > to give the property introspection logic a hint that it is a ref, but result is the same. -- This message was sent by Atlassian JIRA (v6.4.14#64029)