Spring Boot app fails to start when user.language=tr
See original GitHub issueOverwriting Jackson configuration in application.properties i.e.
spring.jackson.mapper.accept-case-insensitive-properties=false
causes app fail to start with the following error:
$ java -Duser.language=tr -jar springboot-localebugdemo-0.0.1-SNAPSHOT.jar
20:45:12.014 [main] INFO springboot.localebugdemo.LocaleBugDemoApplication - user.language=tr
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.10.RELEASE)
2018-02-25 20:45:12.683 INFO 3448 --- [ main] s.l.LocaleBugDemoApplication : Starting LocaleBugDemoApplication on DanBarMBP with PID 3448 (/Users/danbar/Projects/lab/springboot-localebugdemo/build/libs/springboot-localebugdemo-0.0.1-SNAPSHOT.jar started by danbar in /Users/danbar/Projects/lab/springboot-localebugdemo/build/libs)
2018-02-25 20:45:12.684 DEBUG 3448 --- [ main] s.l.LocaleBugDemoApplication : Running with Spring Boot v1.5.10.RELEASE, Spring v4.3.14.RELEASE
2018-02-25 20:45:12.684 INFO 3448 --- [ main] s.l.LocaleBugDemoApplication : No active profile set, falling back to default profiles: default
2018-02-25 20:45:14.157 INFO 3448 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-02-25 20:45:14.159 INFO 3448 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.27
2018-02-25 20:45:14.267 INFO 3448 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-02-25 20:45:14.489 ERROR 3448 --- [ main] o.s.b.b.PropertiesConfigurationFactory : Properties configuration failed validation
2018-02-25 20:45:14.490 ERROR 3448 --- [ main] o.s.b.b.PropertiesConfigurationFactory : Field error in object 'spring.jackson' on field 'null': rejected value [accept-case-insensitive-properties]; codes [typeMismatch.spring.jackson.null,typeMismatch.null,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [spring.jackson.null,null]; arguments []; default message [null]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'com.fasterxml.jackson.databind.MapperFeature' for property 'null'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [com.fasterxml.jackson.databind.MapperFeature] for value 'accept-case-insensitive-properties'; nested exception is java.lang.IllegalArgumentException: No enum constant com.fasterxml.jackson.databind.MapperFeature.accept-case-insensitive-properties]
2018-02-25 20:45:14.492 WARN 3448 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'standardJacksonObjectMapperBuilderCustomizer' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]: Unsatisfied dependency expressed through method 'standardJacksonObjectMapperBuilderCustomizer' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Could not bind properties to JacksonProperties (prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors
Field error in object 'spring.jackson' on field 'null': rejected value [accept-case-insensitive-properties]; codes [typeMismatch.spring.jackson.null,typeMismatch.null,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [spring.jackson.null,null]; arguments []; default message [null]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'com.fasterxml.jackson.databind.MapperFeature' for property 'null'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [com.fasterxml.jackson.databind.MapperFeature] for value 'accept-case-insensitive-properties'; nested exception is java.lang.IllegalArgumentException: No enum constant com.fasterxml.jackson.databind.MapperFeature.accept-case-insensitive-properties]
2018-02-25 20:45:14.495 INFO 3448 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-02-25 20:45:14.521 ERROR 3448 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target org.springframework.boot.autoconfigure.jackson.JacksonProperties@4b4523f8 failed:
Property: spring.jackson.null
Value: accept-case-insensitive-properties
Reason: Failed to convert property value of type 'java.lang.String' to required type 'com.fasterxml.jackson.databind.MapperFeature' for property 'null'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [com.fasterxml.jackson.databind.MapperFeature] for value 'accept-case-insensitive-properties'; nested exception is java.lang.IllegalArgumentException: No enum constant com.fasterxml.jackson.databind.MapperFeature.accept-case-insensitive-properties
Action:
Update your application's configuration
The same app, started with user.language=en
(tried some other languages as well) works fine.
Seems like any Spring Boot application (even freshly generated, like the one in attached zip) is affected.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Spring boot application failed to start with exception org ...
Spring boot application failed to start with exception org.springframework.beans.factory.NoSuchBeanDefinitionException:.
Read more >Language Support - Spring
This comprehensive tutorial will teach you how to build Spring Boot applications with Kotlin using start.spring.io.
Read more >What Is Spring Boot? - Stackify
Spring Boot is an open-source micro framework maintained by a company called Pivotal. It provides Java developers with a platform to get ......
Read more >How to Internationalize a Spring Boot Application - Reflectoring
We use the locale of a user to tailor the information displayed to the user according to the user's language or region. These...
Read more >Errors when running Spring Boot app in Liberty - Forums - IBM
The thing that we look for is classpath*:messages*.properties (typically message_en.properties , message_fr.properties , etc). We are quite lenient for that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@snicoll Tested, works as expected now, thank you.
Reopening to see if we can add a test for this (might not be possible)