Failed to bind properties under ‘spring.jackson.deserialization’.

huangapple go评论86阅读模式
英文:

Failed to bind properties under 'spring.jackson.deserialization'

问题

您的错误在于应用程序试图将一个java.lang.String类型的属性绑定到java.util.Map<com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean>类型的属性,但没有找到适当的转换器来执行此操作。这通常是因为应用程序的配置不正确或不完整导致的。

要解决这个问题,您可以按照以下步骤进行操作:

  1. 确保您的应用程序配置文件(application.properties)包含所需的Spring Jackson配置。您可以尝试添加以下配置到您的application.properties文件中:
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false
spring.jackson.deserialization.FAIL_ON_UNKNOWN_PROPERTIES=false

这将禁用在没有任何可序列化或反序列化属性的情况下引发异常的行为。

  1. 确保您的Gradle构建文件中的Spring Boot版本与您正在使用的Spring Boot版本匹配。检查build.gradle中的Spring Boot插件版本,确保它与您的Spring Boot应用程序的实际版本兼容。

  2. 重新构建和部署您的应用程序。如果更改了配置文件,请确保新的配置文件已生效。

如果您的问题仍然存在,请提供更多关于您的应用程序配置和Tomcat部署的详细信息,以便更好地帮助您解决问题。

英文:

When I start my project into deploy on Tomcat i get the error message

> Description: Failed to bind properties under
> 'spring.jackson.deserialization' to
> java.util.Map<com.fasterxml.jackson.databind.DeserializationFeature,
> java.lang.Boolean>:
> Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean>] Action:
>
> Update your application's configuration

my application.properties is empty

project build by gradle.

build.gradle

    plugins {
        id &#39;org.springframework.boot&#39; version &#39;2.3.2.RELEASE&#39;
        id &#39;io.spring.dependency-management&#39; version &#39;1.0.9.RELEASE&#39;
        id &#39;java&#39;
        id &#39;war&#39;
    }
    group = &#39;com.ladon&#39;
    version = &#39;0.0.1&#39;
    sourceCompatibility = &#39;11&#39;
    repositories {
        mavenCentral()
    }
    dependencies {
        implementation &#39;org.springframework.boot:spring-boot-starter-web&#39;
        implementation &#39;org.springframework.boot:spring-boot-starter-data-jpa&#39;
        runtimeOnly &#39;com.h2database:h2&#39;
        runtimeOnly &#39;com.microsoft.sqlserver:mssql-jdbc&#39;
        runtimeOnly &#39;mysql:mysql-connector-java&#39;
        runtimeOnly &#39;org.apache.derby:derby&#39;
        runtimeOnly &#39;org.postgresql:postgresql&#39;
    
        compileOnly &#39;org.projectlombok:lombok:1.18.12&#39;
        annotationProcessor &#39;org.projectlombok:lombok:1.18.12&#39;
        testCompileOnly &#39;org.projectlombok:lombok:1.18.12&#39;
        testAnnotationProcessor &#39;org.projectlombok:lombok:1.18.12&#39;
        providedRuntime &#39;org.springframework.boot:spring-boot-starter-tomcat&#39;
        testImplementation(&#39;org.springframework.boot:spring-boot-starter-test&#39;) {
            exclude group: &#39;org.junit.vintage&#39;, module: &#39;junit-vintage-engine&#39;
        }
    }
    
    test {
        useJUnitPlatform()
    }
    package com.ladon.jsonserver;
    
    import org.springframework.boot.builder.SpringApplicationBuilder;
    import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
    
    public class ServletInitializer extends SpringBootServletInitializer {
    
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(JsonserverApplication.class);
    }
    
    }

    package com.ladon.jsonserver;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    @SpringBootApplication
    public class JsonserverApplication {
    
        public static void main(String[] args) {
            SpringApplication.run(JsonserverApplication.class, args);
        }
    
    }


    package com.ladon.jsonserver.structure;
    
        import com.fasterxml.jackson.annotation.JsonIgnore;
        import com.fasterxml.jackson.annotation.JsonInclude;
        import com.fasterxml.jackson.annotation.JsonProperty;
        import com.fasterxml.jackson.annotation.JsonPropertyOrder;
        import lombok.Data;
        import java.util.HashMap;
        import java.util.List;
        import java.util.Map;
    
        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonPropertyOrder({
            &quot;ACTIONS&quot;,
            &quot;EcrSN&quot;,
            &quot;Group&quot;,
            &quot;ErrorCode&quot;,
            &quot;ErrorCodeMessage&quot;
        })
        public @Data class DeviceStatusUpdateResponse {
    
            @JsonProperty(&quot;ACTIONS&quot;)
            private List&lt;DeviceStatusUpdateACTIONSResponse&gt; aCTIONS = null;
            @JsonProperty(&quot;EcrSN&quot;)
            private Integer ecrSN;
            @JsonProperty(&quot;Group&quot;)
            private String group;
            @JsonProperty(&quot;ErrorCode&quot;)
            private Integer errorCode;
            @JsonProperty(&quot;ErrorCodeMessage&quot;)
            private String errorCodeMessage;
            @JsonIgnore
            private Map&lt;String, Object&gt; additionalProperties = new HashMap&lt;String, Object&gt;();
    
            public DeviceStatusUpdateResponse() {
            }
    
    
        }


    package com.ladon.jsonserver.structure;
    
    
        import java.io.Serializable;
        import java.util.HashMap;
        import java.util.List;
        import java.util.Map;
        import com.fasterxml.jackson.annotation.JsonIgnore;
        import com.fasterxml.jackson.annotation.JsonInclude;
        import com.fasterxml.jackson.annotation.JsonProperty;
        import com.fasterxml.jackson.annotation.JsonPropertyOrder;
        import lombok.Data;
    
        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonPropertyOrder({
            &quot;TypeId&quot;,
            &quot;Id&quot;,
            &quot;CreationTimestamp&quot;,
            &quot;ExecutionTimestamp&quot;,
            &quot;Note&quot;,
            &quot;DownloadURL&quot;,
            &quot;DeployType&quot;,
            &quot;NewEcrFwVersion&quot;,
            &quot;NewEcrFwVersionDescription&quot;,
            &quot;MD&quot;,
            &quot;CMD&quot;
        })
        public @Data class DeviceStatusUpdateACTIONSResponse implements Serializable {
    
            @JsonProperty(&quot;TypeId&quot;)
            private Integer typeId;
            @JsonProperty(&quot;Id&quot;)
            private Integer id;
            @JsonProperty(&quot;CreationTimestamp&quot;)
            private String creationTimestamp;
            @JsonProperty(&quot;ExecutionTimestamp&quot;)
            private String executionTimestamp;
            @JsonProperty(&quot;Note&quot;)
            private String note;
            @JsonProperty(&quot;DownloadURL&quot;)
            private String downloadURL;
            @JsonProperty(&quot;DeployType&quot;)
            private String deployType;
            @JsonProperty(&quot;NewEcrFwVersion&quot;)
            private Integer newEcrFwVersion;
            @JsonProperty(&quot;NewEcrFwVersionDescription&quot;)
            private String newEcrFwVersionDescription;
            @JsonProperty(&quot;MD&quot;)
            private String mD;
            @JsonProperty(&quot;CMD&quot;)
            private List&lt;DeviceStatusUpdateACTIONSCMDResponse&gt; cMD = null;
            @JsonIgnore
            private Map&lt;String, Object&gt; additionalProperties = new HashMap&lt;String, Object&gt;();
    
    
            public DeviceStatusUpdateACTIONSResponse() {
            }
    
            /**
         *
         * @param note
         * @param newEcrFwVersionDescription
         * @param newEcrFwVersion
         * @param mD
         * @param creationTimestamp
         * @param downloadURL
         * @param typeId
         * @param id
         * @param cMD
         * @param deployType
         * @param executionTimestamp
         */
            public DeviceStatusUpdateACTIONSResponse(Integer typeId, Integer id, String creationTimestamp, String executionTimestamp, String note, String downloadURL, String deployType, Integer newEcrFwVersion, String newEcrFwVersionDescription, String mD, List&lt;DeviceStatusUpdateACTIONSCMDResponse&gt; cMD) {
                super();
                this.typeId = typeId;
                this.id = id;
                this.creationTimestamp = creationTimestamp;
                this.executionTimestamp = executionTimestamp;
                this.note = note;
                this.downloadURL = downloadURL;
                this.deployType = deployType;
                this.newEcrFwVersion = newEcrFwVersion;
                this.newEcrFwVersionDescription = newEcrFwVersionDescription;
                this.mD = mD;
                this.cMD = cMD;
            }
        }


    package com.ladon.jsonserver.structure;
    
        import java.io.Serializable;
        import java.util.HashMap;
        import java.util.Map;
        import com.fasterxml.jackson.annotation.JsonIgnore;
        import com.fasterxml.jackson.annotation.JsonInclude;
        import com.fasterxml.jackson.annotation.JsonProperty;
        import com.fasterxml.jackson.annotation.JsonPropertyOrder;
        import lombok.Data;
    
    
        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonPropertyOrder({
            &quot;CmdId&quot;,
            &quot;Commandd&quot;,
            &quot;Psw&quot;,
            &quot;Body&quot;,
            &quot;ExtendedDeviceStatus&quot;,
            &quot;OnlyIfPreviousOk&quot;,
            &quot;StateExe&quot;
        })
        public @Data class DeviceStatusUpdateACTIONSCMDResponse implements Serializable {
    
            @JsonProperty(&quot;CmdId&quot;)
            private Integer cmdId;
            @JsonProperty(&quot;Commandd&quot;)
            private String commandd;
            @JsonProperty(&quot;Psw&quot;)
            private Integer psw;
            @JsonProperty(&quot;Body&quot;)
            private String body;
            @JsonProperty(&quot;ExtendedDeviceStatus&quot;)
            private Integer extendedDeviceStatus;
            @JsonProperty(&quot;OnlyIfPreviousOk&quot;)
            private Boolean onlyIfPreviousOk;
            @JsonProperty(&quot;StateExe&quot;)
            private Integer stateExe;
            @JsonIgnore
            private Map&lt;String, Object&gt; additionalProperties = new HashMap&lt;String, Object&gt;();
    
            public DeviceStatusUpdateACTIONSCMDResponse() {
            }
            public DeviceStatusUpdateACTIONSCMDResponse(Integer cmdId, String commandd, Integer psw, String body, Integer extendedDeviceStatus, Boolean onlyIfPreviousOk, Integer stateExe) {
                super();
                this.cmdId = cmdId;
                this.commandd = commandd;
                this.psw = psw;
                this.body = body;
                this.extendedDeviceStatus = extendedDeviceStatus;
                this.onlyIfPreviousOk = onlyIfPreviousOk;
                this.stateExe = stateExe;
            }
        }


    package com.ladon.jsonserver.controller;
    
        import com.ladon.jsonserver.structure.DeviceStatusUpdateResponse;
        import org.springframework.http.HttpStatus;
        import org.springframework.http.MediaType;
        import org.springframework.web.bind.annotation.*;
    
        @RestController
        @RequestMapping(&quot;/RemoteControl&quot;)
        public class DeviceStatusUpdateResponseController {
    
            @ResponseBody
            @ResponseStatus(value = HttpStatus.OK)
            @RequestMapping(value = &quot;/UpdateDeviceStatus/{sernum}&quot;,produces = MediaType.APPLICATION_JSON_VALUE)
            public DeviceStatusUpdateResponse DeviceStatusUpdateResponse(@PathVariable(&quot;sernum&quot;) long sernum)
            {
                DeviceStatusUpdateResponse device = new DeviceStatusUpdateResponse();
    
                return device;
            }
        }

Where is my mistake?

答案1

得分: 0

新错误


***************************
启动应用程序失败
***************************

描述:

未能将属性绑定到 'spring.jackson.deserialization' 下的 java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;:

    原因:找不到能够从类型 [java.lang.String] 转换到类型 [java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;] 的转换器

操作:

更新您的应用程序配置

2020年7月31日 11:34:21.283 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke 方法调用异常 [manageApp]
	java.lang.IllegalStateException: 启动子级时发生错误
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
		at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1727)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at 

	由于:org.springframework.beans.factory.BeanCreationException: 在类路径资源 [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class] 中定义的名为 'requestMappingHandlerAdapter' 的 bean 创建失败:通过工厂方法实例化 bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException: 通过工厂方法 'requestMappingHandlerAdapter' 创建 bean 失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException: 在类路径资源 [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class] 中定义的名为 'messageConverters' 的 bean 创建失败:通过工厂方法实例化 bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException: 通过工厂方法 'messageConverters' 创建 bean 失败;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class] 中定义的名为 'mappingJackson2HttpMessageConverter' 的 bean 创建失败:通过方法 'mappingJackson2HttpMessageConverter' 的参数 0 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class] 中定义的名为 'jacksonObjectMapper' 的 bean 创建失败:通过方法 'jacksonObjectMapper' 的参数 0 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class] 中定义的名为 'jacksonObjectMapperBuilder' 的 bean 创建失败:通过方法 'jacksonObjectMapperBuilder' 的参数 1 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class] 中定义的名为 'standardJacksonObjectMapperBuilderCustomizer' 的 bean 创建失败:通过方法 'standardJacksonObjectMapperBuilderCustomizer' 的参数 1 表达的不满足依赖性;嵌套异常是 org.springframework.boot.context.properties.ConfigurationPropertiesBindException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonProperties.class] 中定义的名为 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties' 的 bean 创建失败:无法将属性绑定到 'JacksonProperties':前缀=spring.jackson,ignoreInvalidFields=false,ignoreUnknownFields=true;嵌套异常是 org.springframework.boot.context.properties.bind.BindException: 无法将属性绑定到 'spring.jackson.deserialization' 下的 java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
		at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655)
		at 

	由于:org.springframework.beans.BeanInstantiationException: 通过工厂方法 'requestMappingHandlerAdapter' 创建 bean 失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException: 在类路径资源 [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class] 中定义的名为 'messageConverters' 的 bean 创建失败:通过工厂方法实例化 bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException: 通过工厂方法 'messageConverters' 创建 bean 失败;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class] 中定义的名为 'mappingJackson2HttpMessageConverter' 的 bean 创建失败:通过方法 'mappingJackson2HttpMessageConverter' 的参数 0 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class] 中定义的名为 'jacksonObjectMapper' 的 bean 创建失败:通过方法 'jacksonObjectMapper' 的参数 0 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class] 中定义的名为 'jacksonObjectMapperBuilder' 的 bean 创建失败:通过方法 'jacksonObjectMapperBuilder' 的参数 1 表达的不满足依赖性;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class] 中定义的名为 'standardJacksonObjectMapperBuilderCustomizer' 的 bean 创建失败:通过方法 'standardJacksonObjectMapperBuilderCustomizer' 的参数 1 表达的不满足依赖性;嵌套异常是 org.springframework.boot.context.properties.ConfigurationPropertiesBindException: 在类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonProperties.class] 中定义的名为 'spring.jackson-org.springframework.boot.autoconfigure.jackson

<details>
<summary>英文:</summary>

new error

APPLICATION FAILED TO START


Description:

Failed to bind properties under 'spring.jackson.deserialization' to java.util.Map<com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean>:

Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;]

Action:

Update your application's configuration

31-Jul-2020 11:34:21.283 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method [manageApp]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1727)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#39;requestMappingHandlerAdapter&#39; defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method &#39;requestMappingHandlerAdapter&#39; threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#39;messageConverters&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method &#39;messageConverters&#39; threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;mappingJackson2HttpMessageConverter&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method &#39;mappingJackson2HttpMessageConverter&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655)
at 
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method &#39;requestMappingHandlerAdapter&#39; threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#39;messageConverters&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method &#39;messageConverters&#39; threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;mappingJackson2HttpMessageConverter&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method &#39;mappingJackson2HttpMessageConverter&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#39;messageConverters&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method &#39;messageConverters&#39; threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;mappingJackson2HttpMessageConverter&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method &#39;mappingJackson2HttpMessageConverter&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method &#39;messageConverters&#39; threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;mappingJackson2HttpMessageConverter&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method &#39;mappingJackson2HttpMessageConverter&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
... 91 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;mappingJackson2HttpMessageConverter&#39; defined in class path resource [org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through method &#39;mappingJackson2HttpMessageConverter&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapper&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapper&#39; parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;jacksonObjectMapperBuilder&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration.class]: Unsatisfied dependency expressed through method &#39;jacksonObjectMapperBuilder&#39; parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797)
at 
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name &#39;standardJacksonObjectMapperBuilderCustomizer&#39; defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method &#39;standardJacksonObjectMapperBuilderCustomizer&#39; parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name &#39;spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties&#39;: Could not bind properties to &#39;JacksonProperties&#39; : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under &#39;spring.jackson.deserialization&#39; to java.util.Map&lt;com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean&gt;
at 

UDP 2020.08.19
I found mistake. I fully remove Tomcat configuration from Run and create again. After that working fine and add into dependencies // mvnrepository.com/artifact/com.fasterxml.jackson.core/… compile group: &#39;com.fasterxml.jackson.core&#39;, name: &#39;jackson-databind&#39;, version: &#39;2.11.2&#39; 
</details>

huangapple
  • 本文由 发表于 2020年7月31日 01:39:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/63178501.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定