diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java index c15ec2a2917..7d9f2d55797 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java @@ -393,8 +393,7 @@ public class HealthIndicatorAutoConfigurationTests { @Test public void elasticSearchHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs", + "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); this.context.register(ElasticsearchAutoConfiguration.class, ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); @@ -411,8 +410,7 @@ public class HealthIndicatorAutoConfigurationTests { public void notElasticSearchHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, "management.health.elasticsearch.enabled:false", - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs", + "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); this.context.register(ElasticsearchAutoConfiguration.class, ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorTests.java index f6034ee20a8..22faa933da5 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ElasticsearchHealthIndicatorTests.java @@ -23,13 +23,13 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.client.AdminClient; import org.elasticsearch.client.Client; import org.elasticsearch.client.ClusterAdminClient; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlocks; +import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.RoutingTable; import org.junit.Before; @@ -176,9 +176,9 @@ public class ElasticsearchHealthIndicatorTests { private StubClusterHealthResponse(ClusterHealthStatus status) { super("test-cluster", new String[0], - new ClusterState(null, 0, null, RoutingTable.builder().build(), + new ClusterState(null, 0, null, null, RoutingTable.builder().build(), DiscoveryNodes.builder().build(), - ClusterBlocks.builder().build(), null)); + ClusterBlocks.builder().build(), null, false)); this.status = status; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.java index 2e286cdd4b9..c35f3a75ac5 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.java @@ -26,7 +26,7 @@ import org.apache.commons.logging.LogFactory; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.settings.ImmutableSettings; +import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeBuilder; @@ -62,6 +62,7 @@ public class ElasticsearchAutoConfiguration implements DisposableBean { Map defaults = new LinkedHashMap(); defaults.put("http.enabled", String.valueOf(false)); defaults.put("node.local", String.valueOf(true)); + defaults.put("path.home", System.getProperty("user.dir")); DEFAULTS = Collections.unmodifiableMap(defaults); } @@ -95,7 +96,7 @@ public class ElasticsearchAutoConfiguration implements DisposableBean { } private Client createNodeClient() throws Exception { - ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder(); + Settings.Builder settings = Settings.settingsBuilder(); for (Map.Entry entry : DEFAULTS.entrySet()) { if (!this.properties.getProperties().containsKey(entry.getKey())) { settings.put(entry.getKey(), entry.getValue()); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 80d61fcb9a5..aeaad83b98a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -72,6 +72,7 @@ import org.springframework.util.StringUtils; * @author Ivan Sopov * @author Marcos Barbero * @author Eddú Meléndez + * @author Quinten De Swaef */ @ConfigurationProperties(prefix = "server", ignoreUnknownFields = true) public class ServerProperties @@ -580,6 +581,11 @@ public class ServerProperties */ private int maxThreads = 0; // Number of threads in protocol handler + /** + * Minimum amount of worker threads. + */ + private int minSpareThreads = 0; // Minimum spare threads in protocol handler + /** * Maximum size in bytes of the HTTP message header. */ @@ -598,6 +604,14 @@ public class ServerProperties this.maxThreads = maxThreads; } + public int getMinSpareThreads() { + return this.minSpareThreads; + } + + public void setMinSpareThreads(int minSpareThreads) { + this.minSpareThreads = minSpareThreads; + } + public int getMaxHttpHeaderSize() { return this.maxHttpHeaderSize; } @@ -684,6 +698,9 @@ public class ServerProperties if (this.maxThreads > 0) { customizeMaxThreads(factory); } + if (this.minSpareThreads > 0) { + customizeMinThreads(factory); + } if (this.maxHttpHeaderSize > 0) { customizeMaxHttpHeaderSize(factory); } @@ -747,6 +764,22 @@ public class ServerProperties }); } + @SuppressWarnings("rawtypes") + private void customizeMinThreads(TomcatEmbeddedServletContainerFactory factory) { + factory.addConnectorCustomizers(new TomcatConnectorCustomizer() { + @Override + public void customize(Connector connector) { + + ProtocolHandler handler = connector.getProtocolHandler(); + if (handler instanceof AbstractProtocol) { + AbstractProtocol protocol = (AbstractProtocol) handler; + protocol.setMinSpareThreads(Tomcat.this.minSpareThreads); + } + + } + }); + } + @SuppressWarnings("rawtypes") private void customizeMaxHttpHeaderSize( TomcatEmbeddedServletContainerFactory factory) { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java index c65a31df272..320c490c5eb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java @@ -57,8 +57,7 @@ public class ElasticsearchAutoConfigurationTests { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.foo.bar:baz", - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs"); + "spring.data.elasticsearch.properties.path.home:target"); this.context.register(PropertyPlaceholderAutoConfiguration.class, ElasticsearchAutoConfiguration.class); this.context.refresh(); @@ -74,8 +73,7 @@ public class ElasticsearchAutoConfigurationTests { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.foo.bar:baz", - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs", + "spring.data.elasticsearch.properties.path.home:target", "spring.data.elasticsearch.properties.node.local:false", "spring.data.elasticsearch.properties.node.data:true", "spring.data.elasticsearch.properties.http.enabled:true"); @@ -109,8 +107,7 @@ public class ElasticsearchAutoConfigurationTests { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.cluster-nodes:localhost", - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs"); + "spring.data.elasticsearch.properties.path.home:target"); this.context.register(PropertyPlaceholderAutoConfiguration.class, ElasticsearchAutoConfiguration.class); this.thrown.expect(BeanCreationException.class); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java index d9d9a13a2f9..03fc86bbf2a 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchRepositoriesAutoConfigurationTests.java @@ -89,8 +89,7 @@ public class ElasticsearchRepositoriesAutoConfigurationTests { private void addElasticsearchProperties(AnnotationConfigApplicationContext context) { EnvironmentTestUtils.addEnvironment(context, - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs"); + "spring.data.elasticsearch.properties.path.home:target"); } @Configuration diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index 9a0a97bc917..a72fcc6b1a3 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -62,6 +62,7 @@ import static org.mockito.Mockito.verify; * @author Andy Wilkinson * @author Phillip Webb * @author Eddú Meléndez + * @author Quinten De Swaef */ public class ServerPropertiesTests { @@ -258,6 +259,14 @@ public class ServerPropertiesTests { assertThat(this.properties.getTomcat().getMaxHttpHeaderSize()).isEqualTo(9999); } + @Test + public void testCustomizeTomcatMinSpareThreads() throws Exception { + Map map = new HashMap(); + map.put("server.tomcat.min-spare-threads", "10"); + bindProperties(map); + assertThat(this.properties.getTomcat().getMinSpareThreads()).isEqualTo(10); + } + @Test public void customizeTomcatDisplayName() throws Exception { Map map = new HashMap(); diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 1d3b6f823cd..6d6f4fb0ddf 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -70,7 +70,7 @@ 1.50.2 3.2.1 2.3.23 - 1.7.5 + 2.2.0 8.2.0 3.0.0 1.12 @@ -105,6 +105,7 @@ 9.2.15.v20160210 2.2.0.v201112011158 1.12 + 4.2.2 2.9.2 1.3.3 3.7.2 @@ -951,6 +952,11 @@ mysql-connector-java ${mysql.version} + + net.java.dev.jna + jna + ${jna.version} + net.sf.ehcache ehcache diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index afad598c8b0..57a96cde136 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -204,6 +204,7 @@ content into your application; rather pick only the properties that you need. 172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3} # regular expression matching trusted IP addresses. server.tomcat.max-http-header-size=0 # Maximum size in bytes of the HTTP message header. server.tomcat.max-threads=0 # Maximum amount of worker threads. + server.tomcat.min-spare-threads=0 # Minimum amount of worker threads. server.tomcat.port-header=X-Forwarded-Port # Name of the HTTP header used to override the original port value. server.tomcat.protocol-header= # Header that holds the incoming protocol, usually named "X-Forwarded-Proto". server.tomcat.protocol-header-https-value=https # Value of the protocol header that indicates that the incoming request uses SSL. diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 72b0eee3576..bb3af00c980 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3214,11 +3214,24 @@ dependencies in a convenient way. [[boot-features-connecting-to-elasticsearch]] ==== Connecting to Elasticsearch You can inject an auto-configured `ElasticsearchTemplate` or Elasticsearch `Client` -instance as you would any other Spring Bean. By default the instance will attempt to -connect to a local in-memory server (a `NodeClient` in Elasticsearch terms), but you can -switch to a remote server (i.e. a `TransportClient`) by setting +instance as you would any other Spring Bean. By default the instance will embed a +local in-memory server (a `Node` in ElasticSearch terms) and use the current working +directory as the home directory for the server. In this setup, the first thing to do +is to tell ElasticSearch were to store its files: + +[source,properties,indent=0] +---- + spring.data.elasticsearch.properties.path.home=/foo/bar +---- + +Alternatively, you can switch to a remote server (i.e. a `TransportClient`) by setting `spring.data.elasticsearch.cluster-nodes` to a comma-separated '`host:port`' list. +[source,properties,indent=0] +---- + spring.data.elasticsearch.cluster-nodes=localhost:9300 +---- + [source,java,indent=0] ---- @Component diff --git a/spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml b/spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml index f9978cf308f..f6cbc4408eb 100644 --- a/spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml +++ b/spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml @@ -26,6 +26,13 @@ org.springframework.boot spring-boot-starter-data-elasticsearch + + + net.java.dev.jna + jna + runtime + + org.springframework.boot spring-boot-starter-test diff --git a/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/resources/application.properties new file mode 100644 index 00000000000..8ed51d8ad79 --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/resources/application.properties @@ -0,0 +1,5 @@ +# +# Home directory of the embedded elastic instance. Default to the +# current working directory. +# +spring.data.elasticsearch.properties.path.home=target/elastic \ No newline at end of file diff --git a/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/test/java/sample/data/elasticsearch/SampleElasticsearchApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/test/java/sample/data/elasticsearch/SampleElasticsearchApplicationTests.java index 3940a565a29..c94efe24e9e 100644 --- a/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/test/java/sample/data/elasticsearch/SampleElasticsearchApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/test/java/sample/data/elasticsearch/SampleElasticsearchApplicationTests.java @@ -33,19 +33,13 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Artur Konczak */ public class SampleElasticsearchApplicationTests { - - private static final String[] PROPERTIES = { - "spring.data.elasticsearch.properties.path.data:target/data", - "spring.data.elasticsearch.properties.path.logs:target/logs" }; - @Rule public OutputCapture outputCapture = new OutputCapture(); @Test public void testDefaultSettings() throws Exception { try { - new SpringApplicationBuilder(SampleElasticsearchApplication.class) - .properties(PROPERTIES).run(); + new SpringApplicationBuilder(SampleElasticsearchApplication.class).run(); } catch (IllegalStateException ex) { if (serverNotRunning(ex)) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainer.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainer.java index 678702dd42e..b7bab2cb4b6 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainer.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainer.java @@ -61,6 +61,7 @@ import org.springframework.util.StringUtils; * @author Ivan Sopov * @author Andy Wilkinson * @author Eddú Meléndez + * @author Christoph Dreis * @since 1.2.0 * @see UndertowEmbeddedServletContainerFactory */ @@ -87,21 +88,105 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine private boolean started = false; + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param port the port to listen on (not used) + * @param autoStart if the server should be started + * @param compression compression configuration + * @deprecated as of 1.4 in favor of + * {@link #UndertowEmbeddedServletContainer(Builder, DeploymentManager, String, boolean, Compression)} + */ + @Deprecated public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, String contextPath, int port, boolean autoStart, Compression compression) { - this(builder, manager, contextPath, port, false, autoStart, compression); + this(builder, manager, contextPath, false, autoStart, compression); } + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param port the port to listen on (not used) + * @param useForwardHeaders if x-forward headers should be used + * @param autoStart if the server should be started + * @param compression compression configuration + * @deprecated as of 1.4 in favor of + * {@link #UndertowEmbeddedServletContainer(Builder, DeploymentManager, String, boolean, boolean, Compression)} + */ + @Deprecated public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, String contextPath, int port, boolean useForwardHeaders, boolean autoStart, Compression compression) { - this(builder, manager, contextPath, port, useForwardHeaders, autoStart, - compression, null); + this(builder, manager, contextPath, useForwardHeaders, autoStart, compression); } + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param port the port to listen on (not used) + * @param useForwardHeaders if x-forward headers should be used + * @param autoStart if the server should be started + * @param compression compression configuration + * @param serverHeader string to be used in http header + * @deprecated as of 1.4 in favor of + * {@link #UndertowEmbeddedServletContainer(Builder, DeploymentManager, String, boolean, boolean, Compression, String)} + */ + @Deprecated public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, String contextPath, int port, boolean useForwardHeaders, boolean autoStart, Compression compression, String serverHeader) { + this(builder, manager, contextPath, useForwardHeaders, autoStart, compression, + serverHeader); + } + + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param autoStart if the server should be started + * @param compression compression configuration + */ + public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, + String contextPath, boolean autoStart, Compression compression) { + this(builder, manager, contextPath, false, autoStart, compression); + } + + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param useForwardHeaders if x-forward headers should be used + * @param autoStart if the server should be started + * @param compression compression configuration + */ + public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, + String contextPath, boolean useForwardHeaders, boolean autoStart, + Compression compression) { + this(builder, manager, contextPath, useForwardHeaders, autoStart, compression, + null); + } + + /** + * Create a new {@link UndertowEmbeddedServletContainer} instance. + * @param builder the builder + * @param manager the deployment manager + * @param contextPath root the context path + * @param useForwardHeaders if x-forward headers should be used + * @param autoStart if the server should be started + * @param compression compression configuration + * @param serverHeader string to be used in http header + */ + public UndertowEmbeddedServletContainer(Builder builder, DeploymentManager manager, + String contextPath, boolean useForwardHeaders, boolean autoStart, + Compression compression, String serverHeader) { this.builder = builder; this.manager = manager; this.contextPath = contextPath; @@ -231,10 +316,10 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine } private Port getPortFromChannel(BoundChannel channel) { - String protocol = ReflectionUtils.findField(channel.getClass(), "ssl") != null - ? "https" : "http"; SocketAddress socketAddress = channel.getLocalAddress(); if (socketAddress instanceof InetSocketAddress) { + String protocol = ReflectionUtils.findField(channel.getClass(), "ssl") != null + ? "https" : "http"; return new Port(((InetSocketAddress) socketAddress).getPort(), protocol); } return null; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java index 02ac6cb5fc9..2ab91ecc784 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java @@ -501,8 +501,7 @@ public class UndertowEmbeddedServletContainerFactory protected UndertowEmbeddedServletContainer getUndertowEmbeddedServletContainer( Builder builder, DeploymentManager manager, int port) { return new UndertowEmbeddedServletContainer(builder, manager, getContextPath(), - port, isUseForwardHeaders(), port >= 0, getCompression(), - getServerHeader()); + isUseForwardHeaders(), port >= 0, getCompression(), getServerHeader()); } @Override diff --git a/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionExceptionFailureAnalyzer.java b/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionExceptionFailureAnalyzer.java index 6c648a40b11..e6d795bfbd1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionExceptionFailureAnalyzer.java +++ b/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionExceptionFailureAnalyzer.java @@ -64,7 +64,6 @@ class NoUniqueBeanDefinitionExceptionFailureAnalyzer message.append(String.format("%s required a single bean, but %d were found:%n", getConsumerDescription(unsatisfiedDependency), beanNames.length)); for (String beanName : beanNames) { - unsatisfiedDependency.getInjectionPoint(); try { BeanDefinition beanDefinition = this.beanFactory .getMergedBeanDefinition(beanName);