Commit Graph

6633 Commits

Author SHA1 Message Date
Jean de Klerk
e9eae2cc1e Log exception before sending to listeners
Change SpringApplication exception handling to log details before calling
the SpringApplicationRunListeners. Prior to this commit it wasn't possible
for a listener to shutdown logging.

Fixes gh-4680
Closes gh-4686
2015-12-16 10:33:57 +00:00
Phillip Webb
80b305015e Merge pull request #4780 from Jacob-Swanson/mail-test-exception-message
* pr/4780:
  Fix mail connection test exception message
2015-12-16 10:26:13 +00:00
Jacob Swanson
ae565b805a Fix mail connection test exception message
Closes gh-4780
2015-12-16 10:25:47 +00:00
Phillip Webb
5a1ee6ebe8 Allow easy opt-out of using start-stop-daemon
Allow users to easily opt-opt of using the start-stop-daemon in the
launch script. This may be required on distros that include older
versions.

Fixes gh-4732
2015-12-15 20:37:43 +00:00
Phillip Webb
8c15905040 Merge pull request #3847 from akonczak/master
* pr/3847:
  Auto-configure Elasticsearch converter and context
2015-12-15 20:08:43 +00:00
Artur Konczak
786f025818 Auto-configure Elasticsearch converter and context
Extend ElasticsearchDataAutoConfiguration to also configure an
ElasticsearchConverter and SimpleElasticsearchMappingContext both
of which are required for Spring Data REST.

Closes gh-3847
2015-12-15 20:03:41 +00:00
Phillip Webb
fce75ebaa8 Fix checkstyle error
See gh-4765
See gh-4766
2015-12-15 15:09:58 +00:00
Phillip Webb
b747b6c7b2 Merge pull request #4760 from mbenson/issue-4759
* pr/4760:
  Upgrade to maven-invoker-plugin 1.10
2015-12-15 15:05:20 +00:00
Matt Benson
ea7a758901 Upgrade to maven-invoker-plugin 1.10
Closes gh-4760
2015-12-15 15:05:08 +00:00
Andy Wilkinson
bcaee0ebee Perform initialization in foreground if BackgroundPreinitializer fails
Google App Engine probits the creation of new threads. This leads to a
failure in BackgroundPreinitializer when the single thread executor
attempts to create its single thread.

This commit enhances the existing fail safety of
BackgroundPreinitializer by catching any exceptions thrown while
creating the executor and submitting the tasks to it. Any initialisation
that has not performed in the background will be performed in the
foreground instead.

Closes gh-4662
2015-12-15 14:59:24 +00:00
Phillip Webb
da50eb9ab2 Merge pull request #4766 from mbenson/issue-4765
* pr/4766:
  Use canonical paths for Undertow document root
2015-12-15 14:56:33 +00:00
Matt Benson
cc40dcebcf Use canonical paths for Undertow document root
Update `UndertowEmbeddedServletContainerFactory` so that the canonical
path is used when setting up the document root. Prior to this commit
Windows machines with `java.io.tmpdir` set to a tilde-compressed path
would cause problems.

Fixes gh-4765
Closes gh-4766
2015-12-15 14:56:23 +00:00
Andy Wilkinson
097e588109 Use more sensible defaults for OpenTsdbGaugeWriter's timeouts
Previously, the default RestTemplate that is used OpenTsdbGaugeWriter
was not used with its default configuration. Notably this meant that
it would have infinite connect and read timeouts. This is problematic
as it can cause metric writing to hang and block the scheduler for
performing any other tasks.

This commit updates OpenTsdbGaugeWriter to use a default connect
timeout of 10 seconds and a default read timeout of 30 seconds. A
constructor has been added to ease the configuration of these
timeouts. The existing option of providing your own RestTemplate
(via setRestTemplate) remains.

Closes gh-4698
2015-12-15 14:44:50 +00:00
Andy Wilkinson
08720b4612 Document need to avoid Logback placeholder format in logging properties
Closes gh-4731
2015-12-15 14:28:44 +00:00
Jean de Klerk
199c88e51c Improve the consistency of the various JsonParser implementations
- Consistent error handling applied to BasicJsonParser,
  GsonJsonParser, JsonSimpleJsonParser and YamlJsonParser
- Add tests in AbstractJsonParserTests to verify consistency
- Rename tests for JsonSimpleJsonParser to match the name of the
  class under test.

Closes gh-4690
2015-12-15 14:06:00 +00:00
Andy Wilkinson
e203a689bf Consider relaxed variants of target name when filtering property names
Previously, when ignoreUnknownFields was false and property names were
being filtered based on whether or not they begin with the target name,
relaxed variants of the target name were not considered. This resulted
in different delimiters resulting in a non-match. For example, the
property ENV_FOO_NAME would be filtered out when the target name
was env.foo.

This commit updates PropertiesConfigurationFactory to pass all of the
relaxed variants for the target name to the matcher. For the example
above one of those variants will be env_foo which matches ENV_FOO_NAME
due to the matching delimiter.

PropertiesConfigurationFactory was already creating a RelaxedNames
instance for the target name. The code has been reworked a little to
allow these relaxed names to be reused, thereby avoiding the cost of
computing all of the relaxed variants of the target name a second time.

Closes gh-4775
2015-12-15 13:18:21 +00:00
Phillip Webb
5a7dece144 Formatting 2015-12-15 13:15:35 +00:00
Phillip Webb
19056a1104 Log warning if scanning org or org.springframework
Update ConfigurationWarningsApplicationContextInitializer to also log
warnings if the user is scanning `org` or `org.springframework`.

Fixes gh-4777
2015-12-15 13:13:42 +00:00
Stephane Nicoll
9be4b57182 Add constants for well-known PropertySource names
Closes gh-4776
2015-12-15 11:54:10 +01:00
Phillip Webb
543a746de7 Fix checkstyle issues
See gh-4763
2015-12-14 19:07:48 +00:00
Phillip Webb
5719fab142 Merge branch '1.2.x' 2015-12-14 18:58:25 +00:00
Phillip Webb
edb16a13ee Protect against SpEL injections
Prevent potential SpEL injection attacks by ensuring that whitelabel
error view SpEL placeholders are not recursively resolved.

Fixes gh-4763
2015-12-14 18:49:59 +00:00
Stephane Nicoll
004fa11b81 Merge pull request #4753 from anandshah123/master
* pr/4753:
  Polish contribution
  Add constants for banner location
2015-12-14 18:13:35 +01:00
Stephane Nicoll
e9dfb2292e Polish contribution
Closes gh-4753
2015-12-14 18:13:24 +01:00
Anand Shah
ad1ae8df91 Add constants for banner location
Closes gh-4665
2015-12-14 18:08:29 +01:00
Andy Wilkinson
5cb9b9a9e9 Merge branch '1.2.x' 2015-12-14 16:49:55 +00:00
Andy Wilkinson
7d5cc3da63 Stop ActiveMQ pooled connection factory when context is closed
Previously, ActiveMQ's pooled connection factory was not closed as
part of the application context being closed. This would leave
non-daemon threads running which could cause shutdown to hang unless
the JVM itself was shutting down (in which case a shutdown hook would
stop the pool).

This commit configures each pooled connection factory bean with a
custom destroy method so that the pool is stopped as part of the
application context being closed. To allow the destroy method to only
be declared when the connection factory is pooled, the bean method
has been split into two; one for pooled and one for non-pooled. This
is a partial backport of the changes made in bedf2edf.

Closes gh-4748
2015-12-14 16:49:18 +00:00
Stephane Nicoll
35388b6d95 Clarify usage of Devtools with build plugins
Closes gh-4756
2015-12-14 15:16:30 +01:00
Stephane Nicoll
7cfe1609b1 Merge pull request #4770 from davidmorley/master
* pr/4770:
  Polish contribution
  Rename method to clarify which connector is being created
2015-12-14 14:49:28 +01:00
Stephane Nicoll
f269383803 Polish contribution
Closes gh-4770
2015-12-14 14:49:22 +01:00
David Morley
288aa962c4 Rename method to clarify which connector is being created
See gh-4770
2015-12-14 14:44:48 +01:00
Phillip Webb
3e7863d4b4 Fix checkstyle issue
See gh-4769
2015-12-14 11:55:50 +00:00
Phillip Webb
447edd2c4e Allow gzip compression without Content-Length
Ensure that gzip compression is applied when the `Content-Length` header
is not specified. Prior to this commit Tomcat and Jetty would compress a
response that didn't contain the header, but Undertow would not.

Fixes gh-4769
2015-12-14 11:44:21 +00:00
Phillip Webb
66070686cb Merge pull request #4504 from eddumelendez/gh-4461
* pr/4504:
  Add support for server.server-header property
2015-12-12 21:24:57 +00:00
Eddú Meléndez
1b81d9f0b5 Add support for server.server-header property
Add a `server.server-header` property which can be used to override the
`server` header usually sent back automatically by Tomcat/Jetty or
Undertow.

See https://www.owasp.org/index.php/Securing_tomcat for background.

Fixes gh-4461
Closes gh-4504
2015-12-12 21:24:29 +00:00
Stephane Nicoll
b2f1355e74 Merge pull request #4768 from izeye/polish-20151212
* pr/4768:
  Polish docs
2015-12-12 18:55:50 +01:00
Johnny Lim
4fbc6d810a Polish docs
Closes gh-4768
2015-12-12 18:55:34 +01:00
Phillip Webb
e25727ffae Merge pull request #4625 from vpavic/improve-audit-listeners
* pr/4625:
  Move publisher injection to abstract listeners
2015-12-12 11:23:41 +00:00
Vedran Pavic
c05432d221 Move publisher injection to abstract listeners
Push up publisher injection from AuthenticationAuditListener and
AuthorizationAuditListener to the abstract superclasses.

Closes gh-4625
2015-12-12 11:21:48 +00:00
Phillip Webb
39077ee56c Extract ExitCodeGenerators class
Extract exit code logic from SpringApplication to a new
`ExitCodeGenerators` class so that it can be reused.

Fixes gh-4757
2015-12-11 18:10:40 +00:00
Phillip Webb
34b31f1abc Protect against null description
Update `removeLineBreaks` to also work with `null`.

See gh-4703
2015-12-11 17:40:28 +00:00
Phillip Webb
ecf9ce46e7 Merge pull request #4672 from Shredder121/randomvalue-overflow
* pr/4672:
  Protect against Math.abs() with Long.MIN_VALUE
2015-12-11 15:52:26 +00:00
Ruben Dijkstra
3bd4771130 Protect against Math.abs() with Long.MIN_VALUE
Update RandomValuePropertySource to protect against the random source
returning Long.MIN_VALUE. In such cases the sign bit can't be unset and
prior to this commit the random value stayed negative.

Closes gh-4672
2015-12-11 15:52:17 +00:00
Phillip Webb
58fd403bd0 Merge pull request #4674 from vpavic/improve-health-aggregating
* pr/4674:
  Add AbstractHealthAggregator.aggregateDetails
2015-12-11 14:42:16 +00:00
Vedran Pavic
f8090d94b2 Add AbstractHealthAggregator.aggregateDetails
Extract aggregate details logic to a protected method that can be
overridden if required.

Closes gh-4674
2015-12-11 14:42:02 +00:00
Phillip Webb
0650610fff Merge pull request #4688 from mnhock/Replace_with_valueOf()
* pr/4688:
  Prefer valueOf() to create Number values
2015-12-11 14:06:53 +00:00
mnhock
fcf6e5d6eb Prefer valueOf() to create Number values
Update Long/Integer constructor calls with `valueOf` which can make use
of global caches.

Closes gh-4688
2015-12-11 14:04:25 +00:00
Phillip Webb
dc3ead4c39 Merge pull request #4703 from thorntonrp/patch-1
* pr/4703:
  Cleanup description new-lines for launch script
2015-12-11 14:01:07 +00:00
Robert Thornton
8e0b8750c0 Cleanup description new-lines for launch script
Replace all new-line characters in multi-line pom descriptions before
inserting into the launcher script. Prior to this commit the shell would
attempt to execut the extra lines, for example:

	<description>
		A multi-line pom description that could do something terrible:
		rm -r foo
	</description>

Closes gh-4703
2015-12-11 13:57:14 +00:00
Phillip Webb
a3a320d97b Merge pull request #4706 from mnhock/Calling_toString_is_redundant
* pr/4706:
  Remove redundant toString() call
2015-12-11 13:44:38 +00:00