-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception for spring.jackson.property-naming-strategy - Unable to instantiate jackson 26 object #4303
Comments
Looks like a wrong version of Jackson is used. |
It seems that springfox doesn't like this parameter. |
I confirm the issue, but this is because you changed the default configuration to "SNAKE_CASE". While this configuration seems to exist in the Jackson code, it doesn't even autocomplete in my Spring Boot configuration, so I guess this might not be supported by Spring Boot. Anyway, the issue is either:
Our default configuration works, if you want to do something else, you might encounter this kind of integration issue (we got them all the time, that's why JHipster is a lot of work), but we can't help you with this. |
Also just to note that this is not an issue per se, unless someone can confirm otherwise. This is a debug message. We explicitly added an anti-corruption layer to shield consumers from changes in 2.6 vs 2.7 vs 2.8 of jackson. So this is just a message indicating that "we tried doing X with 2.6 and now we're going to try with 2.7". |
I do confirm that this issue occurs in jhipster application. The default JacksonConfiguration is as follows: `@Configuration
}` The only thing i needed to make my parameter to automatically become snake_case was to do the following: `@Configuration
}` And, voila, your application now starts again and the properties in the REST API are all snake_case. |
Is this working, i am using 2.8 and plain spring boot project. I wrote snake_case (in caps) and log threw weird error and application failed to start :( |
Plz, don't comment old ticket. |
Overview of the issue
I generated sample JHipster application taking available jdl example. Required files are attached.
Spring boot has the setting for the same to use spring.jackson.property-naming-strategy to SNAKE_CASE (http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html).
While, using it for the JHipster generated project, I am getting multiple exception for "Unable to instantiate jackson 26 object".
I believe this is an issue with JHipster generated application as Spring boot documentation suggests the alternative to provide required property naming strategy through the application properties.
Motivation for or Use Case
I am checking the feasibility to use JHipster for one of my freelancing project to generate Monolithic Application. In that application, I need to call third party APIs and respond the various clients - Android, iOS, Web Client. So as per client specification, I am looking for property naming with lower case and "_" to separate words.
Reproduce the error
=> Generate jhipster monolithic application with sample jdl file present in https://jhipster.github.io/jdl-studio.
=> Update src/main/resources/config/application-dev.yml file to have SNAKE_CASE as property naming strategy.
spring:
jackson:
serialization.indent_output: true
property-naming-strategy: SNAKE_CASE
=> Run the application with development goal - ./mvnw -Pdev
Related issues
Unable to find any similar issue. But tried to look how I can set application wide property naming strategy. And majority have provided the solution to use application properties for the same. I have checked for the alternatives / issues relating to this and tried to update custom object mapper builder to have SNAKE_CASE as the property naming strategy. Also tried with fully qualified class name (com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStretegy). But sill the exceptions are present while starting the server (./mvnw -Pdev).
Suggest a Fix
Not found yet (new to Spring boot and JHipster).
JHipster Version(s)
3.8.0 (The output of yo jhipster:info is attached.)
JHipster configuration, a
.yo-rc.json
file generated in the root folderThe .yo-rc.json is attached.
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryFiles present in .jhipster directory are attached.
Browsers and Operating System
Mozilla Firefox 48.0
Ubuntu 14.04 LTS
prop_naming_issue.zip
The text was updated successfully, but these errors were encountered: