1791 Commits

Author SHA1 Message Date
Andy Wilkinson
91f4541a91 Merge branch '2.2.x' into 2.3.x
See gh-24052
2020-11-05 12:19:13 +00:00
Andy Wilkinson
006d4bc36d Do not set Tomcat's trust store password when null
See gh-24041
2020-11-05 12:18:32 +00:00
Andy Wilkinson
2ffb81f0d9 Merge branch '2.2.x' into 2.3.x
Closes gh-24052
2020-11-05 11:35:37 +00:00
Andy Wilkinson
2425dcd200 Do not set Tomcat's key store and key pass when null
Fixes gh-24041
2020-11-05 11:30:04 +00:00
Scott Frederick
62aa1b7aaf Narrow criteria for hidden property paths
A previous change intended to prevent temporary directories created as
an implementation detail of mounting volumes on kubernetes pods from
being used as a source for property files had a side-effect of also
preventing other types of hidden directories from being recognized. This
commit narrows the criteria for considering a directory as hidden,
using the kubernetes `..` prefix convention instead of the Unix `.`
prefix.

Fixes gh-23983
2020-11-04 16:09:54 -06:00
Andy Wilkinson
2dce4aa42b Merge branch '2.2.x' into 2.3.x
Closes gh-24009
2020-11-03 14:04:08 +00:00
Andy Wilkinson
30a0ccab02 Remove use of @PostConstruct from main code
When running on Java 11 (where `@PostConstruct` is no longer part of
the JRE) and without a dependency on jakarta-annotation-api,
`@PostContruct` annotions are silently dropped. This leads to obscure and
hard-to-track down changes in the behaviour of our auto-configuration
as the `@PostConstruct`-annotated methods are not invoked.

To allow users to run on Java 11 without having jakarta-annotation-api
on the classpath, this commit removes use of `@PostConstruct` from main
code. A Checkstyle rule has also been added to prevent its usage in
main code from being reintroduced.

Closes gh-23723
2020-11-03 13:59:38 +00:00
Phillip Webb
b0c2687aa9 Update copyright year of changed files 2020-10-29 09:07:42 -07:00
Stephane Nicoll
d1e503602b Polish 2020-10-24 07:39:50 +02:00
Scott Frederick
43cfebaca0 Ignore properties files in hidden directories
This commit modifies the logic for finding properties files using
wildcard paths to ignore files if any part of the file path contains
a hidden directory. Hidden directories are common when Kubernetes
mounts config maps onto volumes in a pod, which was causing the same
properties files to be loaded multiple times.

Fixes gh-23160
2020-10-21 18:01:44 -05:00
Stephane Nicoll
dd74810c80 Revert "Fix detection logic for embedded databases"
This reverts commit c4a5a347028b827ea53975d1ec80f52a14223c5c.

See gh-23721
2020-10-19 12:25:00 +02:00
Andy Wilkinson
e8187f9bb0 Merge branch '2.2.x' into 2.3.x
Closes gh-23743
2020-10-19 10:25:24 +01:00
Andy Wilkinson
2a40bd7853 Register shutdown hook so it can tidy up a partial refresh
Previously, the shutdown hook was only registered once refresh has
completed. If the JVM was shut down during refresh (or after refresh
and before the hook was registered) the hook wouldn't run and the
partially refreshed context would not be cleaned up.

This commit moves the registration of the shutdown hook to before
refresh processing begins. This ensures that the hook is available
to clean up the context if the JVM is shutdown while refresh is in
progress.

Fixes gh-23625
2020-10-19 09:16:07 +01:00
Asha Somayajula
c4a5a34702 Fix detection logic for embedded databases
Closes gh-23721
2020-10-17 07:51:24 +02:00
Andy Wilkinson
a9a32f39b5 Merge branch '2.2.x' into 2.3.x
Closes gh-23671
2020-10-13 11:20:18 +01:00
Andy Wilkinson
667ccdae84 Simplify temp directory creation and improve diagnostics
Closes gh-23622
2020-10-13 11:18:06 +01:00
Phillip Webb
0709c7671f Merge branch '2.2.x' into 2.3.x
Closes gh-23614
2020-10-07 11:41:11 -07:00
Phillip Webb
ce70e7d768 Merge branch '2.1.x' into 2.2.x
Closes gh-23613
2020-10-07 11:40:55 -07:00
Phillip Webb
1db2f5f960 Support Formatter conversion service beans
Update `ConversionServiceDeducer` to also include `Formatter` beans
when they are qualified with `@ConfigurationPropertiesBinding`.

Fixes gh-23576
2020-10-07 11:34:57 -07:00
Andy Wilkinson
914dccade2 Merge branch '2.2.x' into 2.3.x
Closes gh-23555
2020-10-01 12:30:16 +01:00
Andy Wilkinson
323af718e2 Only change the method of requests that Jetty won't handle by default
Previously, JettyEmbeddedErrorHandler would change the method of every
request that is handles to GET. This was being done to work around
Jetty's error handling only dealing with GET, POST, and HEAD requests
by default. It had the unwanted side-effect of causing an error
response to a HEAD request having a body as, from the error handling's
perspective, it was a GET request.

This commit updates JettyEmbeddedErrorHandler to only set the method
on a request for which error handling is being performed if the method
isn't already one that will be handled, leaving the method of GET,
POST, and HEAD requests unchanged.

Unfortunately, short of implementing an HTTP client, this change cannot
be tested as the Apache HttpClient, OkHttp, and the JDK's
HttpURLConnection all silently drop the body of a response to a HEAD
request, preventing a test from asserting that a body hasn't been sent.

Closes gh-23551
2020-10-01 12:29:44 +01:00
Andy Wilkinson
df5cd21ca5 Merge branch '2.2.x' into 2.3.x
Closes gh-23481
2020-09-24 19:04:17 +01:00
Andy Wilkinson
6dc8e6815d Align default tldScanPatterns with Tomcat's
Previously, we configured embedded Tomcat in such a way that no TLD
scan patterns were configured. This differed from a standalone
Tomcat installation where 4 patterns are configured that take
precedence over some of the skip patterns. The missing scan patterns
resulted in the skip patterns preventing the discovery of Log4j2's
TLDs.

This commit updates TomcatServletWebServerFactory to configure the
same four scan patterns as standalone Tomcat configures by default.

Fixes gh-23302
2020-09-24 17:51:38 +01:00
Andy Wilkinson
232c310df2 Merge branch '2.2.x' into 2.3.x 2020-09-22 16:26:39 +01:00
Andy Wilkinson
24102656f2 Fix Log4j2 XML configuration tests on Windows
See gh-22983
2020-09-22 16:03:58 +01:00
Andy Wilkinson
0963218be1 Merge branch '2.2.x' into 2.3.x 2020-09-21 19:28:39 +01:00
Andy Wilkinson
0edf7cb9b9 Polish Log4j2 XML configuration tests
See gh-22983
2020-09-21 19:26:40 +01:00
Andy Wilkinson
13e08a4344 Merge branch '2.2.x' into 2.3.x
Closes gh-23428
2020-09-21 15:15:08 +01:00
Andy Wilkinson
f6492cd0c0 Consume level and dateformat patterns as system props in Log4j config
Previously LOG_LEVEL_PATTERN and LOG_DATEFORMAT_PATTERN were not
consumed as system properties in log4j2.xml and log4j2-file.xml. As a
result, the logging.pattern.level and logging.pattern.dateformat
configuration properties, which are translated into the
LOG_LEVEL_PATTERN and LOG_DATEFORMAT_PATTERN system properties
respectively had no effect.

This commit updates the log4j2.xml and log4j2-file.xml config files to
consume LOG_LEVEL_PATTERN and LOG_DATEFORMAT_PATTERN as system
properties. When the system property is not set, the configuation falls
back to the default values specified in the config files. Tests for
both log4j2.xml and log4j2-file.xml to verify the behaviour have also
bean added.

Fixes gh-22983
2020-09-21 15:08:41 +01:00
Phillip Webb
f590225c82 Merge branch '2.2.x' into 2.3.x
Closes gh-23328
2020-09-16 00:28:29 -07:00
Phillip Webb
bd87ba33d0 Use ephemeral ports for RSocket tests
Closes gh-23325
2020-09-16 00:15:19 -07:00
Stephane Nicoll
201bfd2b0c Upgrade to Netty 4.1.52.Final
Closes gh-23313
2020-09-15 14:55:38 +02:00
Stephane Nicoll
f4a84d3b63 Upgrade to Netty 4.1.52.Final
Closes gh-23287
2020-09-14 13:37:57 +02:00
Stephane Nicoll
492e1a4c0f Upgrade to Netty 4.1.52.Final
Closes gh-23269
2020-09-14 11:28:55 +02:00
Phillip Webb
5294c34807 Merge branch '2.2.x' into 2.3.x
Closes gh-23260
2020-09-13 11:02:19 -07:00
Phillip Webb
326a56da01 Support validation of bound map key entries
Update `ValidationBindHandler` so that pushed fields that reference
map keys can be used. This fixes a regression that was introduced in
commit 4483f417 when we switched to a `AbstractBindingResult` that no
longer required public getters/setters.

Closes gh-20350
2020-09-13 10:54:30 -07:00
Andy Wilkinson
86fc4dea2a Merge branch '2.2.x' into 2.3.x
See gh-23203
2020-09-07 14:16:37 +01:00
Andy Wilkinson
5f00d91176 Restore identifying org.hsqldb.jdbcDriver as embedded
See gh-23036
2020-09-07 14:03:10 +01:00
Andy Wilkinson
116b2472a7 Merge branch '2.2.x' into 2.3.x
Closes gh-23200
2020-09-07 13:34:14 +01:00
Andy Wilkinson
115ea87b14 Restore ordering of ErrorPageFilter lost in 49f8943
See gh-19471
2020-09-07 13:33:43 +01:00
Andy Wilkinson
d39b107917 Merge branch '2.2.x' into 2.3.x
Closes gh-23203
2020-09-07 13:30:02 +01:00
Andy Wilkinson
c948c70c5a Align EmbeddedDatabaseConnection with DatabaseDriver
Fixes gh-23036
2020-09-07 10:13:55 +01:00
Stephane Nicoll
d2eeb9524f Merge branch '2.2.x' into 2.3.x
See gh-23183
2020-09-07 09:17:51 +02:00
Stephane Nicoll
4b5a3f4ff9 Start building against Spring Framework 5.2.9 snapshots
See gh-23182
2020-09-07 08:47:57 +02:00
Phillip Webb
0d80f46cef Remove node and recursive limits for YAML
Update `OriginTrackedYamlLoader` to remove node limits and recursive
parsing restrictions. SnakeYAML 1.26 introduced these options in order
to protect against the "billion laugh attacks" but since we consider
`application.yml` files to be trusted, we don't need these restrictions.

Fixes gh-23096
2020-08-31 15:27:37 -07:00
Phillip Webb
98f432681f Merge branch '2.2.x' into 2.3.x 2020-08-28 15:30:57 -07:00
Phillip Webb
611447c4d5 Fix checkstyle issue caused by polish commit
See gh-22946
2020-08-28 15:30:27 -07:00
Phillip Webb
84f281fbfd Merge branch '2.2.x' into 2.3.x
Closes gh-23135
2020-08-28 15:23:10 -07:00
Phillip Webb
35994b061c Polish 'Remove ResourceUtils.getURL logging config check'
Extend `initializeSystem` to search the exception stack for a
FileNotFoundException before reporting the error. This allows
us to provide a similar stack trace to the one that used to be
thrown when we had the `ResourceUtils.getURL` check.

See gh-22946
2020-08-28 15:16:12 -07:00
Ralph Goers
684b65e80c Remove ResourceUtils.getURL logging config check
Remove `ResourceUtils.getURL` checking from `LoggingApplicationListener`
so that logging systems can implement custom location support.

Prior to this commit, we checked in the listener if the specified config
location could be opened as a URL. This unfortunately prevents Log4J
extensions such as `log4j-spring-cloud-config-client` from implementing
configurable SSL and credentials support.

See gh-22946
2020-08-28 15:07:06 -07:00