Skip to content
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

NoSuchMethodError: 'org.springframework.http.HttpStatus org.springframework.http.ResponseEntity.getStatusCode()' #59

Closed
derkoe opened this issue Jan 13, 2023 · 1 comment · Fixed by #60
Assignees
Labels
bug Something isn't working

Comments

@derkoe
Copy link
Contributor

derkoe commented Jan 13, 2023

It seems that Spring 5 and 6 ResponseEntity#getStatusCode methods are not compatible.

When using this library with Spring 6 / Spring Boot 3 you'll get the following error:

org.springframework.http.HttpStatus org.springframework.http.ResponseEntity.getStatusCode()'
java.lang.NoSuchMethodError: 'org.springframework.http.HttpStatus org.springframework.http.ResponseEntity.getStatusCode()'
	at at.porscheinformatik.weblate.spring.WeblateMessageSource.loadCodes(WeblateMessageSource.java:407)
	at at.porscheinformatik.weblate.spring.WeblateMessageSource.loadTranslation(WeblateMessageSource.java:335)
	at at.porscheinformatik.weblate.spring.WeblateMessageSource.loadTranslations(WeblateMessageSource.java:305)
	at at.porscheinformatik.weblate.spring.WeblateMessageSource.getAllProperties(WeblateMessageSource.java:439)
@derkoe derkoe added the bug Something isn't working label Jan 13, 2023
@derkoe derkoe self-assigned this Jan 13, 2023
@derkoe
Copy link
Contributor Author

derkoe commented Jan 13, 2023

Spring 6.x broke the API compatibility: spring-projects/spring-framework#29813

derkoe added a commit that referenced this issue Jan 13, 2023
Spring changed the API of ReponseEntity with 6.x so that code compiled
with Spring 5.x will not work anymore. As a workaround we use
getStatusCodeValue instead of getStatusCode to make the library work
with both spring versions.

Also cleanup error handling of CompletableFuture data loading

Closes #59
derkoe added a commit that referenced this issue Jan 14, 2023
Spring changed the API of ReponseEntity with 6.x so that code compiled
with Spring 5.x will not work anymore. As a workaround we use
getStatusCodeValue instead of getStatusCode to make the library work
with both spring versions.

Also cleanup error handling of CompletableFuture data loading

Closes #59
derkoe added a commit that referenced this issue Jan 14, 2023
Spring changed the API of ReponseEntity with 6.x so that code compiled
with Spring 5.x will not work anymore. As a workaround we use
getStatusCodeValue instead of getStatusCode to make the library work
with both spring versions.

Also cleanup error handling of CompletableFuture data loading

Closes #59
derkoe added a commit that referenced this issue Jan 14, 2023
Spring changed the API of ReponseEntity with 6.x so that code compiled
with Spring 5.x will not work anymore. As a workaround we use
getStatusCodeValue instead of getStatusCode to make the library work
with both spring versions.

Also cleanup error handling of CompletableFuture data loading

Closes #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant