mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Work around the behaviour change in latest Spring 4.2 snapshots
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.
This commit is contained in:
parent
54e12a07e6
commit
2085a5b0cf
@ -40,7 +40,7 @@ import org.springframework.util.SocketUtils;
|
||||
public class SampleTomcatTwoConnectorsApplication {
|
||||
|
||||
@Bean
|
||||
public int port() {
|
||||
public Integer port() {
|
||||
return SocketUtils.findAvailableTcpPort();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user