This commit avoids printing the stacktrace for ResponseStatusException
in order to be consistent with WebFlux ResponseStatusExceptionHandler
and because this stacktrace is usually not very useful in Reactive
world and mainly pollutes the logs, only the message is logged in that
case.
It also logs a WARN message for Bad Request (400) HTTP responses in
order to have a feedback when an exception is thrown due to client error
(unable to deserialize request body for example).
See related SPR-15083 issue on Spring Framework side.
Remove custom `SpringIntegrationMetrics` and instead provide
auto-configuration to the direct Micrometer support added in Spring
Integration 5.0.2.
Closes gh-11985
This commit sets a mapping resources list only when there is at least an
element in it. This allows the default fallback of finding an "orm.xml"
file to kick in when no customization has been applied.
Closes gh-11964
This change updates SqlDialectLookup to delegate to jOOQ's JDBCUtils
rather than creating an additional mapping between
org.springframework.boot.jdbc.DatabaseDriver and org.jooq.SQLDialect.
This has the following advantages:
1. jOOQ's `SQLDialect` to URL mappings are already maintained by jOOQ,
so no additional changes will be necessary to Spring Boot in the
future.
2. Delegating to jOOQ means that the mapping also works for the
commercial jOOQ distributions, e.g. when working with DB2, Oracle,
SQL Server, etc., as the JDBCUtils of the commercial distribution
also contains the relevant logic to map to e.g. `SQLDialect.DB2`,
`SQLDialect.ORACLE`, `SQLDialect.SQLSERVER` (which are not
available from the open source distribution linked by Spring Boot
by default).
Closes gh-11466
The fix in Spring Data Redis for sentinel configuration means that
two Jedis sentinel tests now attempt to connect to a Sentinel. As a
result the tests fail. Running a Redis Sentinel in a Docker container
appears to be non-trivial. As an alternative, this commit updates the
tests to capture the JedisConnectionFactory prior to its
initialization (which is the failure trigger) and then assert that its
configuration is as expected.
See gh-11884
Closes gh-11855
Move `ApplicationHome`, `ApplicationPid` and `ApplicationTemp` to the
`system` package. Since `system` package is now much lower level, the
existing `FileWriter` implementations also needed to move to prevent
package tangles.
Fixes gh-8614
While Spring Mobile support has been removed from Spring Boot, the
auto-configuration has been relocated to a separate module that uses
the same keys.
Flagging those keys as deprecated means that the IDE will be confused
when the extra jar is present on the classpath as it advertizes, as
it should, support fo them.
Closes gh-11844
This commit enables a more flexible Liquibase/Flyway configuration by
allowing for a combination of the provider's and the primary
DataSource's configuration to be used. This gives developers the
flexibility to specify only a user or a url and having
Liquibase/Flyway fall back to individual datasource properties rather
than ignoring the Liquibase/Flyway properties and falling back to the
default data source.
See gh-11751
Previously, the logging system was cleaned up in response to the
root context's ContextClosedEvent being received. This event is
published early in a context's close processing. As a result, the
logging system is in cleaned up state while, for example, disposable
beans are being destroyed.
This commit reworks the logic that triggers logging system clean up
to use a disposable bean instead. Disposable beans are called in
reverse-registration order. The logging clean up bean is registered as
early as possible so that it should be the last disposable bean to
be called.
Closes gh-11676
Move the "testdb" naming logic to `DataSourceProperties` and expose
the `deduceDatabaseName` method so they can be used in
auto-configuration.
See gh-11719
Previously, Hikari's pool name was auto-configured with the value of
`spring.datasource.name` that defaults to `testdb`, which brings some
confusion.
This commit removes the default `testdb` value on
`spring.datasource.name` as it is a sane default only for an embedded
datasource. It is applied whenever applicable instead.
Closes gh-11719
This commit prevents the default error view from rendering itself if the
response has been committed already. In this case, it is impossible to
change the HTTP response status and write a proper response - trying to
do so often results in a `IllegalStateException` since the response body
has already been written to.
Fixes gh-11580
Previously, the ServletContext was configured after any
ServletContextInitializer beans had been initialized. This meant that
any configuration class that provided such a bean would be initialized
before the ServletContext was configured. If the configuration class
used the ServletContext in its initializtaion that it would see it in
its default, unconfigured state.
This commit reworks the configuration of the ServletContext so that
it happens before any ServletContextInitializer beans are initialized.
Closes gh-10699
This commit updates DefaultErrorAttributes to handle
ResponseStatusException explicitly. This exception is used in a
WebFlux application to signal that the processing of the query has
failed with an HTTP status code and a reason phrase. The latter is now
properly mapped to the `message` attribute of the response body.
Closes gh-11614
This commits improves the cache auto-configuration for Redis by looking
up a custom "RedisCacheConfiguration" bean that allows to take full
control over the `RedisCacheManager`.
Closes gh-11599
This commit applies `server.jetty.*` configuration properties
to Jetty when configured as a reactive web server.
It also removes some infrastructure support for Jetty 8, which
is not supported anymore in Spring Boot 2.0 (partial fix for
gh-11504).
See gh-11500
This commit applies most `server.tomcat.*` configuration
properties to Tomcat when set up as a reactive web server.
Some Servlet-specific properties are not applied:
* server.tomcat.additional-tld-skip-patterns
* server.tomcat.redirect-context-root
* server.tomcat.use-relative-redirects
Fixes gh-11334
Extract functionality from the `RegistrationBean` into a new class
designed to work with dynamic registration. Servet and Filter
registration beans now extend from `DynaimcRegistrationBean`, where as
`ServletListenerRegistrationBean` extends directly from
`RegistrationBean`.
This refactor allows the removal of `ServletListenerRegistrationBean`
deprecated methods.
Fixes gh-11344
This commit adds a new exception type that denotes the value of a
configuration key is invalid, alongside a FailureAnalyzer that reports
a human-readable report when such exception is thrown on startup.
ResourceNotFoundException being a (useless) specialization of this new
exception, its usage has been refactored to use the more general
exception type.
Closes gh-10794
This commit fixes the `responseCommitted` test in
`DefaultErrorWebExceptionHandlerIntegrationTests` and reworks the whole
test class to use the `ContextRunner` infrastructure.
Fixes gh-11519
As HibernateJpaConfiguration is package private, it is no longer
possible to extend the default Spring Boot configuration to apply
advanced settings. The most notable use case for this is the
customization of Hibernate properties using instance value vs. string
value that can be set using the "spring.jpa.properties" namespace.
This commit adds a HibernatePropertiesCustomizer callback interface that
can be implemented to tune Hibernate properties at will.
Closes gh-11211