Commit Graph

7166 Commits

Author SHA1 Message Date
Andy Wilkinson
0976178def Upgrade to Groovy 2.4.7
Closes gh-6269
2016-07-01 11:36:33 +01:00
Andy Wilkinson
5e6f859304 Upgrade to Tomcat 8.0.36
Closes gh-6268
2016-07-01 11:36:04 +01:00
Andy Wilkinson
03c0b24798 Upgrade to httpasynclient 4.1.2
Closes gh-6267
2016-07-01 11:35:40 +01:00
Andy Wilkinson
6d3f6c5886 Upgrade to EhCache 2.10.2.2.21
Closes gh-6266
2016-07-01 11:35:15 +01:00
Andy Wilkinson
bf90e67042 Upgrade to Jackson 2.6.7
Closes gh-6265
2016-07-01 11:34:42 +01:00
Andy Wilkinson
02e989c863 Check that URL is actually a file URL before getting a File from it
Previously, Log4J2LoggingSystem used ResourceUtils.isFileURL(URL) to
check that the URL of the configuration was suitable for accessing as a
File. Unfortunately, this fails when the URL’s protocol is vfs or
vfsfile as both return true and then fail when the URL is subsequently
passed into ResourceUtils.getFile(URL).

This commit switches to checking that the URL’s protocol is file,
the only protocol that will allow getFile(URL) to succeed.

Closes gh-6246
2016-06-30 15:55:22 +01:00
Andy Wilkinson
4c8729a3f2 Upgrade to Undertow 1.3.23.Final
Closes gh-6245
2016-06-29 17:02:40 +01:00
Andy Wilkinson
911f728bc3 Start building against Spring Framework 4.2.7 snapshots
See gh-6249
2016-06-29 17:01:55 +01:00
Stephane Nicoll
779537551e Merge pull request #6176 from magiccrafter:master
* pr/6176:
  Polish "Use missing MongoClientOptions in MongoProperties"
  Use missing MongoClientOptions in MongoProperties
2016-06-27 15:17:44 +02:00
Stephane Nicoll
4e07003e1d Polish "Use missing MongoClientOptions in MongoProperties"
Closes gh-6176
2016-06-27 15:14:24 +02:00
Nasko Vasilev
59f9cfb8a6 Use missing MongoClientOptions in MongoProperties
See gh-6176
2016-06-27 15:14:08 +02:00
Stephane Nicoll
13403a0f72 Merge pull request #6203 from julien-may:1.3.x
* pr/6203:
  Polish "Add condition on MongoClientFactoryBean"
  Add condition on MongoClientFactoryBean
2016-06-27 14:56:03 +02:00
Stephane Nicoll
7a5fabf59d Polish "Add condition on MongoClientFactoryBean"
Closes gh-6203
2016-06-27 14:55:47 +02:00
Julien May
2003c5e1ae Add condition on MongoClientFactoryBean
This commit makes sure that the condition that links a `MongoClient` to
the embedded mongo server kicks in only if `MongoClientFactoryBean` is
also on the classpath.

Previously, only a condition on the mongo driver existed, leading to
`ClassNotFoundException` if Spring Data MongoDB wasn't available.

See gh-6203
2016-06-27 14:39:20 +02:00
Stephane Nicoll
17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Andy Wilkinson
8d491f278b Create FilePermission lazily in JarURLConnection
JarURLConnection is very performance sensitive. The change in 3772d9f
meant that every JarURLConnection would create a FilePermission,
irrespective of whether it was actually used.

This commit updates JarURLConnection to create its FilePermission
lazily. When there is no security manager a permission will no longer
be created at all.

Closes gh-5411
See gh-6215
2016-06-24 11:49:35 +01:00
Andy Wilkinson
17546628f5 Remove springloaded from samples
springloaded isn't required in any of the samples, yet some of them
make use of it without being a springloaded-specific sample. This
is creating the false impression that springloaded is necessary in
cases where it's not.
2016-06-23 12:58:42 +01:00
Stephane Nicoll
bffcb1aad2 Document available layouts
Closes gh-5524
2016-06-23 10:42:47 +02:00
Andy Wilkinson
6c8f8c9d82 Better diagnotics when ESCF subclass breaks with custom management port
When a custom management.port is used, the child context is configured
with an EmbeddedServletContainerFactory bean that has the same class
as the parent context’s EmbeddedServletContainerFactory bean. This
ensures that the child context uses the same type of embedded container
as its parent when there are multiple embedded containers on the
classpath. It also causes a failure when the custom
EmbeddedServletContainerFactory subclass cannot be instantiated, for
example because it’s an anonymous inner-class.

This commit improves the diagnostics so that we fail fast with an
information exception message when we detect that the embedded servlet
container factory bean’s class cannot be instantiated.

Closes gh-6193
2016-06-21 15:05:00 +01:00
Dave Syer
f083447a1b Bump spring-retry to 1.1.3 2016-06-21 14:53:01 +01:00
Phillip Webb
5b97981c87 Polish 2016-06-20 18:13:43 -07:00
Andy Wilkinson
9d194c2d43 Add test to verify binding of a property with all upper-case suffix
See gh-5330
2016-06-20 20:24:41 +01:00
Brian Clozel
c1fcecb415 Document JSP limitation: error page customization
Closes gh-2893
2016-06-20 17:56:30 +02:00
Stephane Nicoll
e93aa2057b Merge pull request #6184 from artembilan:GH-6183
* pr/6184:
  Fix relaxed binding of SI JMX config
2016-06-20 10:12:02 +02:00
Artem Bilan
3ea84f9e1d Fix relaxed binding of SI JMX config
Instead of using an expression for JMX-related properties, this commit
properly honors relaxed binding.

Closes gh-6184
2016-06-20 10:04:38 +02:00
Stephane Nicoll
9abca48a7f Fix HAL browser entry point with contextPath
Previously, if the `contextPath` of the application wasn't the root, the
HAL browser could not initialize since the `entryPoint` was referring to
an invalid location.

This commit makes sure to take the `contextPath` into account.

Closes gh-5814
2016-06-17 17:49:49 +02:00
Stephane Nicoll
72b88790f0 Update .gitignore 2016-06-17 17:47:29 +02:00
Andy Wilkinson
a2446080bc Prevent GC pressure from causing an NPE in SimpleInMemoryRepository
Previously, SimpleInMemoryRepository used a ConcurrentReferenceHashMap
to store its locks. The type of map will discard its entries when the
JVM comes under GC pressure. With the code in its previous form, this
could lead to a NullPointerException when the following occurred:

1. putIfAbsent returned null indicating that a new entry has been added
   to the map
2. GC pressure caused the map to discard the new entry
3. get returned null as the entry has been discard

There are two problems with the existing code:

1. Its usage of a ConcurrentMap is incorrect. The correct usage is:
   a. Call get to see if the map already contains a lock
   b. If the lock is null, create a new one
   c. Call putIfAbsent to add the new lock
   d. If the return value is non-null, another thread has created the
      lock and it should be used. If the return value is null, use the
      new lock created in b.
2. Once the use of ConcurrentMap has been corrected, the fact that it is
   a ConcurrentReferenceHashMap means that different threads could
   access the same value using different locks. This would occur if one
   thread has retrieved a lock from the map and is using it, while GC
   causes the lock to be removed from the map. Another thread then
   attempts to get the lock and, as GC pressure has remove it, a new
   lock is created allowing concurrent access to the same value.

This commit updates the code to use the ConcurrentMap correctly and also
replaces the ConcurrentReferenceHashMap with a ConcurrentHashMap. This
means that the repository will now use slightly more memory but this is
outweighed by the benefits of thread-safe updates and no risk of an NPE.

Closes gh-6115
2016-06-17 13:13:49 +01:00
Andy Wilkinson
13635201ff Prevent JVM from exiting with 1 when main thread is only non-daemon
DevTools deliberately throws an uncaught exception on the main thread
as a safe way of causing it to stop processing. This exception is
caught and swallowed by an uncaught exception handler. Unfortunately,
this has the unwanted side-effect of causing the JVM to exit with 1
once all running threads are daemons.

Normally, this isn't a problem. Non-daemon threads, such as those
started by an embedded servlet container, will keep the JVM alive and
restarts of the application context will occur when the user makes to
their application. However, if the user adds DevTools to an
application that doesn't start any non-daemon threads, i.e. it starts,
runs, and then exits, it will exit with 1. This causes both
bootRun in Gradle and spring-boot:run in Maven to report that the
build has failed. While there's no benefit to using DevTools with an
application that behaves in this way, the side-effect of causing the
JVM to exit with 1 is unwanted.

This commit address the problem by updating the uncaught exception
handler to call System.exit(0) if the JVM is going to exit as a
result of the uncaught exception causing the main thread to die. In
other words, if the main thread was the only non-daemon thread, its
death as a result of the uncaught exception will now cause the JVM
to exit with 1 rather than 0. If there are other non-daemon threads
that will keep the JVM alive, the behaviour is unchanged.

Closes gh-5968
2016-06-17 09:55:30 +01:00
Stephane Nicoll
6574feea87 Document limitations of logging.pattern.*
Closes gh-5653
2016-06-16 15:44:22 +02:00
Andy Wilkinson
ec7d6381aa Update RunMojo to fail when forked JVM returned non-zero exit code
Closes gh-6172
2016-06-16 11:34:15 +01:00
Andy Wilkinson
159ef8f189 Ensure that URL returned from ExplodedArchive.getURL() is encoded
Closes gh-5971
2016-06-15 20:47:29 +01:00
Andy Wilkinson
c808de0021 Allow custom repackage task to be used without a global main class
Closes gh-5956
2016-06-15 20:17:51 +01:00
Andy Wilkinson
76cd45e76e Fix checkstyle violation: remove unused import 2016-06-15 17:21:08 +01:00
Andy Wilkinson
5c43a5b7dd Honour custom bean name generator for non-web applications
Closes gh-6160
2016-06-15 16:55:53 +01:00
Stephane Nicoll
ed2586d38d Upgrade Apache HTTP components to 4.4.5
Closes gh-6165
2016-06-14 14:24:03 +02:00
Dave Syer
e4b544bd39 Create PID_FOLDER if it doesn't exist
In fact the folder was already created if the app is running as
a different user, but not if running as the current user, so it
was just a question of moving one line out of an if block.

Fixes gh-5986
2016-06-14 09:54:58 +01:00
Phillip Webb
b11457f5a2 Merge pull request #6118 from joshiste/1.3.x-liquibase-endpoint
* 1.3.x-liquibase-endpoint:
  Close connection after use in LiquibaseEndpoint
2016-06-10 21:04:31 -07:00
Johannes Edmeier
e89063cc07 Close connection after use in LiquibaseEndpoint
Update LiquibaseEndpoint so that connections are closed and returned to
the pool after use.

Fixes gh-6118
2016-06-10 21:03:15 -07:00
Phillip Webb
452281ca8d Fix property detection in SpringApplicationBuilder
Update SpringApplicationBuilder so that properties of the form
`abc=d:e:f` are correctly parsed. Prior to this commit the `:` delimiter
would always be chosen over `=`, even if `=` occurred first.

Fixes gh-6121
2016-06-10 20:54:50 -07:00
Phillip Webb
f27bdcb737 Prevent APT crashes on older Java versions
Update TypeUtils to guard against the use of older Java versions.
Both `Collection` and `Map` type lookups now fallback to generic free
versions of the classes.

Prior to this commit using `xmlbeans-maven-plugin` in combination with
Spring Boot's annotation processor could result in
`IllegalArgumentException: Incorrect number of type arguments`.

Fixes gh-6122
2016-06-10 17:06:45 -07:00
Phillip Webb
a9b98cada5 Allow loading from package names without dots
Update BeanDefinitionLoader to support loading from package names that
do not contain dots.

Prior to this commit `new BeanDefinitionLoader(registry, "somepackage")`
would fail because "somepackage" exists and is a resource but does not
contain valid XML. Somewhat surprisingly the InputStream returned by
the resource actually contains the listing of files in the package.

Fixes gh-6126
2016-06-10 12:28:23 -07:00
Ivan Sopov
1528764194 Fix potential offset errors in BasicJsonParser
Update BasicJsonParser to fix potential exceptions if strings happen
to be empty.

Fixes gh-6136
2016-06-10 11:48:06 -07:00
Phillip Webb
ed6f11d60d Polish 2016-06-10 11:46:26 -07:00
Stephane Nicoll
ec4c8bf50d Merge pull request #6125 from vpavic:gh-6124
* pr/6125:
  Update DataSourceBuilder aliases
2016-06-09 14:17:24 +02:00
Vedran Pavic
6dde498b87 Update DataSourceBuilder aliases
This commit adds a `user` alias for the `username` property which permits
the use of `OracleDataSource`.

Closes gh-6124, gh-6027, gh-6125
2016-06-09 14:16:21 +02:00
Dave Syer
31fc1cc6f2 Update Spring OAuth to 2.0.10 2016-06-03 13:50:07 +01:00
Andy Wilkinson
1037239efc Upgrade to Dependency Management Plugin 0.5.7.RELEASE
Closes gh-6105
2016-06-01 18:13:25 +01:00
Andy Wilkinson
9bbdbae178 Merge pull request #6056 from Martin Lippert
* gh-6056:
  Check factory method metadata to avoid NPE in devtools condition
2016-06-01 18:09:02 +01:00
Martin Lippert
efd541d26b Check factory method metadata to avoid NPE in devtools condition
Closes gh-6056
2016-06-01 18:08:17 +01:00