Skip to content

Commit

Permalink
Upgrade to Spring Boot 2.7.0 + fixed qualification of ambiguous bean
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed May 25, 2022
1 parent 0671064 commit 4b5d386
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
Expand All @@ -39,7 +40,10 @@ public class RestApiIndex extends AbstractRestController {
private final String contextPath;
private final List<OperationInfo> uiRestInfo;

public RestApiIndex(RequestMappingHandlerMapping handlerMapping, ServletContext servletContext) {
public RestApiIndex(
// The Qualifier is needed since Boot 2.7 where two candidates became available.
@Qualifier("requestMappingHandlerMapping") RequestMappingHandlerMapping handlerMapping,
ServletContext servletContext) {
contextPath = servletContext.getContextPath();
uiRestInfo = operationInfoStream(handlerMapping)
.filter(info -> info.handler.getBeanType().getName()
Expand Down
11 changes: 6 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.6</version>
<version>2.7.0</version>
<!-- This parent also declares dependencies listed here:
https://docs.spring.io/spring-boot/docs/2.6.6/reference/html/dependency-versions.html#dependency-versions
https://docs.spring.io/spring-boot/docs/2.7.0/reference/html/dependency-versions.html#dependency-versions
Or for current version of Spring Boot:
https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html
-->
Expand Down Expand Up @@ -214,8 +214,9 @@
<xmlunit.version>2.8.2</xmlunit.version>
<hibernate.version>5.5.3.Final</hibernate.version>
<!--
Default Spring Boot 2.6.6 uses H2 1.4.200 but that one has NPE bug:
https://github.com/h2database/h2database/issues/1808
Default Spring Boot 2.7.0 uses H2 2.1.x, which is a big step from our current.
Every upgrade after v193 up to 1.4.200 had issues for use, some are probably fixed like this NPE bug
https://github.com/h2database/h2database/issues/1808, but we don't know how many changes to expect.
Sometimes occurs on heavy concurrent test, e.g. on TestDummyParallelism, but also during app run.
This bug was introduced in 1.4.198, which was major version that also changed queries in OrgClosureManager.
Between 1.4.197 and 198 changes of OrgClosureManager and around MVCC must be made (see commit history).
Expand All @@ -227,7 +228,7 @@
<!-- Spring Boot parent declares most fresh versions for JDBC drivers for all our servers -->
<wicket.version>9.10.0</wicket.version>
<wicket.chartjs.version>0.1</wicket.chartjs.version>
<!-- Groovy 3.0.10 is also default for Spring Boot 2.6.6 -->
<!-- Groovy 3.0.10 is also default for Spring Boot 2.7.0 -->
<groovy.version>3.0.10</groovy.version>
<xmlsec.version>2.2.3</xmlsec.version>
<!-- NOTE: also update the version number in TestConnectorManager -->
Expand Down

0 comments on commit 4b5d386

Please sign in to comment.