This repository was archived by the owner on Dec 20, 2025. It is now read-only.
chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x#4832
Closed
j-sandy wants to merge 7 commits intospinnaker:masterfrom
Closed
chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x#4832j-sandy wants to merge 7 commits intospinnaker:masterfrom
j-sandy wants to merge 7 commits intospinnaker:masterfrom
Conversation
… cloud from 2021.0.x to 2022.0.x Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5. Spring cloud release 2022.0.x is compatible with spring boot 3.0.x. https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases =============================================================================================== refactor(dependency): replace javax with jakarta during upgrade of spring boot 3.0.x Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades So, replacing the imports with `javax` to `jakarta`. =============================================================================================== refactor(jedis): migrate jedis from 3.x to 4.x during upgrade of spring boot 3.0.x Spring boot upgrade from 2.7.18 to 3.0.13, upgrades `redis.clients:jedis` from 3.8.0 to 4.3.2. So, migrating jedis from 3.x to 4.x by following the migration [document](https://github.com/redis/jedis/blob/master/docs/3to4.md) And for further changelogs, please refer [here](https://github.com/redis/jedis/releases/tag/v4.0.0) =============================================================================================== refactor(dependency): add explicit resilience4j-vavr dependency with spring boot upgrade to 3.x `io.vavr` dependency has been removed from resilience4j:2.0.2. https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0 Resilience4j comes as transitive dependency of spring-cloud-dependencies. https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5 So, adding explicit dependency of `resilience4j-vavr`
…ing boot 3.0.x Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs. https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0 https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0
…tus code with spring boot upgrade to 3.x
Upgrade of spring boot 3.0 brings springframework 6.0 as its transitive dependency. Springframework 6.0 has introduced unified HTTP status handling, that caused the below error:
```
> Task :orca-webhook:compileJava
orca/orca-webhook/src/main/java/com/netflix/spinnaker/orca/webhook/tasks/MonitorWebhookTask.java:130: error: incompatible types: HttpStatusCode cannot be converted to HttpStatus
if (shouldRetry(statusCode, stageData)) {
^
orca/orca-webhook/src/main/java/com/netflix/spinnaker/orca/webhook/tasks/MonitorWebhookTask.java:175: error: incompatible types: HttpStatusCode cannot be converted to HttpStatus
monitor.setStatusCode(response.getStatusCode());
^
orca/orca-webhook/src/main/java/com/netflix/spinnaker/orca/webhook/tasks/WebhookResponseProcessor.java:85: error: incompatible types: HttpStatusCode cannot be converted to HttpStatus
webhookOutput.setStatusCode(e.getStatusCode());
^
orca/orca-webhook/src/main/java/com/netflix/spinnaker/orca/webhook/tasks/WebhookResponseProcessor.java:93: error: incompatible types: HttpStatusCode cannot be converted to HttpStatus
TaskResult result = processReceivedFailureStatusCode(e.getStatusCode(), webhookOutput);
^
orca/orca-webhook/src/main/java/com/netflix/spinnaker/orca/webhook/tasks/WebhookResponseProcessor.java:165: error: incompatible types: HttpStatusCode cannot be converted to HttpStatus
webhookOutput.setStatusCode(response.getStatusCode());
^
```
In order to fix this issue, refactor the code using `HttpStatusCode` interface implemented by `HttpStatus`.
https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x/d1a3285d5f7658ac716ad4193131102e6f2f50c1#general-web-revision
…uring upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
```
WebhookServiceSpec > Webhook is being called with correct parameters > com.netflix.spinnaker.orca.webhook.service.WebhookServiceSpec.Webhook is being called with correct parameters [payload: [payload1:Hello, payload2:World!], customHeaders: [:], #1] FAILED
java.lang.IllegalArgumentException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
at com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:3442)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.contextToNode(StageExecutionImpl.java:680)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:623)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:608)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.getRestTemplateData(WebhookService.java:117)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.callWebhook(WebhookService.java:65)
at com.netflix.spinnaker.orca.webhook.service.WebhookServiceSpec.Webhook is being called with correct parameters(WebhookServiceSpec.groovy:99)
Caused by:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
WebhookServiceSpec > Should accept PATCH request FAILED
Expected no exception to be thrown, but got 'java.lang.IllegalArgumentException'
at app//spock.lang.Specification.noExceptionThrown(Specification.java:123)
at com.netflix.spinnaker.orca.webhook.service.WebhookServiceSpec.Should accept PATCH request(WebhookServiceSpec.groovy:201)
Caused by:
java.lang.IllegalArgumentException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
at com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:3442)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.contextToNode(StageExecutionImpl.java:680)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:623)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:608)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.getRestTemplateData(WebhookService.java:117)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.callWebhook(WebhookService.java:65)
at com.netflix.spinnaker.orca.webhook.service.WebhookServiceSpec.Should accept PATCH request(WebhookServiceSpec.groovy:198)
Caused by:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
at app//com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
at app//com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1306)
at app//com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:408)
at app//com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:53)
at app//com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30)
at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields(MapSerializer.java:869)
at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:760)
at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720)
at app//com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35)
at app//com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at app//com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at app//com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:3437)
... 6 more
MtlsConfigurationPemTest > mTLSConnectivityPemTest() FAILED
java.lang.IllegalArgumentException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
at com.fasterxml.jackson.databind.ObjectMapper.valueToTree(ObjectMapper.java:3442)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.contextToNode(StageExecutionImpl.java:680)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:623)
at com.netflix.spinnaker.orca.pipeline.model.StageExecutionImpl.mapTo(StageExecutionImpl.java:608)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.getRestTemplateData(WebhookService.java:117)
at com.netflix.spinnaker.orca.webhook.service.WebhookService.callWebhook(WebhookService.java:65)
at com.netflix.spinnaker.orca.webhook.config.MtlsConfigurationPemTest.mTLSConnectivityPemTest(MtlsConfigurationPemTest.java:86)
Caused by:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.http.HttpMethod and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.netflix.spinnaker.orca.pipeline.model.StageContext["method"])
at app//com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
at app//com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1306)
at
```
The root cause of issue is conversion of `HttpMethod` as class which was previously an enum, in Springframework 6.0. To fix this issue added custom serializer in object mapper.
https://docs.spring.vmware.com/spring-framework/docs/6.0.26/javadoc-api/org/springframework/http/HttpMethod.html
spring-projects/spring-framework#27697
…ring boot 3.0.x Removed @ConstructorBinding annotation as it is no longer required at the type level on @ConfigurationProperties classes. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M2-Release-Notes#constructingbinding-no-longer-needed-at-the-type-level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5.
Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases
===============================================================================================
refactor(dependency): replace javax with jakarta during upgrade of spring boot 3.0.x
Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with
javaxtojakarta.===============================================================================================
refactor(jedis): migrate jedis from 3.x to 4.x during upgrade of spring boot 3.0.x
Spring boot upgrade from 2.7.18 to 3.0.13, upgrades
redis.clients:jedisfrom 3.8.0 to 4.3.2.So, migrating jedis from 3.x to 4.x by following the migration document
And for further changelogs, please refer here
===============================================================================================
refactor(dependency): add explicit resilience4j-vavr dependency with spring boot upgrade to 3.x
io.vavrdependency has been removed from resilience4j:2.0.2.https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5
So, adding explicit dependency of
resilience4j-vavr===============================================================================================
refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x
Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava
And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0
===============================================================================================
refactor(http status code): refactor code to use the unified HTTP status code with spring boot upgrade to 3.x
Upgrade of spring boot 3.0 brings springframework 6.0 as its transitive dependency. Springframework 6.0 has introduced unified HTTP status handling, that caused the below error:
In order to fix this issue, refactor the code using
HttpStatusCodeinterface implemented byHttpStatus.https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x/d1a3285d5f7658ac716ad4193131102e6f2f50c1#general-web-revision
===============================================================================================
refactor(mapper): add custom serializer to handle HttpMethod object during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
The root cause of issue is conversion of
HttpMethodas class which was previously an enum, in Springframework 6.0. To fix this issue added custom serializer in object mapper.https://docs.spring.vmware.com/spring-framework/docs/6.0.26/javadoc-api/org/springframework/http/HttpMethod.html
spring-projects/spring-framework#27697
===============================================================================================
refactor(annotation): remove @ConstructorBinding during upgrade of spring boot 3.0.x
Removed @ConstructorBinding annotation as it is no longer required at the type level on @ConfigurationProperties classes.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M2-Release-Notes#constructingbinding-no-longer-needed-at-the-type-level
===============================================================================================