Commit Graph

4355 Commits

Author SHA1 Message Date
Andy Wilkinson
a43cd18ac9 Avoid changing root logger level when setting level of unconfigured logger
Previously getLoggerConfig(loggerName) was used to retrieve the
LoggerConfig object on which the level was to be set. As described in the
method’s javadoc it will “remove tokens from the package name as
necessary or return the root LoggerConfig if no other matches were found”.
This is problematic as, if there’s no configuration for the logger whose
level is being configured, the level will be applied to a logger from an
outer package or to the root logger.

This commit updates Log4J2LoggingSystem to use the configuration’s map of
LoggerConfigs, rather than calling getLoggerConfig. In the event of the
level being set on an unconfigured logger, this will produce a null
LoggerConfig. When a null LoggerConfig is encountered, a new one is
created with the appropriate level. If the config already exists, its
level is set as it was before.

The code that was accessing the root logger using a magic null value
(which was then coerced into the root logger’s name (an empty string))
has also been updated to make it clearer that they are purposefully
dealing with the root logger.

Closes gh-3550
2015-07-22 17:50:07 +01:00
Andy Wilkinson
9b6538d5bd Upgrade to Groovy 2.4.4
Typically, a Spring Boot maintenance release would not move to a new
minor version of a dependency. However there is a security
vulnerability in Groovy [1] and 2.4.4 is the only release which
contains a fix for it.

The commit upgrades to 2.4.4, thereby ensuring that users of Groovy
are not vulnerable by default. Users of Groovy whose applications are
not affected by the vulnerability may choose to downgrade back to
2.3.11 by overriding Spring Boot's dependency management.

Closes gh-3540

[1] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3253
2015-07-22 10:33:15 +01:00
Phillip Webb
d2d71934b6 Polish 2015-07-20 10:04:28 -07:00
Stephane Nicoll
539b009d12 Clean management context path if necessary
Various areas of the code expect the management's context path to not
contain any trailing slash but nothing is enforcing it. We now make sure
to remove any trailing slash, including the one for '/' and make that
explicit via the Javadoc of the getter.

Fixes gh-3553
2015-07-20 10:56:52 +02:00
Vladimir Tsanev
8fe9fc25b3 Reserve random port for JBoss tx manager
Closes gh-3546, closes gh-3547
2015-07-20 10:00:51 +02:00
Dave Syer
ff79138aa5 Alternative fix for Rabbit listener transactions
Never inject a transaction manager (user can create his own
"rabbitListenerContainerFactory" bean if he wants an actual
non-JTA transaction manager.

See gh-3432
2015-07-13 15:00:40 +01:00
Dave Syer
67933ab01f Add boolean flag spring.rabbit.listener.useTransactionManager
If set *and* there is a transaction manager in the context, then the
listener container created by Spring Boot will use the transaction
manager to execute the listeners.

Fixes gh-3432 (by virtue of not requiring a JtaTransactionManager any
more).
2015-07-13 14:21:18 +01:00
Dave Syer
f6c395d0a6 Add Maven incantation to make STS 3.7 happy 2015-07-13 14:00:44 +01:00
Dave Syer
d0cf6b534b Add 3xx redirects to the "unmapped" class of requests for metrics
When Spring Security sends 302 responses to a login page we don't get
any information about the request matching in Spring MVC. Consequently
apps can end up with a lot of counter.status.302.* metrics (where
"*" can be whatever the user sent).

This change treats 3xx the same as 4xx (if it is unmapped it just gets
added to a metric called "unmapped" instead of using the actual request
path).

Fixes gh-2563
2015-07-13 13:33:30 +01:00
Johannes Stelzer
fdb83ec338 Correct assertion for indicators parameter in CompositeHealthIndicator
Closes gh-3417
2015-07-13 09:58:33 +01:00
Roy Clarkson
27817b6733 Upgrade to Spring Mobile 1.1.5.RELEASE
Closes gh-3466
2015-07-13 09:55:14 +01:00
Phillip Webb
4b17f3ceef Formatting 2015-07-09 10:37:21 -07:00
Andy Wilkinson
68e54e1d5d Favour entries in source jar over standard libraries when repackaging
When writing a jar, once an entry has been written it will never be
overwritten, i.e. the first write of a given entry will win. Previously,
when repackaging a jar, the existing contents were written followed by
any libraries. This caused a problem when repackaged a WAR file and
a library needed to be unpacked as the existing entry in WEB-INF/lib
would prevent the library with the UNPACK comment from being written.
This was addressed in f761916b by inverting the order so libraries
would take precedence over entries in the source jar.

It’s now become apparent that this change in the order causes a problem
for users who are obfuscating their code. The obfuscated code exists in
the source jar but is also provided to the repackager in its original
form as a library. When libraries take precedence, this means that the
code in its original form ends up in the repackaged war and the
obfuscation is lost.

This commit updates the repackager to write libraries that require
unpacking first. This allows the UNPACK comment to be written even if
there’s also a source entry for the library. Next, source entries are
written. This allows obfuscated source entries to take precedence over
any unobfuscated library equivalents. Lastly, standard libraries that
do not require unpacking are written into the repackaged archive.

Closes gh-3444
2015-07-09 16:37:10 +01:00
Phillip Webb
7da808918f Fix Flyway and Liquibase JPA 'depends-on' setup
Ensure that FlywayAutoConfiguration and LiquibaseAutoConfiguration occur
after HibernateJpaAutoConfiguration so that the DependsOnPostProcessor
condition can correctly check for a LocalContainerEntityManagerFactory
bean.

Fixes gh-3437
2015-07-07 18:19:13 -07:00
Stephane Nicoll
2126c7774a Add a note about transactional listeners
Clarify how the default JMS listener container factory is created if none
exists with regards to transactions.

Issue: SPR-3407
2015-07-06 11:03:44 +02:00
Dave Syer
1abd0879ca Add and fix tests for overridden bindings
The order of property values is only preserved if we check carefully
that each property is actually present in the source being inspected.

Fixes gh-3385
2015-07-02 13:16:13 +01:00
Phillip Webb
43dc0c64c2 Fixup version numbers following release 2015-07-01 23:22:34 -07:00
Spring Buildmaster
7ce391db4f Next development version 2015-07-01 22:48:01 -07:00
Phillip Webb
48009bfebe Allow relaxed property name overrides
Update RelaxedDataBinder to so that property ordering is respected even
if relaxed names are used. Prior to this commit a System property named
`FOO_BAR` would never get bound to a `fooBar` field if `foo-bar` was
defined in application.properties.

Fixes gh-3385
2015-07-01 21:38:34 -07:00
Phillip Webb
04dfac1c6c Formatting 2015-07-01 19:29:25 -07:00
Phillip Webb
3ef667f0d8 Fix MetricWriterMessageHandler to deal with reset
Update MetricWriterMessageHandler to deal with 'reset' messages and to
log unsupported payload types.

Fixes gh-3378
2015-07-01 18:11:53 -07:00
sopov.ivan
fa7199ddac Fix Eclipse 4.5 formatter settings
Fixes gh-3384
2015-07-01 18:09:56 -07:00
Phillip Webb
a1b87766a7 Fix PropertiesLauncher javadoc
See gh-3392
2015-07-01 18:09:56 -07:00
Stephane Nicoll
441049cf4e Auto-detect JMS sessionTransacted flag
If a JtaTransactionManager is present, it is associated with the
auto-created JmsListenerContainerFactory. However, if no such transaction
manager is present, local transaction support is not enabled.

This gives a default situation where the message is acknowledged even
before the listener is invoked. We now make sure to turn on local JMS
transactions if no JtaTransactionManager is present.

Fixes gh-3393
2015-07-01 12:59:11 -07:00
Andy Wilkinson
f4c95eafc2 Upgrade to Undertow 1.1.7.Final
Closes gh-3382
2015-07-01 14:51:40 +01:00
Andy Wilkinson
e31a4dc028 Upgrade Java Mail to 1.5.4
Closes gh-3381
Closes gh-3383
2015-07-01 14:51:06 +01:00
Andy Wilkinson
159d3a3346 Upgrade to nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect 1.2.9
Closes gh-3380
2015-07-01 14:50:23 +01:00
Andy Wilkinson
bb8df95fbf Upgrade to HSQLDB 2.3.3
Closes gh-3379
2015-07-01 14:49:39 +01:00
Andy Wilkinson
b1ad2c30eb Ignore type-constrained converter when auto-configuring Jackson converter
Previously, JacksonHttpMessageConvertersConfiguration would configure a
general-purpose MappingJackson2HttpMessageConverter only if there was
no existing MappingJackson2HttpMessageConverter in the application
context. This was problematic when a
TypeConstrainedMappingJackson2HttpMessageConverter bean was present.
Such a bean is only capable of performing conversion for a specific
type, and therefore is no substitute for a general purpose converter,
yet its presence was causing the auto-configuration of a general
purpose converters to be turned off. This would leave Spring MVC’s
default converter being used for application/json requests which would
not honour the user’s Jackson configuration.

This commit enhances @ConditionalOnMissingBean so that the annotation
can be used to specify one or more types that should be ignored when
searching for beans. This allows the
TypeConstrainedMappingJackson2HttpMessageConverter beans that are
published by Spring Data REST to be ignored such that the
general-purpose MappingJackson2HttpMessageConverter is still
auto-configured.

Fixes gh-2914
2015-07-01 14:28:19 +01:00
Andy Wilkinson
663967f61b Update to Spring Data Evans SR3
Closes gh-3369
2015-07-01 14:26:34 +01:00
sopov.ivan
968b1d7425 Add Eclipse 4.5 new workspace folder to .gitignore
Closes gh-3375
2015-07-01 05:35:16 -07:00
Phillip Webb
8ec10c8425 Use buildView() to create MustacheView
Update MustacheViewResolver so that buildView() is called to create
the MustacheView. This sets fields such as `contentType` and allows us
to remove explicit setApplicationContext() and setServletContext()
calls.

Fixes gh-3265
2015-06-30 14:51:48 -07:00
Phillip Webb
1ecc9c8a8b Upgrade to Spring Framework 4.1.7.RELEASE
Fixes gh-3276
2015-06-30 13:51:19 -07:00
Phillip Webb
a89139c06b Allow case insensitive logging.level properties
Fixes gh-3356
2015-06-30 13:49:45 -07:00
Andy Wilkinson
5a1e66b3d6 Make GzipFilterAutoConfiguration conditional on HttpMethod
GzipFilterProperties uses HttpMethod so GzipFilterAutoConfiguration,
which uses GzipFilterProperties, needs to be conditional on HttpMethod
being on the classpath.

Closes gh-3362
2015-06-30 12:32:29 +01:00
Phillip Webb
76348e50e6 Merge pull request #3324 from mbenson/actuator-sample-ant
* pr/3324:
  Fixup sample Ant build
2015-06-30 00:55:06 -07:00
Matt Benson
183a2095f4 Fixup sample Ant build
Fixes gh-3324
2015-06-30 00:54:53 -07:00
Andy Wilkinson
f8fdcc1312 Include value of java.io.tmpdir in message when createTempFile fails
If java.io.tmpdir is configured to a directory that does not exist,
calls to File.createTempFile will fail with an IOException with the
message "The system cannot find the path specified". Unfortunately,
the path the was specified is not included in the message.

Rather than trying to automatically create the directory in what may
be a misconfigured location, we now include the value of
java.io.tmpdir in our own exception's message. Hopefully this will
help users to figure out what they've done wrong.

Closes gh-3307
2015-06-24 17:13:18 +01:00
Stephane Nicoll
982b81c675 Fix datasource metrics doc
The maximum and minimum number of connections are no metrics so these
are not exposed. Fix the doc that stated the contrary.

Fixes gh-3319
2015-06-24 17:20:31 +02:00
Phillip Webb
16e7c99e4d Polish formatting 2015-06-23 09:45:54 -07:00
Onur Kağan Özcan
2d153ca745 Upgrade to Spring Mobile 1.1.4.RELEASE
Closes gh-3308
2015-06-23 14:13:50 +01:00
Matt Benson
80deaf6456 Fix absolute file detection on Windows
Closes gh-3299
2015-06-23 14:16:54 +02:00
Andy Wilkinson
6fd3042462 Align servlet container error handling with executable jar/war behavior
Previously, when an exception was thrown by a Controller in an
application deployed to a servlet container the exception that was
handled would be Spring Framework’s NestedServletException rather than
the exception thrown by the application. Furthermore, when an exception
was thrown or the response was used to send an error, the
javax.servlet.error.request_uri request attribute would not be set. This
differed from the behaviour in an executable jar/war where the exception
would be the one thrown by the application, and the request_uri
attribute would be set.

This commit updates ErrorPageFilter, which is only involved in a servlet
container, to unwrap a NestedServletException so that it’s the
application’s exception that’s handled, and to set the request_uri
attribute in the event of an exception being thrown or an error being
sent.

Closes gh-3249
2015-06-22 16:27:00 +01:00
olivier bourgain
5ed2a9632b Make InMemoryTraceRepository thread-safe
Closes gh-3027
2015-06-22 15:30:00 +01:00
Andy Wilkinson
8681a8ad2a Map empty virtual host to "/" when parsed from an address
Previously, an address that ended in a "/" would result in the virtual
host being an empty string. This was inconsistent with setVirtualHost
which would map an empty string to "/".

This commit updates the address parsing logic to call setVirtualHost
rather than assigning the value directly to this.virtualHost. This
ensures that the special handling for an empty string is applied
consistently.

Closes gh-3304
2015-06-22 15:20:41 +01:00
Andy Wilkinson
cd62596e82 Provide default for SpringApplication main class in servlet container
By default, SpringApplication attempts to deduce the application class
by looking for a main method in the stack. This does not work when
the application is launched by a servlet container via
SpringBootServletInitializer as there's either no main method in the
stack, or the main method is that of the servlet container, rather
than the application.

This commit updates SpringBootServletInitializer to configure the
main class of the SpringApplication that it creates to be the
application's SpringBootServletInitializer subclass. This is done
prior to calling configure, so the main class can still be specified
by the application if required.

Closes gh-3061
2015-06-22 14:07:40 +01:00
Andy Wilkinson
01ba0f7571 Make RemoteIpValve's protocolHeaderHttpsValue configurable via the env
Closes gh-3289
2015-06-22 13:44:09 +01:00
Stephane Nicoll
5f2ffdb9e2 Update SnakeYAML link
Closes gh-3302
2015-06-22 10:44:23 +02:00
Josh Thornhill
a1e3a5a861 Fix missing space in logging message
Closes gh-3298
2015-06-21 06:40:24 +02:00
Phillip Webb
2b13736ae8 Merge pull request #3255 from mbenson/open-files
* gh-3255:
  Ignore failures when closing war files in tests
2015-06-18 23:25:50 -07:00