You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "nrknithin (via GitHub)" <gi...@apache.org> on 2026/05/11 18:23:34 UTC
[PR] [WIP] DO NOT MERGE!!!! - Springboot 4.0.x upgrade [incubator-kie-kogito-examples]
nrknithin opened a new pull request, #2210:
URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2210
Kie-Issue: https://github.com/apache/incubator-kie-issues/issues/2288
Related PRs
- Drools: https://github.com/apache/incubator-kie-drools/pull/6686
- Optaplanner: https://github.com/apache/incubator-kie-optaplanner/pull/3221
- Kogito Runtimes: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4270
- Kogito Apps: https://github.com/apache/incubator-kie-kogito-apps/pull/2331
### Summary
Migrate kogito-examples' Spring Boot examples from **Spring Boot 3.5.x → 4.0.5** (inherited via `kogito-build-no-bom-parent`). Covers all 38+ Spring Boot example modules + the two Spring Boot Gradle examples. Quarkus example modules absorb the Hibernate / graphql-java / Netty bumps via the shared kogito-dependencies-bom but otherwise unchanged.
### What changed
**SB 4 module-split adaptations (Java imports)**
- `EntityScan`, `CacheMetricsAutoConfiguration`, `RestTemplateBuilder` — relocated in SB 4.0 to new artifacts (`spring-boot-persistence`, `spring-boot-cache`, `spring-boot-restclient`). Imports updated in 4 source files; matching `spring-boot-cache` / `spring-boot-restclient` deps added to `onboarding-springboot`, `process-decisions-rest-springboot`, `process-rest-service-call-springboot` poms.
- `@AutoConfigureObservability` — **removed** in SB 4; observability auto-config is on by default in tests. Annotation + import dropped from 4 test classes (`DashboardsListTest`, `DroolsMetricsTest`, `LoanEligibilityTest`, `ProcessMetricsTest`).
- Spring Cloud Kubernetes 5 renamed `Kubernetes*AutoConfiguration` → `Fabric8*AutoConfiguration` (Fabric8 vs Kubernetes-Client variants in the same package). `KogitoOnboardingApplication`'s `@SpringBootApplication(exclude = …)` updated accordingly.
- Spring Security 7 removed the chained `HttpSecurity` DSL. Two `DefaultWebSecurityConfig` classes migrated to the lambda DSL (`process-usertasks-with-security-springboot`, `process-usertasks-with-security-oidc-springboot`).
**Netty 4.1 (Quarkus) vs 4.2 (SB) split**
- `kogito-springboot-examples/pom.xml`: added `<version.io.netty>4.2.12.Final</version.io.netty>` + per-artifact pins for the 11 netty-* artifacts SB transitively pulls in. Mirrors the existing block in `3-kogito-runtimes/springboot/pom.xml`. Without this, Infinispan 15.x's Hot Rod client throws `NoClassDefFoundError: io/netty/channel/IoHandle` (Netty 4.2-only class) on the SB side because the shared `kogito-dependencies-bom` keeps Netty on the 4.1.x line for Quarkus / Vert.x 4.5.x compatibility. Centralizing the pins in `kogito-spring-boot-bom` was attempted but does not work — parent-chain-imported BOM entries (kogito-dependencies-bom Netty 4.1) beat module-imported BOM entries via Maven's first-wins rule.
**Spring Boot 4 / Infinispan transition shim**
- `process-infinispan-persistence-springboot/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java`: empty stub class at the legacy SB 3 FQN. `org.infinispan:infinispan-spring-boot3-starter-remote:15.2.6.Final` still declares `@AutoConfigureBefore(CacheAutoConfiguration.class)` against the old FQN; SB 4 relocated it. Mirrors the same stub already present in 3-kogito-runtimes' SB Infinispan IT module.
**Jackson 2 transition shims (SB 4 only auto-configures Jackson 3 ObjectMapper)**
- `onboarding-springboot/src/main/java/org/kie/kogito/examples/JacksonHttpMessageConverterConfig.java`: local `@Bean MappingJackson2HttpMessageConverter` with `canWrite(String) → false` override. Onboarding has no rule units (so no codegen-generated `RestObjectMapper` to provide it), and its `payroll.paymentDate` JSON-path assertion expects the local-timezone format produced by the Jackson 2 ObjectMapper (Jackson 3 default writes UTC `Z`). The `canWrite` override on `String.class` lets pre-serialized String response bodies flow through Spring's `StringHttpMessageConverter` instead of being JSON-quoted by Jackson 2.
- Upstream codegen change (in this PR's *Related PRs*): `RestObjectMapperSpringTemplate` in drools now registers the same `@Bean MappingJackson2HttpMessageConverter` for rule-unit modules, so DMN+rule-unit examples (e.g. `dmn-drools-springboot-metrics`, `decisiontable-springboot-example`, `ruleunit-springboot-example`) get it via codegen.
**Gradle examples (two modules)**
- `springBootVersion` `3.5.12` → `4.0.5` in both Gradle modules' `gradle.properties` (was producing `cannot find symbol: method asMultiValueMap()` on the codegen-generated REST resource — codegen targets Spring 7 / SB 4 but Gradle was still on SB 3).
- `ext['groovy.version'] = '4.0.29'` added to both `build.gradle` files. SB 4.0.5 ships Groovy 5.0.4 via spring-boot-dependencies, but RestAssured 5.5.6 (managed by `kogito-dependencies-bom`) was compiled against Groovy 4 and throws `NullPointerException` in `MetaClassImpl.getMetaProperty` under Groovy 5. Aligns the Gradle classpath with the Maven side (which pins Groovy 4.0.29 in `kogito-spring-boot-bom`).
### Why no Jackson 3 migration here
Same constraint as kogito-runtimes / kogito-apps: `kogito-events-core`'s `JacksonEventDataUnmarshaller` exposes `com.fasterxml.jackson.databind.ObjectMapper` and is shared between the SB and Quarkus sides. One-side migration forces the other; out of scope until the planned `kogito-dependencies-bom` split (common / springboot / quarkus) lands. The Jackson 2 converter shims (onboarding's local `@Bean` + the codegen template) are tagged with `TODO Jackson 3 migration`.
Verified with full `mvn clean install` — all 123/123 modules pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2288] - Springboot 4.0.x upgrade [incubator-kie-kogito-examples]
Posted by "gitgabrio (via GitHub)" <gi...@apache.org>.
gitgabrio merged PR #2210:
URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2210
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2288] - Springboot 4.0.x upgrade [incubator-kie-kogito-examples]
Posted by "nrknithin (via GitHub)" <gi...@apache.org>.
nrknithin commented on code in PR #2210:
URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2210#discussion_r3239673573
##########
gradle-examples/kogito-springboot-gradle-examples/dmn-springboot-gradle/build.gradle:
##########
@@ -33,6 +33,10 @@ repositories {
mavenLocal()
}
+// Pin Groovy 4 to match the Maven side: RestAssured 5.5.6 is compiled against Groovy 4 and trips
+// a NullPointerException under Groovy 5. TODO drop when RestAssured ships a Groovy 5 release.
+ext['groovy.version'] = '4.0.29'
Review Comment:
@yesamer SB 3.5's BOM shipped Groovy 4.x; SB 4.0.5's ships Groovy 5.x. RestAssured 5.5.6 (pinned by kogito-dependencies-bom) is compiled against Groovy 4 and throws a NullPointerException in MetaClassImpl.getMetaProperty under Groovy 5 — so under SB 4 we pin Groovy 4.0.29 to match what the Maven side does in kogito-spring-boot-bom. The NPE is inside RestAssured's own code (not ours), so the pin drops when they ship a Groovy 5–compatible release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2288] - Springboot 4.0.x upgrade [incubator-kie-kogito-examples]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2210:
URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2210#discussion_r3232855563
##########
gradle-examples/kogito-springboot-gradle-examples/dmn-springboot-gradle/build.gradle:
##########
@@ -33,6 +33,10 @@ repositories {
mavenLocal()
}
+// Pin Groovy 4 to match the Maven side: RestAssured 5.5.6 is compiled against Groovy 4 and trips
+// a NullPointerException under Groovy 5. TODO drop when RestAssured ships a Groovy 5 release.
+ext['groovy.version'] = '4.0.29'
Review Comment:
@nrknithin I read the reason for this change in the description, but it’s not clear to me why it wasn’t previously needed with SB3.
##########
kogito-springboot-examples/onboarding-springboot/src/main/java/org/kie/kogito/examples/JacksonHttpMessageConverterConfig.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.examples;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+// Register a Jackson 2 HTTP converter for this module: it has no rule units, so the
+// codegen-generated RestObjectMapper that normally provides one is not produced here.
+// canWrite refuses String so DMN controllers' pre-serialized JSON passes through StringHttpMessageConverter.
+// TODO drop in lock-step with the Jackson 3 migration.
Review Comment:
@nrknithin Please add this in the same ticket I mentioned here https://github.com/apache/incubator-kie-drools/issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] [incubator-kie-issues#2288] - Springboot 4.0.x upgrade [incubator-kie-kogito-examples]
Posted by "nrknithin (via GitHub)" <gi...@apache.org>.
nrknithin commented on code in PR #2210:
URL: https://github.com/apache/incubator-kie-kogito-examples/pull/2210#discussion_r3239670663
##########
kogito-springboot-examples/onboarding-springboot/src/main/java/org/kie/kogito/examples/JacksonHttpMessageConverterConfig.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.examples;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+// Register a Jackson 2 HTTP converter for this module: it has no rule units, so the
+// codegen-generated RestObjectMapper that normally provides one is not produced here.
+// canWrite refuses String so DMN controllers' pre-serialized JSON passes through StringHttpMessageConverter.
+// TODO drop in lock-step with the Jackson 3 migration.
Review Comment:
Done — this file's Jackson 2 HTTP converter already links to [drools#6702](https://github.com/apache/incubator-kie-drools/issues/6702)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org