Commit Graph

4537 Commits

Author SHA1 Message Date
Andy Wilkinson
9c14ed3502 Remove stale Java source from src/main/groovy in the Gradle plugin
Closes gh-4113
2015-10-12 10:30:31 +01:00
Stephane Nicoll
ed1b5cbfde Upgrade to H2 1.4.190
Closes gh-4145
2015-10-12 09:21:29 +02:00
Phillip Webb
70214da2e4 Fix broken formatting 2015-10-09 16:41:36 -07:00
Phillip Webb
94736719f1 Reformat package-info.java files with Eclipse Mars 2015-10-09 13:32:57 -07:00
Phillip Webb
b779e8e4fc Add custom Eclipse code formatter
Update Eclipse settings to make use of a custom Spring formatter
implementation. Using a custom formatter allows us to fix a couple of
issues with the version that shipped with Eclipse Mars.1 (Eclipse bugs

The custom formatter also means that it is possible to use Groovy
Eclipse despite the fact that it has formatter regressions (see
https://github.com/groovy/groovy-eclipse/issues/142).

Fixes gh-4136
2015-10-09 10:33:14 -07:00
Andy Wilkinson
04c2bd9c89 Update tests to expect additional entry in test jar
Closes gh-4124
2015-10-09 15:19:50 +01:00
Andy Wilkinson
888fa90265 Ensure that JarFileArchive unpacks entries to unique location
Previously, JarFileArchive would always unpack any entries marked for
unpacking to ${java.io.tmpdir}/spring-boot-libs. This could cause
problems if multiple Spring Boot applications were running on the same
host:

- If the apps are run as different users the first application would
  create the spring-boot-libs directory and the second and subsequent
  applications may not have write permissions to that directory
- Multiple apps may overwrite each others unpacked libs. At best this
  will mean one copy of a jar is overwritten with another identical
  copy. At worst the jars may have different contents so that some of
  the contents of the original jar disappear unexpectedly.

This commit updates JarFileArchive to use an application-specific
location when unpacking libs. A directory beneath ${java.io.tmpdir} is
still used but it's now named <jar-file-name>-spring-boot-libs-<uuid>.
A loop, limited to 1000 attempts, is used to avoid problems caused by
the uuid clashing.

Closes gh-4124
2015-10-09 14:59:18 +01:00
Andy Wilkinson
f7d2bafb3e Use Java 8 on Travis as the samples now require it
Commit 09395f95 updated the samples to require Java 8. This commit
updates the Travis configuration to build with Java 8.

Closes gh-4133
2015-10-09 13:18:29 +01:00
Andy Wilkinson
0069e41c29 Prevent closed context from being refreshed again by an HTTP request
Prior to this commit, EmbeddedWebApplicationContext would perform its
close processing and then stop the embedded container. This could
lead to the closed context's dispatcher servlet handling an HTTP
request and refreshing the context again. This opened up two
possibilities that we need to avoid:

1. Another HTTP request could be received by the dispatcher servlet
   while the context is still being refreshed. This could lead to the
   context being used before its refreshed. I believe this could be
   the cause of the current modification exception described in
   gh-3239 and SPR-13123.
2. It can lead to a race during shutdown as the shutdown hook's
   attempt to close the context races with the refresh initiated by
   the HTTP request. This is possible as the shutdown hook bypasses
   the sychronization on startupShutdownMonitor that would normally
   prevent refresh and close from occurring in parallel. This race
   can lead to a deadlock as described in gh-4130

Closes gh-4130
2015-10-09 12:24:43 +01:00
Dave Syer
7b6de545e7 Change HashSet to LinkedHashSet to preserve order of file extensions
Fixes gh-4111
2015-10-08 10:20:43 +01:00
Phillip Webb
6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Phillip Webb
ba7c1fda72 Convert Gradle plugin from Groovy to Java
Replace existing Groovy code with Java since the Groovy Eclipse tooling
currently forces the use of an old jdt plugin which has formatter bugs.

Fixes gh-4113
2015-10-07 23:12:25 -07:00
Phillip Webb
09395f956a Compile samples and integration tests with Java 8
Update the samples and integration tests to use Java 8. There's no
specific reason to keep them on Java 6 and it helps keep Eclipse happy
if we upgrade.
2015-10-07 19:46:11 -07:00
Phillip Webb
cb6e30c8f5 Ignore helpmojo from Eclipse m2e config
Ignore the `helpmojo` goal to save needing an additional Eclipse plugin.
2015-10-07 19:45:20 -07:00
Andy Wilkinson
3697dd52a0 Use main Apache archive for Tomcat binaries to improve(?) build stability
Mirrors of archive.apache.org only mirror the latest release of each
project so, as new releases are made, builds using older versions will
break as the mirrors are updated.

This commit updates the Tomcat deployment test to use the main Apache
archive site. This should provide long-term access to Tomcat binaries,
improving build stability and ensuring that tagged builds are
repeatable.

Backport of 5f087e6444
2015-10-07 11:57:46 +01:00
Andy Wilkinson
9a703ab4d1 Correct quotation marks in spring-boot-actuator’s README
Closes gh-4095
2015-10-07 11:33:43 +01:00
Andy Wilkinson
d793d5abcb Work around intermittent failure caused by SPR-13079
See gh-4098
2015-10-06 11:43:53 +01:00
Andy Wilkinson
6387f36efa Work around MockMvc bug (SPR-13079) that has only been fixed in 4.2
See gh-4098
2015-10-06 11:25:18 +01:00
Andy Wilkinson
b8b4ea489e Improve MetricsFilter’s handling of async requests
Previously, MetricsFilter would treat async requests the same as
sync requests and would record their response status as soon as the
request had been processed by the filter chain. This would result in a
200 response being recorded and the actual response status produced by
the async processing being ignored. Furthermore, the time that was
recorded for the request would not include the time take for any async processing.

This commit updates MetricsFilter to check whether or not an async
request has been started before it records the metrics for the request.
In the event of an async request having been started no metrics are
recorded. Instead, the StopWatch is stored in a request attribute that
is then retrieved during the filtering of the request’s async
dispatch(es). Once the async processing has completed (isAsyncStarted()
returns false), the StopWatch is stopped, removed from the request’s
attributes and the metrics for the request are recorded.

Closes gh-4098
2015-10-06 11:00:59 +01:00
Andy Wilkinson
a94f3a0cbf Only try to auto-configure Jetty when jetty-webapp is on the classpath
Closes gh-4089
2015-10-05 11:41:23 +01:00
Phillip Webb
87a515f6a0 Fix TemplateAvailabilityProvider binding issues
Update all TemplateAvailabilityProvider implementations to use the
relaxed property binder. Also fix FreeMarkerTemplateAvailabilityProvider
to use `template-loader-path` rather than `path`.

Fixes gh-4085
2015-10-02 15:39:43 -07:00
Phillip Webb
891faa9d35 Fix test cleanup to reset commons logging 2015-10-02 15:04:04 -07:00
Gary Russell
48ba1d888f Update Spring AMQP to 1.4.6 2015-10-02 13:04:26 -04:00
Stephane Nicoll
8978f54cc3 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
2015-10-02 16:12:42 +02:00
Phillip Webb
b0d9a8322e Support . and _ binder prefix joins
Update RelaxedDataBinder so that both `.` and `_` are considered in
getPropertyValuesForNamePrefix(...).

With Spring Boot 1.2.5 binding environment variables of the form
`FOO_BAR_BAZ` to `@ConfigurationProperties(prefix="foo-bar")` objects
worked thanks to a happy accident. When `PropertySourcesPropertyValues`
processed a non enumerable `PropertySource` it called the resolver
with a property name `FOO_BAR.BAZ`. A `SystemEnvironmentPropertySource`
will replace `.` with `_` and hence find a value.

Commit 1abd0879 updated non enumerable processing such that the resolver
was never called.

Replicating the problem is quite involved as you need to ensure that you
have both a SystemEnvironmentPropertySource and a non-enumerable
property source (e.g. RandomPropertySource). A test has been added to
PropertiesConfigurationFactoryTests which passes on 1.2.5, fails on
1.2.6 and passes again following this commit.

Fixes gh-4045
2015-09-29 15:17:15 -07:00
Andy Wilkinson
31705982a0 Upgrade to Spring Social Twitter 1.1.1.RELEASE
Closes gh-3913
2015-09-22 10:35:09 +01:00
Phillip Webb
d22d0683b2 Fixup build following release 2015-09-16 12:03:23 -04:00
Spring Buildmaster
9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Phillip Webb
11d59df3fd Add registerErrorPageFilter option flag
Update SpringBootServletInitializer with a registerErrorPageFilter flag
that can be used to disable ErrorPageFilter registration.

Fixes gh-3603
2015-09-11 13:03:10 -07:00
Phillip Webb
de48223a2e Only handle status errors when sendError is called
Update ErrorPageFilter to only handle errors when `response.sendError`
has been called. This should allow custom @ExceptionHandlers to
completely handle errors and return custom status codes without
triggering the "Cannot forward to error page" log message.

The Javadoc for sendError states:

  "The server defaults to creating the response to look like an
   HTML-formatted server error page containing the specified message"

Where as setStatus states

  "This method is used to set the return status code when there is
   no error "

Fixes gh-2745
2015-09-11 12:27:39 -07:00
Phillip Webb
5f250ebbc1 Add exception endpoints to tomcat-jsp sample
Update `spring-boot-sample-tomcat-jsp` to include endpoints that trigger
exceptions. Primarily to aid testing of the ErrorPageFilter.

See gh-2745
2015-09-11 12:25:48 -07:00
Phillip Webb
86d5c19259 Don't mix collection values from different sources
Update PropertySourcesPropertyValues so that collection values are only
added from a single PropertySource. Prior to this commit, given the
following:

    PropertySource-A
     list[0]=x

    PropertySource-B
     list[0]=y
     list[1]=z

PropertySourcesPropertyValues would take `x` from A and `z` from B,
resulting in a binding of `[x,z]`. The updated code now returns the
more logical `[x]`.

Fixes gh-2611
2015-09-10 19:39:55 -07:00
Phillip Webb
16a1bd0483 Revert "Only format changed lines"
This reverts commit e04fb15574.

Formatting only changed lines doesn't appear to work well.
2015-09-10 17:38:59 -07:00
Phillip Webb
e97042507b Restore cargo downloads directory to /tmp
Using the $home directory seems to be causing intermittent failures on
the CI box.

See gh-3861
2015-09-10 15:29:34 -07:00
Phillip Webb
624350f41e Merge pull request #3605 from tan9/patch-3
* pr/3605:
  Catch more general Hibernate 4.2 LinkageError
2015-09-10 14:58:44 -07:00
Pei-Tang Huang
a5430d8a0c Catch more general Hibernate 4.2 LinkageError
Update HibernateJpaAutoConfiguration to catch LinkageError rather than
NoClassDefFoundError. Required due to the fact that JBoss EAP 6 wraps
NoClassDefFoundErrors.

Fixes gh-3605
2015-09-10 14:58:26 -07:00
Phillip Webb
b7e9f805c9 Set ignoreUnknownFields=true on ServerProperties
Update ServerProperties so that unknown SERVER_* environment properties
do not cause startup failures.

Fixes gh-3903
2015-09-10 14:49:41 -07:00
Phillip Webb
e69a5879b0 Merge pull request #3926 from trecloux/gh-3924_propagate-log-level-to-JUL
* gh-3926:
  Propagates logback log levels to java.util.logging
2015-09-10 14:45:40 -07:00
Thomas Recloux
22e0a50a11 Propagates logback log levels to java.util.logging
Adds the LevelChangePropagator logback listener in order to propagate
Logback's log level changes to java.util.logging loggers.

Logback documentation :
http://logback.qos.ch/manual/configuration.html#LevelChangePropagator

Fixes gh-3924
Closes gh-3926
2015-09-10 14:44:45 -07:00
Phillip Webb
e04fb15574 Only format changed lines
Update Eclipse cleanup actions to only format changed lines. This will
hopefully help to prevent so many false diffs caused by differences
between Eclipse Luna and Eclipse Mars.
2015-09-08 14:27:29 -07:00
Phillip Webb
15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb
0f6b60d8c8 Organize imports 2015-09-08 14:05:00 -07:00
Phillip Webb
653d2b2b4e Tweak eclipse settings
- Update whitespace after inline generics
- Use a more sensible import order
- Update Javadoc warning settings
2015-09-08 13:40:47 -07:00
Phillip Webb
adf2c44bdd Set registerShutdownHook to false for tests
Update SpringApplicationContextLoader so that setRegisterShutdownHook
is false for tests.

Fixes gh-3763
2015-09-03 10:58:27 -07:00
Phillip Webb
b4e0a77269 Polish POM whitespace 2015-09-03 10:39:49 -07:00
Phillip Webb
feb2452f06 Simplify WebApplicationContext class guard
See gh-3856
2015-09-03 10:33:53 -07:00
Andy Wilkinson
cb4e709ba2 Upgrade to Spring Social LinkedIn 1.0.2.RELEASE
Closes gh-3869
2015-09-02 16:28:50 +01:00
Andy Wilkinson
3d099fe9be Upgrade to Spring Social Facebook 2.0.2.RELEASE
Closes gh-3779
2015-09-02 16:28:50 +01:00
Andy Wilkinson
2429cc6766 Upgrade to Hibernate 4.3.11.Final
Closes gh-3868
2015-09-02 16:28:50 +01:00
Barry Lagerweij
8d75aa0ea9 Fix Oracle XA datasource class name
Closes gh-3846
2015-09-02 16:44:29 +02:00