Commit Graph

1691 Commits

Author SHA1 Message Date
Stephane Nicoll
250d5f9a52 Deprecate Atomikos console logs properties
Those properties are no longer honoured with Atomikos 3.8 and we're
using 3.9 by default.

Closes gh-9292
2017-05-29 10:18:35 +02:00
Spring Buildmaster
d719d2cbbc Next Development Version 2017-04-20 12:46:19 +00:00
Stephane Nicoll
2579023035 Fix javadoc
Closes gh-8892
2017-04-12 14:36:02 +02:00
Andy Wilkinson
5dad7182db Address deprecation warnings 2017-04-07 12:01:01 +01:00
Phillip Webb
ddcb5ee328 Polish 2017-04-04 09:36:27 -07:00
Andy Wilkinson
4b1e5e9c43 Improve diagnostics when loading a property source from a file fails
Closes gh-8294
2017-04-04 10:02:10 +01:00
Kyle Anderson
57977a654a Fix typo
Closes gh-8718
2017-03-26 12:10:04 +02:00
Stephane Nicoll
cd76da9a4c Avoid using immutable collections for configuration proprerties
Closes gh-8620
2017-03-16 12:39:48 +01:00
Andy Wilkinson
a2cf0455fd Fix static resource handling when run in IDE or using Maven or Gradle
The changes made for gh-8299 attempted to make static resource
handling consistent across Jetty, Tomcat, and Undertow. They did so
for application's launched using JarLauncher or WarLauncher but did
not consider application's launched in an IDE or using spring-boot:run
in Maven or bootRun in Gradle.

Running in an IDE or via Maven or Gradle introduces two new
resource locations:

 - Jars on the classpath with file protocol URLs (they are always
   jar protocol URLs when using either launcher)
 - Directories on the classpath from a project that is depended upon
   and contains resources in META-INF/resources

This commit updates the factories for all three containers to handle
these new resources locations. The integration tests have also been
updated.
2017-03-09 12:41:32 +00:00
Phillip Webb
f5aeac3658 Polish 2017-03-06 11:43:29 -08:00
Stephane Nicoll
9fb9a67c4b Avoid early initializations
This commit flags the two `BeanPostProcessors` registered by the
embedded support as `synthetic` so that they don't trigger an early
initialization of other components.

Closes gh-8467
2017-03-06 08:16:58 +01:00
Spring Buildmaster
2a83e80a9b Next Development Version 2017-03-03 14:39:21 +00:00
Phillip Webb
5aafbc2a3b Refine engine counter logic
Update counter logic to prevent negative values. Since the stop method
can now be called more than once, it was possible for the counter to
move into negative values.

See gh-8227
2017-03-01 23:07:48 -08:00
Phillip Webb
7fda9c162e Polish web containers stop contribution
See gh-8227
2017-03-01 23:07:41 -08:00
Michael K. Werle
757aa647cf Ensure web containers are stopped after close
Update `EmbeddedServletContainer` implementations to ensure that stop
can be called even if start has not. This allows servers that are
partially started during `initialize()` to still be shut down.

This commit fixes a regression caused by commit 0af53b361f.

See gh-8036
Fixes gh-8224
Closes gh-8227
2017-03-01 22:04:09 -08:00
Andy Wilkinson
b443b745fb Make static resource handling consistent across embedded containers
Previously, there were a number of inconsistencies in the embedded
containers' handling of static resources. The Servlet spec requires
that static resources can be served from the META-INF/resources/
directory of jars nested inside a war in WEB-INF/lib/. The intention
was also to extend this to cover jar packaging when jars are nested in
BOOT-INF/lib/. This worked when using Tomcat as long as Jasper was on
the classpath. If you didn't have Jasper on the classpath or you
were using Jetty or Undertow it did not work.

This commit updates the configuration of embedded Jetty, Tomcat, and
Undertow so that all three containers handle static resources in the
same way, serving them from jars in WEB-INF/lib/ or /BOOT-INF/lib/.
Numerous intergration tests have been added to verify the behaviour,
including tests for Tomcat 8.0 and 7.0 which is supported in addition
to the default 8.5.x. Note that static resource handling only works
with Jetty 9.3.x and 9.2 and earlier does not support nested jars (
see https://github.com/eclipse/jetty.project/issues/518 for details).

Closes gh-8299
2017-03-01 12:40:26 +00:00
Phillip Webb
47b00c086c Polish 2017-02-27 13:56:17 -08:00
Phillip Webb
f6db1cbcb2 Extend Microsoft SQL Server detection
Update Microsoft SQL Server detection logic to retain "SQL SERVER"
support (just in case the server string is driver specific).

See gh-8222
2017-02-27 13:41:34 -08:00
Stephane Nicoll
3a15287c07 Fix detection for Microsoft SQL Server
Closes gh-8222
2017-02-08 14:04:46 +01:00
Andy Wilkinson
9247cd9c36 Don't let standalone Tomcat render its error page after redirect
Previously, if the configured error controller responded with a
redirect to an error caused by an exception, standalone Tomcat would
render its default error page for the original exception. This
occurred because ErrorPageFilter sets the
javax.servlet.error.exception request attribute prior to dispatching
to the error controller and then does not clear it. As the request
unwinds, Tomcat's ErrorReportValve notices that the attribute is set
and renders an error page for the exception that is the attribute's
value.

This commit updates ErrorPageFilter to remove the
javax.servlet.error.exception and javax.servlet.error.exception_type
attributes upon successful completion of a forward to the error
controller. This prevents Tomcat from rendering an error page for
an exception that has already been handled by the error controller.

Closes gh-7920
2017-02-08 12:00:02 +00:00
Stephane Nicoll
a30461c5c7 Polish pid metadata
This commit moves the `spring.pid.*` metadata to the relevant project. It
also updates the doc to refer to the new `ApplicationPidFileWriter`
rather than the one in its deprecatred form.

Closes gh-8196
2017-02-05 09:23:56 +01:00
Spring Buildmaster
ed1ce140c0 Next Development Version 2017-01-26 14:20:39 +00:00
Phillip Webb
0af53b361f Ensure embedded start can be called multiple times
Update all `EmbeddedServletContainer` implementations to ensure that
the `start()` method can be called multiple times, with the second call
being ignored.

Fixes gh-8036
2017-01-25 20:50:23 -08:00
Phillip Webb
ef69ae6a89 Ensure logging filters are removed on cleanup
Update `Log4J2LoggingSystem` and `LogbackLoggingSystem` to ensure
that filters are removed when the `cleanUp` method is called. Prior
to this commit application failures would not remove the filter and
no log messages would appear.

The `LoggingApplicationListener` has also been updated since it
previously failed to handle `ApplicationFailureEvents`.

Finally `EventPublishingRunListener` and `DelegatingApplicationListener`
have been updated to deal with `null` parameters and to cope with
listener errors.

Fixes gh-7758
2017-01-25 19:13:46 -08:00
Andy Wilkinson
bfee21730c Detect path of exploded war correctly on Windows
Previously, AbstractEmbeddedServletContainerFactory detected an
exploded war by looking for `/WEB-INF/` in the path of its code
source's location. This failed on Windows due to the use of `\` rather
than `/` separators.

This commit updates AbstractEmbeddedServletContainerFactory to
uses the OS's separator rather than hardcoding `/`.

Closes gh-8100
2017-01-25 11:26:03 +00:00
Johnny Lim
752b8bd650 Fix entry in broken-initialization.factories
Closes gh-8057
2017-01-22 11:14:12 +01:00
Andy Wilkinson
9e2e824098 Upgrade to Tomcat 8.5.11
Closes gh-7360
2017-01-20 15:51:18 +00:00
Rafael Rollo
6fba1381c1 Indenting SpringApplication javadoc code
Closes gh-8039
2017-01-20 10:53:34 +01:00
Andy Wilkinson
e04ace89b9 Fix LinkageError with ExpectedException and FilteredClassPathRunner
Previously, when the ExpectedException JUnit rule was used with
FilteredClassPathRunner a LinkageError would occur if any of
ExpectedException's methods that take a Hamcrest Matcher were called.
This was due to the FilteredClassLoader delegating loading of
org.junit classes to its parent but not org.hamcrest classes. This
resulted in JUnit classes loading one version of the Hamcrest class
and the test class loading another.

This commit ensures that both the JUnit classes and the test class
use the same version of Hamcrest classes by also delegating the
loading of org.hamcrest classes to FilteredClassLoader's parent.
2017-01-19 15:27:18 +00:00
Andy Wilkinson
2a5586fbcf Ensure that JarResourceManager correctly handles path without leading /
Previously, JarResourceManager assumed that the path would begin with
a / but this isn't always the case. For example, it may be an empty
string. This could lead to a malformed jar:file: URL that used ! as
the separator rather than the required !/.

This commit updates JarResourceManager to prepend / to any path that
does not being with one before using it to construct the URL.

Closes gh-7717
2017-01-17 15:40:53 +00:00
Andy Wilkinson
5158f6e5fc Test that double registration of ServletContextInitializers does not happen
Closes gh-4902
2017-01-16 03:59:53 -05:00
Karsten Sperling
600e74b6c9 Avoid double-reg when a Servlet or Filter implements ServletContextInitializer
See gh-4902
2017-01-16 03:59:53 -05:00
Andy Wilkinson
d2201d5284 Correct copyright dates and enforce that starting year is 2012
Closes gh-7923
2017-01-13 18:43:30 -05:00
Andy Wilkinson
bf642ff9db Continue failure analysis when an analyzer throws an exception
Previously, if a failure analyzer threw an exception from its
analyze method, failure analysis would stop.

This commit updates FailureAnalyzers to catch and log any Throwable
thrown by an analyzer and continue to the next available analyzer.

Closes gh-7956
2017-01-13 15:30:09 -05:00
Andy Wilkinson
7298b2dc1b Set value of javax.servlet.error.exception_type to a Class not a String
Previously, ErrorPageFilter set the value of
javax.servlet.error.exception_type to be the name of the exception,
(a java.lang.String). This commit changes it to be a java.lang.Class
as required by the Servlet spec.

Closes gh-7925
2017-01-13 15:15:58 -05:00
Eddú Meléndez
f896ff9a10 Fix incomplete assertions
Closes gh-7907
2017-01-08 09:12:54 +01:00
Spring Buildmaster
9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Phillip Webb
c23d8fb375 Ignore unresolvable placeholder in log properties
Update the RelaxedPropertyResolver used to load log properties so that
`${...}` patterns are ignored when possible.

Fixes gh-7719
2016-12-21 11:42:56 -08:00
Chaouki Dhib
2ea4d4b1d9 Broaden LoggingApplicationListener ignores
Update `LoggingApplicationListener` to ignore all `-D` prefixed
property values. As well as catching the Azure use-case, this update
now means Spring Boot application can start when Tomcat is missing
`CATALINA_BASE\conf\logging.properties` and sets the value `-Dnop`.

Closes gh-7639
2016-12-19 18:44:48 -08:00
Phillip Webb
f36ed673fd Make Logback 1.1.8 upgrade back compatible
Update the fix committed in a2d46dc16c to fallback to reflection based
invocation in case earlier versions of Logback are being used.

Closes gh-7638
2016-12-19 18:30:28 -08:00
Phillip Webb
bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Stephane Nicoll
a2d46dc16c Upgrade to Logback 1.1.8
Closes gh-7638
2016-12-15 14:01:03 +01:00
Stephane Nicoll
477c874eca Improve DatabaseDriver detection based on jdbc url
This commit fixes the detection of JDBC urls for DB2 AS400, Firebird and
Informix.

Closes gh-7651
2016-12-15 10:39:03 +01:00
Andy Wilkinson
14a90aa52e Update SpringApplicationBuilder javadoc to reflect API changes
Closes gh-7609
2016-12-13 10:02:00 +00:00
Stephane Nicoll
4c61c9f26a Polish contribution
Closes gh-7462
2016-11-24 16:07:03 +01:00
Peter Leibiger
203b6f2f2c Fix undertow session persistence with spring-boot-devtools
Fixes gh-7460
2016-11-24 16:00:23 +01:00
Andy Wilkinson
c9427191ee Set TCCL before initialising test class in FilteredClassPathRunner
Closes gh-7435
2016-11-21 10:41:41 +00:00
Stephane Nicoll
249ed899a6 Fix use of KB and MB in Multipart documentation
Closes gh-7364
2016-11-20 15:51:47 +09:00
Andy Wilkinson
a1dda12bcb Disable Server header by default when using SSL with Jetty 9
Closes gh-7359
2016-11-11 11:46:57 +00:00
Spring Buildmaster
e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00