From 2085a5b0cfce9dcb61173883319bdadf51adbb05 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 16 Apr 2015 10:59:36 +0100 Subject: [PATCH] Work around the behaviour change in latest Spring 4.2 snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The changes made in spring-projects/spring-framework@e403aefe cause SampleTomcatTwoConnectorsApplication to fail to launch. The port bean, typed as an int, is coerced into an Integer when the bean’s created. The port() method is then called, and the proxy’s bean method interceptor complains as it’s expecting the port bean to be an int but it’s actually an Integer. Changing the port() bean method’s return type to Integer works around the problem. --- .../sample/tomcat/SampleTomcatTwoConnectorsApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java b/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java index 68f5704627b..3bf7fb3bb25 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java @@ -40,7 +40,7 @@ import org.springframework.util.SocketUtils; public class SampleTomcatTwoConnectorsApplication { @Bean - public int port() { + public Integer port() { return SocketUtils.findAvailableTcpPort(); }