Update `ConfigFileApplicationListener` to correctly load properties
that have `spring.profiles` values containing a list.
Prior to this commit the loaded would attempt to add the same document
twice resulting in a "property source cannot be added relative to
itself" error.
Closes gh-13362
Update `ConfigFileApplicationListener` to ensure that a
`spring.profiles.include` property that refers to an already processed
profile doesn't cause an infinite loop.
Closes gh-13361
Update `ConfigFileApplicationListener` so that `spring.profiles.include`
properties do not override higher priority active profiles.
This commit also changes when profiles get added to the environment.
Profiles are now added to the environment at the time of profile
processing so that they get logged in the order that they are processed.
Closes gh-13151
Update `InetAddressFormatterTests` to ensure that DNS resolvers that
return a "help" page for missing domains don't cause the build to fail.
Closes gh-11897
Previously, WebMvcTags would fall back to using the request’s path
info if Spring MVC’s best matching path pattern attribute was not
available. For non-Spring MVC web frameworks that support path
variables, such as Jersey, this led to an explosion of URI tags that
could exhaust the heap.
Closes gh-12447
Port "setHttpOnly on the TomcatContext" fix from commit 4d84933ee4 to
2.0.x. Since `Session` details are now configured on the
`WebServerFactory` we can directly configure the context.
See gh-12580
For Tomcat, if an SslStoreProvider is configured,
`SslStoreProviderUrlStreamHandlerFactory` stores the trust-store with an
empty password. Previously, if a password was supplied using the
ssl.trust-store-password property, that would be the password used to
load the trust-store and the connector would warn with "Password
verification failed" message.
Fixes gh-12688
This commit fixes endpoint extension discovery when the related endpoint
is sub-classed. Previously, a strict by type check was applied against
the `endpoint` attribute of `EndpointExtension`.
Rather than using a `Class` check, this commit extracts the id of an
endpoint and uses it to match its extension, if any.
Closes gh-13082
The ConnectionFactory can be used early in user configuration to
configure an `Exchange`. Such connection may not hold the proper
MetricCollector and can be cached, leading to missed metrics
information.
This commit moves the configuration of RabbitMQ metrics to a
BeanPostProcessor so that the proper MetricCollector is configured
before any connection is created.
Closes gh-12855
Some Quartz initialization scripts have comments in a different format.
This commit introduces a `comment-prefix` property that should be set by
the user if their target database has a script that contains those
unusual comments.
Closes gh-13041
Previously, when an empty String was bound to a collection or
array of rich types it would fail as there was no converter capable
of creating a Collection<RichType> or RichType[] from the String.
This commit updates IndexedElementsBinder to apply special treatment
to empty String values. Now, when such a value is being processed,
an empty Collection or array is the result.
Closes gh-12965
Previously, when the Jersey-based Actuator was configure with a
separate management port, the resulting child context would fail to
start due to their being no ResourceConfigCustomizer beans available.
This commit updates the configuration so that the customizer's are
injected using an ObjectProvider and an empty list is used in the
event of their being no customizer beans. This aligns the child
context configuration class with JerseyAutoConfiguration which
already used this approach.
Closes gh-12975
This commit removes Hibernate imports from JpaProperties so that it can
be used with another JPA provider.
This commit is a breaking change for an internal, yet public class used
to transmit customizations provided by the user. It does not change the
external functionality though: naming strategies defined as bean are
still taken into account and a customizer has a chance to override it
regardless.
Closes gh-13043
Upgrading the JDK 9-based build to use JDK 9.0.4 has revealed that
Gradle 4.0.x doesn't work with it as it fails to parse the 9.0.4
version number.
This commit disables building the Gradle plugin on Java 9 (as we
had already done for Java 10) until we decide what to do
(see gh-12333).
There are documented way to reuse bits of the infrastructure in user
config to offer similar datasource configuration. If that fails, the
regular failure there will kick in.
This commit improves `DataSourceBeanCreationFailureAnalyzer` to not
misguide users that the auto-configuration has failed. Rather, it
describes what has failed in a more generic way.
Closes gh-12947
NettyReactiveWebServerFactoryTests.portInUseExceptionIsThrownWhenPortIsAlreadyInUse
started failing on CI following this change in reactor netty:
e6634c27f6
Instead of a `BindException`, a `NativeIoException` is thrown. Since that Exception
is for internal use only, we throw a generic `WebServerException`
instead of the `PortInUseException`.
This commit excludes `com.rabbitmq:http-client` from `spring-rabbit` as
the former brings spring webflux for an optional feature. This also
prevents Spring Boot to consider that a web server should be started as
all the necessary pieces are unexpectedly present.
Closes gh-12853
While being able to exclude all artifacts of a given group is a handy
feature, excluding all artifacts with a given artifactId does not make
much sense as it should refer to a single artifact anyway. Also the
general "exclude" mechanism is meant to do the exact same thing.
Closes gh-12885
For tomcat, if an SslStoreProvider is configured,
`SslStoreProviderUrlStreamHandlerFactory` stores the keyStore with an
empty password. Previously, if a password was supplied using the
ssl.key-store-password property, that would be the password used to
load the keystore and the connector would fail with a
"Password verification failed" exception.
Fixes gh-11391
Since https://jira.spring.io/browse/SPR-16624, the contract for
`ContentNegotiationStrategy` has been refined and should never return an
empty list if it's got no preference for a media type, but it should
rather respond with a `"*/*"` instead.
This commit fixes the `OptionalPathExtensionContentNegotiationStrategy`
defined in the Spring MVC auto-configuration to have that behavior.
Fixes gh-12900
This commit includes some refactoring of active profiles
processing. Previously, there was a LIFO Queue for adding active
profiles. Profiles that were added last, were processed first.
Because of this reverse ordering, profiles were prepended to the
environment to preserve the order in which they were logged.
This however didn't work for "included" profiles as they were
prepended to the environment even though they were processed after
the active profile. In this commit, profiles are processed in a FIFO manner
and processed as they're found.
Fixes gh-11380
This commit makes sure to respect the MBeanServer#invoke contract by
wrapping any user-defined exception in an MBeanException. Also, any
exception not from the JDK is translated, as it may lead to unexpected
issue on the client if that class isn't present. This is consistent
with our operation result mapping strategy.
Closes gh-10448
As pointed out by Rossen in gh-11514 comments, a handler might commit
the response and then send an error signal in the pipeline. In this
case, adding a callback to `beforeCommit` is useless because it won't be
triggered. In those cases, we need to collect metrics right away.
This commits make sure that the Quartz auto-configuration no longer
associates an `Executor` bean if present in the context as Quartz offers
properties to tune it, which would mutate and lead to unexpected
results.
Closes gh-12823
Spring Boot now deploys both annotation-based and functional endpoints
under the same `HttpHandler`; this means the currently auto-configured
`MetricsWebFilter` is instrumenting all endpoints to produce metrics.
There is no need for a WebFlux functional specific support.
This commit removes mentions of `RouterFunctionMetrics` in the docs and
deprecates that class.
Closes gh-12833
Prior to this commit, the metrics `WebFilter` would handle exceptions
flowing through the pipeline and extract tag information right away.
Since error handling turns the exception information into error HTTP
responses later in the chain, the information extracted from the
response earlier is invalid.
In this case, the "status" information could be "200" whereas error
handlers would later set that status to "500".
This commit delays the tags extraction later in the process, right
before the response is comitted. The happy path is not changed, as
handlers signal that the response is fully taken care of at that point.
Fixes gh-11514
Previously to this commit, if a `@ControllerEndpoint`,
`@RestControllerEndpoint` or `@ServletEndpoint` annotated bean was
proxied, the endpoint wasn't properly detected.
This commit makes sure that annotation retrieval works on the user class
while preserving the get (vs. find) retrieval semantic
Closes gh-12441
This commit makes sure that an auto-configuration that requires
`DataSourceProperties` will not break if `DataSourceAutoConfiguration`
has been explicitly excluded.
Closes gh-12512
Update `MeterRegistryConfigurer` to also apply customizers to
composite meter registries. Prior to this commit composites were
skipped due to the incorrect assumption that did not contain
their own state.
Closes gh-12762