Commit Graph

1230 Commits

Author SHA1 Message Date
Johnny Lim
12a921c200 Polish docs
Closes gh-4709
2015-12-09 09:49:42 +01:00
Andy Wilkinson
e9aa7ca9a2 Merge branch '1.2.x' 2015-12-03 14:35:21 +00:00
Andy Wilkinson
00b668b2c5 Only clean up logging system when root application context is closed
Previously, LoggingApplicationListener would clean up the logging
system in response to any application context with which it was
registered being closed. This caused problems when a child context was
closed. Specifically, closing the child context would cause any
SLF4J-based logging systems to unregister the JUL bridge handler
preventing an JUL logging being bridged into Logback or Log4J2.

This commit updates LoggingApplicationListener so that the logging
system is only cleaned up when a root application context is
closed.

Closes gh-4651
2015-12-03 14:01:32 +00:00
Andy Wilkinson
03d29fd68d Update test to cope with asynchronous writing of the access log
Previously, the test that verified that Undertow's access log could be
enabled and was written to the correct file expected the log to be
available as soon as the request to the server had completed. Undertow
writes the access log asynchronously so the test failed intermittently
due to a race between the access log being written and the test
asserting that it exists.

This commit updates the test to wait for up to 10 seconds for the
access log to be available.

See gh-4670
2015-12-03 13:25:07 +00:00
Andy Wilkinson
753341c9ff Add a test for enabling Undertow's access log and verify the file name
See gh-4670
2015-12-03 12:44:11 +00:00
Sebastian Hoß
e233ea7f54 Fix undertow access_log file name
Undertow 1.3.2 changed the default access log file suffix from '.log'
to just 'log'. Thus we need to adapt the file name pattern to include
the missing dot.

Closes gh-4670
2015-12-03 12:43:58 +00:00
Vedran Pavic
884cae6f8d Add support for using ${application.title} in startup banners
This commit introduces a new property, application.title, that can
be used in a banner. Its value is resolved from the application
manifest's Implementation-Title attribute.

Closes gh-4603
2015-12-02 10:09:42 +00:00
Andy Wilkinson
8618ec89b1 Ensure that environment post processors are ordered correctly
Previously, ConfigFileApplicationListener would always add itself to the
end of the list of environment post processors loaded via
spring.factories. This meant that its order (highest precedence + 10)
would not be honoured and it would only be in the right place in the
list if any other post processors happened to have a higher precedence.

This commit updates ConfigFileApplicationListener to sort the list of
post processors using AnnotationAwareOrderComparator once its added
itself to the list.

Closes gh-4595
2015-12-01 15:40:03 +00:00
Andy Wilkinson
008f2a8874 Merge branch '1.2.x' 2015-12-01 15:11:29 +00:00
Andy Wilkinson
0214fe4b82 Remove inconsistent synchronization from EmbeddedWebApplicationContext
Previously, EmbeddedWebApplicationContext used synchronized, but did
not do so consistently. It also synchronized on this so its lock was
exposed outside of the class, creating a risk of deadlock if a caller
synchronized incorrectly. Furthermore, not all fields on the class
were sychronized so the class wasn't truly thread-safe.

This commit attempts to rectify some of the problems above. The use
of synchronized has been dropped in favour of using a volatile field
for the embedded servlet container. Whenever this field is accessed,
a local variable is used to "cache" the value thereby preventing a
change on another thread from causing unwanted behaviour such as an
NPE.

Closes gh-4593
2015-12-01 14:55:53 +00:00
Jean de Klerk
b00bccb7ca Upgrade liquibase to 3.4.2
Remove 3.4.1 logger workaround (adding package to default service). See
CORE-2436 on the liquibase tracker for more details.

Closes gh-4591
Closes gh-4625
2015-11-30 10:33:56 +01:00
Stephane Nicoll
e6588dbf70 Make LOGGING_SYSTEM_BEAN_NAME public
Since the `LoggingSystem` may be retrieved very early during the context
initialization, we should do a lookup by name even if only one instance
of that bean is ultimately expected in the context.

The constant defining the bean name is now public to ease that use case.

Closes gh-4584
2015-11-27 15:53:40 +01:00
Stephane Nicoll
d883f647ba Add test coverage for WebApplicationContextUtils
See gh-4370
2015-11-27 15:22:29 +01:00
Stephane Nicoll
9c412232d5 Improve log message with active profiles
Closes gh-4612
2015-11-26 16:25:52 +01:00
Stephane Nicoll
1ff070f6e9 Fix broken build 2015-11-26 16:23:48 +01:00
Dave Syer
d6a424f94c Add support for UTF-8 in application.properties
Fixes gh-4622
2015-11-26 15:09:50 +00:00
Stephane Nicoll
d9f09e46f8 Cherry-pick 398d06e
Fixed initially in #3725

The target attribute is effectively checked for null beforehand so this
additional defensive check can be removed.

Closes gh-4567
2015-11-23 10:43:44 +01:00
Johnny Lim
8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Andy Wilkinson
ea8107b6a5 Merge branch '1.2.x' 2015-11-18 11:55:27 +00:00
Johnny Lim
fde70909ce Add missing else statement
Closes gh-4509
2015-11-18 11:41:37 +00:00
Andy Wilkinson
2fe0819495 Isolate multiple Undertow deployments
Previously, UndertowEmbeddedServletContainerFactory always used
Undertow’s default ServletContainer. This meant that if there were two
UndertowEmbeddedServletContainers created, they would share the same
ServletContainer and the second one that was created would overwrite
the deployment for the first. This resulted in a async request
handling failing as the attempt to look up the deployment for the
first embedded Undertow instance would incorrectly find the deployment
for the second.

This commit fixes the problem by ensuring that each 
UndertowEmbeddedServletContainerFactory uses a separate Undertow
ServletContainer instance.

Closes gh-4329
2015-11-17 18:04:22 +00:00
Spring Buildmaster
3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Vedran Pavic
d2fecd3ad4 Fix bad JSON syntax
Closes gh-4501
2015-11-15 22:10:00 +01:00
Johnny Lim
903cdf3ddd Polish 2015-11-13 21:45:43 -08:00
Johnny Lim
1e4f8fdd8e Polish 2015-11-13 18:06:31 -08:00
Johnny Lim
0a85281a66 Fix typos
Closes gh-4463
2015-11-13 13:54:50 +01:00
Johnny Lim
e5b31beb68 Polish
This commit resolves typos and naming inconsistency.

Closes gh-4455
2015-11-13 10:15:15 +01:00
Eddú Meléndez
bd709f30c5 Fix springProfile with multi profiles separated by comma and whitespace
Previously springProfile supported multi profiles separated by comma but
it doesn´t work if there are whitespaces. Now, springProfile will read
values cleaning whitespaces.

See gh-4445
2015-11-12 10:48:46 -08:00
Johnny Lim
4d9111606b Polish docs
Closes gh-4446
2015-11-12 17:23:04 +01:00
Phillip Webb
6ae021969b Use TestPropertySourceUtils to convert properties
Fixes gh-4384
2015-11-11 21:24:20 -08:00
Johnny Lim
aa432daa3e Rename a test method to use dir instead folder
Closes gh-4434
2015-11-11 14:03:59 -08:00
Phillip Webb
8c0decac94 Clear list after handling uncaught exceptions
See gh-4423
2015-11-11 12:10:03 -08:00
Johnny Lim
4c1398148b Polish docs
Closes gh-4433
2015-11-11 15:04:45 +01:00
Phillip Webb
a530221213 Ensure startup failures are only logged once
Update SpringApplication so that startup exceptions are only logged
once. A custom UncaughtExceptionHandler is now used when running in
the main thread to suppress errors that have already been logged.

Fixes gh-4423
2015-11-10 23:02:13 -08:00
Johnny Lim
c87370085b Polish 2015-11-10 12:15:27 -08:00
Johnny Lim
83e8bfedb2 Use Ordered.HIGHEST_PRECEDENCE constants
Use Ordered.HIGHEST_PRECEDENCE rather than Integer.MIN_VALUE.

Closes gh-4335
2015-11-10 12:13:15 -08:00
Marcin Grzejszczak
19f141dc59 Add config properties before default properties
Update ConfigFileApplicationListener so that configuration properties
are added before `defaultProperties` if they exist.

Fixes gh-4362
2015-11-10 12:09:50 -08:00
Phillip Webb
4451df21c9 Merge branch '1.2.x' 2015-11-06 13:23:29 -08:00
Phillip Webb
f08f872729 Restore original embedded container shutdown order
Update EmbeddedWebApplicationContext so that the servlet container is
shutdown after the context is closed. Unfortunately shutting the
container down before the context has been closed causes exceptions if
the `/shutdown` actuator endpoint is used. It can also cause the Tomcat
classloader to throw IllegalStateExceptions if resources are accessed
during shutdown.

As this commit effectively reverts 0069e41c we need to fix the shutdown
deadlock issue reported in gh-4130 in a different way. The deadlock can
be caused when an incoming HTTP connection occurs whilst the context is
closing. The incoming connection triggers the `FrameworkServlet` to
call `initWebApplicationContext` which in turn calls `refresh`. The
`FrameworkServlet` checks `ApplicationContext.isActive()` before
performing an initialization but prior to this commit we would set
active to `false` before stopping the servlet container. We now override
`onClose` rather than `doClose` in `EmbeddedWebApplicationContext` to
ensure that the active flag is only set to `false` once the servlet
container has been stopped.

See gh-4130
Fixes gh-4396
2015-11-06 12:54:19 -08:00
Phillip Webb
c94cb1f3d1 Skip BeanInfo class search by default
Set `CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME` by
default to improve startup performance. The `spring.beaninfo.ignore`
property can be set in `application.properties` if BeanInfo classes
should be searched.

Fixes gh-4390
2015-11-05 00:23:23 -08:00
Phillip Webb
602a06d565 Improve performance of RelaxedNames
Replace String.split() with a regex to save compiling the pattern
multiple times.

See gh-4252
2015-11-05 00:23:23 -08:00
Phillip Webb
98ff0fff29 Merge branch '1.2.x' 2015-11-05 00:22:50 -08:00
Phillip Webb
9432ee6a6b Polish 2015-11-05 00:19:58 -08:00
Phillip Webb
6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Phillip Webb
fd1cbed51c Merge branch 1.2.x 2015-11-03 14:56:16 -08:00
Phillip Webb
2118242e00 Polish 2015-11-03 14:06:44 -08:00
Dave Syer
5ed7156061 Add support for lists in SPRING_APPLICATION_JSON 2015-10-31 08:06:39 +00:00
Phillip Webb
0ccd33705d Use RelaxedDataBinder for excludes
Update `EnableAutoConfigurationImportSelector` to directly use the
RelaxedDataBinder when obtaining excludes. This removes the need for
the additional getProperties method on RelaxedPropertyResolver.

See gh-4352
2015-10-30 14:36:53 -07:00
Stephane Nicoll
abfd139d8f Fix spring.application.exclude YAML property
`spring.application.exclude` is retrieved via the
`RelaxedPropertyResolver` API explicitly and it does not have any
standard API to retrieve a list of values. As a consequence that property
could only be specified as a comma-separated value.

This felt convoluted in YAML. `RelaxedPropertyResolver` has now a
`getProperties` method that works with both comma-separated value and
index elements (i.e. list).

Closes gh-4352
2015-10-30 17:23:40 +01:00
Stephane Nicoll
9a7baf195e Fix typo 2015-10-30 15:50:49 +01:00