After the ApplicationEnvironmentPrepared we now check that the
webEnvironment flag and/or the Environment hasn't changed, in case
the user wanted to switch the context from a web to non-web in a
listener.
Fixes gh-2716
In order to have more control on the structure of the configuration, we
do not bind to `RepositoryRestConfiguration` directly anymore. This
commit introduces `RepositoryProperties` instead.
See gh-3854
Closes gh-4073
Takes into account the fact that the new /actuator endpoint sometimes
loses its path (it is "" relative to a non-empty management context path).
Fixes gh-4059
Previously, a `NoClassDefFoundError` could be thrown if EhCache or Guava
is on the classpath without `spring-context-support` as the respective
cache statistics provider both needs the implementation and the spring
abstraction implementation.
The `@ConditionalOnClass` definition has been updated to properly guard
those beans.
Closes gh-3960
Previously, if a file or non-existent directory was added to
FileSystemWatcher, it would fail with the message “Folder must not be a
file”. While it suggests that the folder needs to be a directory, it
doesn’t make it clear that it also needs to exist. It also doesn’t
tell the user which folder caused the problem.
This commit updates the message to make it clear that the folder must
exist and must be a directory, and the include the name of the
problematic folder in the error message.
Closes gh-3918
The previous implementation would remove and add a new Gauge each time
a metric was written. After this change the Gauge is registered once
and the value is updated on subsequent calls.
This commit reverts the changes made for gh-4026. Those changes updated
each LoggingSystem to close/stop the underlying logging system as part
of the clean up processing. Unfortunately, this approach doesn’t work
in an environment where their are multiple application contexts and
some have a shorter lifecycle than the “main” application context. In
such an environment, closing an application context with a shorter
lifecycle prior to the main application context being closed will
close/stop the main application context’s logging system as, rather than
being scoped to an application context, a logging system is shared
across multiple application contexts. (The exact details of how widely
shared the logging system is varies between logging systems and, in the
case of Logback and Log4J2, also depends on which ContextSelector
implementation is being used.
Update RelaxedDataBinder so that both `.` and `_` are considered in
getPropertyValuesForNamePrefix(...).
With Spring Boot 1.2.5 binding environment variables of the form
`FOO_BAR_BAZ` to `@ConfigurationProperties(prefix="foo-bar")` objects
worked thanks to a happy accident. When `PropertySourcesPropertyValues`
processed a non enumerable `PropertySource` it called the resolver
with a property name `FOO_BAR.BAZ`. A `SystemEnvironmentPropertySource`
will replace `.` with `_` and hence find a value.
Commit 1abd0879 updated non enumerable processing such that the resolver
was never called.
Replicating the problem is quite involved as you need to ensure that you
have both a SystemEnvironmentPropertySource and a non-enumerable
property source (e.g. RandomPropertySource). A test has been added to
PropertiesConfigurationFactoryTests which passes on 1.2.5, fails on
1.2.6 and passes again following this commit.
Fixes gh-4045
This commit updates a number of tests in spring-boot to ensure that
they close the application contexts that they create. SimpleMainTests
still create a number of contexts that are not closed as there’s no
(easy) way to get hold of the context when testing the main method.
See gh-4053
Previously, when a LoggingSystem was cleaned up the underlying logging
system (LogBack, Log4J, Log4J2, JUL) was not being properly shut down.
LogBack explicitly recommends stopping it cleanly [1]. While the other
logging systems are less explicity about it, they would all appear to
benefit from being stopped.
This commit updates all four LoggingSystems to stop/reset/clean up to
underlying logging system when cleanUp is called.
Closes gh-4026
[1] http://logback.qos.ch/manual/configuration.html#stopContext
This commit adds auto-configuration support for WebSocket-based
messaging. When the user enables WebSocket messaging (typically via
@EnableWebSocket and @EnableWebSocketMessageBroker) and an ObjectMapper
bean exists, a MappingJackson2MessageConverter that uses the
ObjectMapper will be configured. This causes any spring.jackson.*
configuration to affect WebSocket message conversion in the same way
as it affects HTTP message conversion.
Closes gh-2445
Add `error.include-stacktrace` configuration option to determine when
stack trace attributes should be added. Options are `never`, `always`
or `on-trace-param`.
Prior to this commit stacktrace attributes were never includes in HTML
responses, and only included in JSON responses when a `trace` request
parameter was set to `true`. This has now been changed so that,
by default, stacktrace attributes are never included.
The BasicErrorController includes a protected method that can be
overridden if includes should be different depending on the `produces`
mapping.
Closes gh-2371