Commit Graph

2934 Commits

Author SHA1 Message Date
Dave Syer
4e907f19ce Carefully add nested archives from JAR in PropertiesLauncher
If user runs an executable archive then it and its lib directory will be
on the classpath. Entries from loader.path take precedence in a way that
should make sense to users (earlier wins like in CLASSPATH env var).

Also added new integration tests to verify the behaviour (big improvement
on the old ones, which probably aought to be beefed up to the same
standard).

Fixes gh-2314
2015-01-20 17:37:49 +00:00
Andy Wilkinson
c857f957fa Correct syntax for thread name formatting in Logback XML configuration
See gh-2366
2015-01-20 11:51:54 +00:00
Andy Wilkinson
f10c9b5312 Avoid race between file creation and its contents being written
Previously, SampleIntegrationParentApplicationTests assumed that when
an output file existed on disk its contents would have been written
in their entirety. This assumption does not hold true and causes the
test to fail intermittently as it incorrectly determines that the test
has produced no output.

This commit updates the test to wait for up to 30 seconds for the
output files to appear on disk and for the expected content to be
found in one of those files. If the files exist but do not
contain the expected content the test will keep trying until it does
or until too much time as elapsed.

Fixes gh-2380
2015-01-20 09:50:35 +00:00
Dave Syer
b3597107ba More careful masking for the HTTP status in non-error cases
The ErrorPageFilter exposes a wrapped response to the downstream
chain and unless more care is taken the chain will be able to
set the response status, but not inspect it.

Fixes gh-2367
2015-01-16 11:29:00 +00:00
Andy Wilkinson
a51ad5c684 Update Eclipse template copyright date to 2015 2015-01-15 09:52:10 +00:00
Andy Wilkinson
376de01636 Don't remove @GrabResolver in JarCommand, disable initClass instead
Previously, JarCommand removed all @GrabResolver annotations in an
AST transformation. This was being performed as custom resolver
configuration is not necessary in a jar as all of the dependencies are
available from the jar. Furthermore, leaving the annotations in place
caused a failure when the jar was run due to a missing Ivy dependency
that's required by Groovy's default GrapeEngine, GrapeIvy.

The removal of @GrabResolver annotations was being done before they
could be used by Groovy's GrabAnnotationTransformation to configure
the GrapeEngine's resolvers. This resulted in the annotations having
no effect such that a dependency that was only available from a
repository made available by @GrabResolver would fail to resolve if
it was not cached locally.

This commit updates the AST transformation to leave the @GrabResolver
annotations in place but to set their initClass attribute to false.
This allows the annotation to be used while the jar's being compiled,
but supresses the generation of the static initializer that adds the
custom resolver to the GrapeEngine when the compiled code's run via
java -jar.

Fixes gh-2330
2015-01-14 16:42:43 +00:00
Andy Wilkinson
9744d28299 Uninstall SLF4J’s Java logging bridge handler during shutdown
Previously, when LogbackLoggingSystem or Log4JLoggingSystem were
initialized during application start up, they would install SLF4J’s Java
logging bridge handler, however no corresponding uninstall was performed
during application shutdown. When deployed to a servlet container, where
the application’s lifecycle doesn’t match the JVM’s lifecycle, this lead
to a memory leak.

This commit updates LoggingSystem to introduce a new cleanUp method. An
empty implementation is provided to preserve backwards compatibility
with existing LoggingSystem subclasses. Both LogbackLoggingSystem and
Log4JLoggingSystem have been updated to implement cleanUp and uninstall
the SLF4J bridge handler. LoggingApplicationListener has been updated
to call LoggingSystem.cleanUp in response to a ContextClosedEvent.

Closes gh-2324
2015-01-14 14:37:58 +00:00
Andy Wilkinson
92c8b75a73 Upgrade to Spring Integration 4.0.6.RELEASE
Closes gh-2358
2015-01-14 11:39:03 +00:00
Andy Wilkinson
3ef768e76d Upgrade to Spring AMQP 1.3.8.RELEASE
Closes gh-2357
2015-01-14 11:38:45 +00:00
Andy Wilkinson
912060698d Upgrade to SLF4J 1.7.10
Closes gh-2336
2015-01-14 11:38:22 +00:00
Andy Wilkinson
ca1716e9d6 Upgrade to Hibernate 4.3.8
Closes gh-2335
2015-01-14 11:38:02 +00:00
Andy Wilkinson
b875a00ebd Tighten up conditions: a web application may not be using Spring MVC
Previously, some classes that were annotatated with
@ConditionalOnWebApplication assumed that, if the application was a
web application, Spring MVC (spring-webmvc) would be on the classpath.
If it was not, the application would fail to start, typically with an
error relating to WebMvcConfigurerAdapter being unavailable.

This commit updates the affected configuration classes and annotates
them with @ConditionalOnClass(WebMvcConfigurerAdapter.class) to
ensure that their auto-configuration only takes effect if its a web
application and Spring MVC is on the classpath.

Fixes gh-2345
2015-01-13 17:51:10 +00:00
Andy Wilkinson
ac1d0cab3b Prevent Gradle from pulling in groovy-all with the remote shell starter
Sadly, Gradle handle's exclusions differently to Maven even when it's
processing a Maven pom.

In this case groovy-all is pulled in via org.crashub:crash.shell where
we've excluded it. This is enough to prevent Maven from pulling in
groovy-all when you depend on the remote shell starter.
org.crashub:crash.shell is also pulled in as a transitive dependency
of a number of other dependencies and Gradle requires each of these
to also exclude groovy-all for it to actually be excluded.

This commit adds the additional exclusions that are required to make
Gradle's behaviour sane.

Fixes gh-2257
2015-01-07 17:50:36 +00:00
Phillip Webb
bd83aca63f Fix InMemoryAuditEventRepository search by date
Update InMemoryAuditEventRepository to consider the date when searching
for events. Also switch to a circular buffer implementation and update
the capacity to limit the total number of items rather than limiting
per principal.

Fixes gh-2291
2015-01-06 11:58:28 -08:00
Phillip Webb
0622b3e987 Fix documentation code example error
The "Customizing ConfigurableEmbeddedServletContainer directly"
section should use `HttpStatus.NOT_FOUND` and not `HttpStatus.404` in
the sample code.

Fixes gh-2258
2015-01-05 11:57:02 -08:00
Phillip Webb
20dbf4ab15 Remove duplicate jetty-util dependency
See gh-2180
2015-01-03 12:29:00 -08:00
Phillip Webb
67302db9e5 Add dependency management for all Jetty modules
Update spring-boot-dependencies to include all Jetty modules. The helps
to prevent issues when modules are pulled in transitively (for example
via solr).

Fixes gh-2180
2015-01-02 16:21:47 -08:00
Phillip Webb
7e771bb655 Fix ParentAwareNamingStrategy and JMX auto-config
Fix ParentAwareNamingStrategy to set ObjectName properties for the
'identity' and 'context' attributes. Also update JmxAutoConfiguration
to ensure that the ParentAwareNamingStrategy is created in each context
and that the `mbeanExporter` bean is created. Prior to this commit the
nested @EnableMBeanExport class always meant that the mbeanExporter
condition never matched.

Fixes gh-2243
2015-01-02 15:07:44 -08:00
Phillip Webb
c46478f97d Guard for multiple ContentNegotiatingViewResolvers
Update WebMvcAutoConfiguration to ensure than the viewResolver bean
is not created if a user defined ContentNegotiatingViewResolver bean
is defined.

Fixes gh-2269
2015-01-02 11:32:04 -08:00
Dave Syer
f4e12e96c6 Additional condition to protect Reactor 2.0 users
(cherry picked from 80d55c47)
Closes gh-2255
2014-12-30 15:39:13 -08:00
Russell Allen
fe83aed6b2 Grammar correction
Closes gh-2262
2014-12-30 14:24:13 -08:00
Stephane Nicoll
1567c00ef0 Upgrade to Spring Framework 4.0.9
Closes gh-2259
2014-12-30 16:33:49 +01:00
Phillip Webb
a0667ba4bb Polish docs 2014-12-28 12:10:44 -08:00
Stephane Nicoll
38594cd820 Remove unused code
Closes gh-2244
2014-12-28 10:51:53 +01:00
Stephane Nicoll
05e402295d Mention environment variables mapping in the guide
Closes gh-2234
2014-12-27 18:28:13 +01:00
Phillip Webb
96d479c3d9 Make RequestMappingHandlerMapping @Primary
Update WebMvcAutoConfiguration so that the RequestMappingHandlerMapping
bean is @Primary. Prior to this commit a NoUniqueBeanDefinitionException
would be thrown then using the MvcUriComponentsBuilder.

Fixes gh-2237
2014-12-26 11:42:10 -08:00
Stephane Nicoll
ed1db855c0 Upgrade to Thymeleaf 2.1.4
Closes gh-2215
2014-12-23 11:51:26 +01:00
Phillip Webb
7d017a2a6b Add HATEOAS sample application 2014-12-22 20:28:15 -08:00
Andy Wilkinson
e72f3c0215 Upgrade to Jetty 8.1.16.v20140903
Closes gh-2199
2014-12-18 15:43:40 +00:00
Andy Wilkinson
950eafe9cc Improve diagnostics when ServletContext.addListener fails
The various servlet containers that we support vary in the quality
of their diagnostics when ServletContext.addListener fails. To make
problem diagnosis easier, this commit ensures that the toString of the
the listener that was being added is included in the exception that's
thrown when a failure occurs.

Closes gh-2197
2014-12-18 15:31:22 +00:00
Andy Wilkinson
5c67e6f141 Update war layout to package custom scope dependencies in WEB-INF/lib/
Fixes gh-2187
2014-12-17 20:21:29 +00:00
Michael Cramer
ef64186bb9 Upgrade to SLF4J 1.7.8
Closes gh-2151
2014-12-15 09:34:19 +00:00
Phillip Webb
1ef77d7d97 Protect against null CodeSource location
Update LogbackLoggingSystem to protect against a potential null
CodeSource result.

Fixes gh-2149
2014-12-14 13:43:00 -08:00
Phillip Webb
c22018aaa1 Polish 2014-12-14 13:40:46 -08:00
Stephane Nicoll
f1c893e523 Polish indent 2014-12-12 17:14:10 +01:00
Stephane Nicoll
2416a935e6 Properly document health indicator config
Health indicator configuration keys have moved from the health.* to the
management.health.* namespace. This commit makes sure that these are
documented properly in 1.1.x as well.

See gh-2118
2014-12-12 17:05:16 +01:00
Phillip Webb
a6adeab319 Fixup version numbers following release 2014-12-10 19:50:05 -08:00
Spring Buildmaster
63e6a25097 Next development version 2014-12-10 18:06:30 -08:00
Phillip Webb
10726ffea3 Make DEFAULT_PROTOCOL public
Fixes gh-2110
2014-12-10 15:23:40 -08:00
Andy Wilkinson
42e2b9a41d Upgrade to Groovy 2.3.8
Closes gh-2021
2014-12-10 15:52:11 +00:00
Phillip Webb
1c031abdd2 Fix session timeout default value
Update DEFAULT_SESSION_TIMEOUT to use TimeUnit.MINUTES.toSeconds(30)
rather than TimeUnit.SECONDS.toMinutes(30) which would always return
0.

See gh-2084
(cherry picked from commit b33bbd56)
2014-12-08 21:53:34 -08:00
Phillip Webb
c23a764a1c Set the default session timeout to 30 mins
Update AbstractConfigurableEmbeddedServletContainer to set the default
session timeout to 30 minutes. Also correct Javadoc to specify that
the default is '30 minutes'.

Fixes gh-2084
2014-12-08 11:12:40 -08:00
Phillip Webb
22e8478aa3 Cross-reference "Create a deployable war" how-to
Add a tip for both the Maven and Gradle "Packaging executable jar and
war files" section referring to the how-to.

Fixes gh-2086
2014-12-08 10:52:54 -08:00
Phillip Webb
fcad7c4fde Guard for null BeanFactory in @ConditionalOnBean
See gh-2080
2014-12-08 09:25:12 -08:00
Phillip Webb
d3ccdc6319 Polish 2014-12-08 08:51:01 -08:00
Stephane Nicoll
9b598b49c2 Fix JMS support in the CLI
Partly back port changes from affb202e and 85c95744f to fix the usage
of JMS in the CLI. Restore the integration test using HornetQ and fix the
coordinates of the JMS API.

Fixes gh-2075
2014-12-08 08:39:47 +01:00
Phillip Webb
c9a3919af9 Add LoggingApplicationListener constants
Extract some of the common property keys as constants.

Fixes gh-2068
2014-12-05 10:23:55 -08:00
kakawait
f65c7dbeb3 Update 'flyway.locations' appendix documentation
Replace `classpath:db/migrations` with `classpath:db/migrations`.

Fixes gh-2063
2014-12-05 10:23:54 -08:00
Andy Wilkinson
3b78aa9493 Make Security auto-config conditional on spring-security-config
SecurityAutoConfiguration, via its import of
AuthenticationManagerConfiguration, requires spring-security-config
to be on the classpath as AuthenticationManagerConfiguration extends
GlobalAuthenticationConfigurerAdapter from spring-security-config.

This commit makes SecurityAutoConfiguration conditional on the
presence of GlobalAuthenticationConfigurerAdapter so that the
auto-configuration will be disabled in its absence rather than causing
an app to fail to start.

Closes gh-2046
2014-12-02 11:18:23 +00:00
Phillip Webb
41c15f205f Polish concurrent gaugeLocks map access
See gh-1995
2014-12-01 14:29:22 -08:00