Commit Graph

4537 Commits

Author SHA1 Message Date
Stephane Nicoll
5043c959a2 Refine check
Refine commit 8a96481 to set the web environment to false if spring web
is not available in the classpath. Thanks to @mjustin for spotting that
mistake.

Closes gh-3856
2015-09-01 18:39:43 +02:00
Stephane Nicoll
426a8dc103 Store container installs in home directory
Previously, deployment tests were storing the container archives in the
default location (that is `/tmp`) for a total weight of 160MB. In case
the temp directory is cleaned on CI, these have to be downloaded again.

We're now configuring cargo to store these archives in the home directory
instead. This should improve the speed and the stability of the
deployment tests

Closes gh-3861
2015-09-01 16:41:29 +02:00
Stephane Nicoll
8a96481423 Properly guard customization of application context class
SpringApplication wrongly expects spring-web to be on the classpath to
figure out whether or not the web environment should be enabled for a
custom context class.

We now properly guard this check so that the web environment is not
enabled (read: not checked) if `spring-web` is not available.

Closes gh-3856
2015-09-01 09:15:40 +02:00
Stephane Nicoll
cd39e6a742 Upgrade to H2 1.4.188
Closes gh-3843
2015-08-29 08:01:00 +02:00
Andy Wilkinson
f143bd2cfb Upgrade to Tomcat 8.0.26
Closes gh-3406
Closes gh-3526
2015-08-26 15:01:29 +01:00
Stephane Nicoll
6393569d42 Polish Externalized Configuration section
Closes gh-3823
2015-08-25 15:22:02 +02:00
Stephane Nicoll
6869b0d987 Fix wrong imports on StringUtils
Closes gh-3792
2015-08-20 14:46:20 +02:00
Stephane Nicoll
11b82cc6fe Properly guard DB health indicator
The DataSource health indicator uses `JdbcTemplate` behind the scenes
but nothing was checking that it is actually available.

`DataSourcesHealthIndicatorConfiguration` is now disabled if
`spring-jdbc` is not on the classpath.

Fixes gh-3765
2015-08-17 10:08:07 +02:00
Andy Wilkinson
190f8a7e0a Upgrade Travis configuration to run on new infrastructure
Closes gh-3760
2015-08-14 18:08:48 +01:00
Andy Wilkinson
4f0f51b5ed Upgrade to Spring Web Services 2.2.2.RELEASE
Closes gh-3423
2015-08-10 20:30:54 +01:00
Andy Wilkinson
a2f4c1cc4a Add support for configuring allowSessionOverride via the environment
This commit adds support for using the environment to configure the
Freemarker and Velocity view resolvers to allow session overrides.

Closes gh-3410
2015-08-10 16:58:17 +01:00
Andy Wilkinson
f9a775518f Upgrade to Spring Batch 3.0.5.RELEASE
Closes gh-3421
2015-08-10 16:35:22 +01:00
Stephane Nicoll
1ee31e73d3 Avoid NPE if @ConfigurationProperties is not present
The annotation processor detects `@ConfigurationProperties` bean or
method definition and merges manual meta-data. The former step will fail
with a NPE if the annotation is not present on the classpath. This could
happen if the annotation processor is added to a module that is not
actually using Spring Boot.

We now have a defensive check that skips that steps but still attempts to
merge manual meta-data if present.

Closes gh-3720
2015-08-10 16:34:30 +02:00
Thomas Traude
2b6d7a3f15 Update URL to Groovy Docs
Closes gh-3715
2015-08-09 09:03:54 +02:00
Stephane Nicoll
f88d548de0 Fix typo
Closes gh-3700
2015-08-07 16:03:25 +02:00
Andy Wilkinson
890fb9665d Upgrade to Spring Loaded 1.2.4.RELEASE
Closes gh-3681
2015-08-05 16:51:49 +01:00
Andy Wilkinson
dd4c542e32 Upgrade to Undertow 1.1.8.Final
Closes gh-3674
2015-08-05 16:33:00 +01:00
Andy Wilkinson
c4d0f949d4 Upgrade to mysql:mysql-connector-java 5.1.36
Closes gh-3673
2015-08-05 16:32:31 +01:00
Andy Wilkinson
370247f9e4 Upgrade to Jetty 9.2.13.v20150730
Closes gh-3672
2015-08-05 16:31:36 +01:00
Andy Wilkinson
8df4985675 Upgrade to Freemarker 2.3.23
Closes gh-3671
2015-08-05 16:30:43 +01:00
Andy Wilkinson
82212e6271 Upgrade to Spring Integration 4.1.6.RELEASE
Closes gh-3670
2015-08-05 16:30:01 +01:00
Andy Wilkinson
5756195c05 Upgrade to Spring Security 3.2.8.RELEASE
Closes gh-3669
2015-08-05 16:29:29 +01:00
Andy Wilkinson
905346d0cd Consider @Bean methods with args to determine type created by factory
Previously, BeanTypeRegistry would only look for a @Bean method
with no arguments when trying to determine the type that will be
created by a factory bean. This meant that the type produced by a
factory bean declared via a @Bean that has one or more arguments would
be unknown and any on missing bean conditions look for a bean of the
type produced by the factory bean would match in error.

This commit updates BeanTypeRegistry to, where possible, use the
factory method metadata for the bean definition when determining the
type that will be created. This allows it to determine the type for
factory bean created by @Bean methods that take arguments and also
avoids the use reflection to find the factory method. Where factory
method metadata is not available, the existing reflection-based
approach is used as a fallback.

Closes gh-3657
2015-08-04 11:34:53 +01:00
Phillip Webb
2c0ec1b428 Polish 2015-08-03 11:09:33 -07:00
Andy Wilkinson
acfb07bdd6 Merge branch 'gh-3628' into 1.2.x 2015-08-03 16:23:47 +01:00
Andy Wilkinson
838e0ef33e Polish contribution
- Extract the logic that coerces the string into a LogLevel into a
  separate method.
- Add a test that verifies that false is mapped to LogLevel.OFF

Closes gh-3628
2015-08-03 16:23:36 +01:00
shanman190
cbd37b583f Make it easier to use YAML configuration to turn off a logger
A level named off is used to disable logging for a particular logger.
YAML interprets off as false, leading to a failed attempt to get the
LogLevel for FALSE. A workaround is to quote the level, i.e. use "off"
rather than off.

This commit updates LoggingApplicationListener to coerce the string
false back to the level off.

Closes gh-3631
See gh-3628
2015-08-03 16:21:26 +01:00
Andy Wilkinson
d241171fff Use fast exceptions in hasMoreElements in LaunchedURLClassLoader
When nested jars are being used, hasMoreElements requires opening a
connection for an entry in every nested jar. If that entry doesn't
exist, a FileNotFoundException is thrown to indicate that a particular
jar doesn't contain the requested entry. This exception is used to
indicate the lack of an entry and is then swallowed, i.e. its stack
trace is of no importance. This means that the performance of
hasMoreElements can be improved by switching on fast exceptions while
it's being called. When fast exceptions are switched on a general
purpose pre-initialized FileNotFoundException is thrown rather than
creating a new FileNotFoundException instance each time.

In certain situations, the use of fast exceptions as described above
can improve performance fairly significantly. The JRE's default SAAJ
implementation uses META-INF/services-based discovery for _every_
request that's handled by Spring Web Services. Each discovery attempt
results in hasMoreElements being called making its performance
critical to throughput.

See gh-3640
2015-08-03 15:39:56 +01:00
Pei-Tang Huang
3953baba81 Add SQLServer XA DataSource class name
Closes gh-3604
2015-07-27 14:58:10 +02:00
Stephane Nicoll
057824aca7 Fix maven plugin configuration
Closes gh-3601
2015-07-27 08:18:09 +02:00
Andy Wilkinson
6d3660531b Don't set text color of <code> elements when they're beneath an <a>
Closes gh-3583
2015-07-23 12:06:02 +01:00
Stephane Nicoll
fbfbec1177 Use custom validator on supported classes only
Previously, a customer was set regardless of the fact that it is
supported on the target bean. DataBinder has an actual assertion check
that would fail in such a case.

We now associate the custom validator only if it supports the target
bean.

Fixes gh-3581
2015-07-23 11:37:01 +02:00
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