Commit Graph

491 Commits

Author SHA1 Message Date
Ilayaperumal Gopinathan
341412d5b5 Fix LoggingApplicationListener
- If `logging.config` is set and could open/read the resource
then, return.
  - Currently, it logs warning though the resource is successfully
read.
2014-07-15 09:32:09 +01:00
Dave Syer
81a4548561 Ensure embedded containers actually stop if there is an error on startup
Both embedded containers need to be checked after starting to ensure that they
are actually running. With Jetty it's just a question of catching an exception
but with Tomcat it's harder (the current solution involves duplicating some
code from initialize() into start() essentially checking the lifecycle state).

Also adjusted the log levels to prevent noise at WARN level by default when
this happens (since the exception is logged and rethrown anyway).

There is still the issue of whether to fail the build in Maven or Gradle
(separate issue really).

Fixes gh-1232
2014-07-10 15:14:25 +01:00
Spring Buildmaster
40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
Phillip Webb
f7b7b1c8cb Polish embedded tomcat classes
Extract some methods to aid readability.
2014-07-07 23:40:36 -07:00
Phillip Webb
aed243fb88 Only add Tomcat connectors in start() method
Update TomcatEmbeddedServletContainer so that Connectors are removed
during initialization and re-added when the start() method is called.

This prevent protocol handlers from being bound then immediately
unbound. It also ensure that any additional connectors that may have
been added don't accidentally start to accept traffic (which could cause
potential deadlock issues).

Fixes gh-1212
2014-07-07 23:15:52 -07:00
Phillip Webb
8054426803 Format source code 2014-07-02 15:17:25 -07:00
Phillip Webb
fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Christian Dupuis
133304c4f7 Resolve placeholders in banner through Enviornment
see #1191
2014-07-02 10:25:20 +02:00
Andy Wilkinson
e9c69aa46f Honour existing java.awt.headless configuration
Previously, SpringApplication would set the java.awt.headless system
property even if it had already been set. This commit updates
SpringApplication to honour any existing configuration when setting
the property.

Fixes #1189
2014-07-01 10:48:46 +01:00
Dave Syer
54a23f9920 Make -q and -v do something more sensible
-q switches off all logging and the banner, -v switches logging to debug,
running with neither will be info.

Fixes gh-1108
2014-06-27 16:24:51 +01:00
Dave Syer
fd757cb371 Add logging.level to application.properties
E.g.

logging.level.org.springframework: DEBUG
logging.level.org.hibernate: WARN

Fixed gh-788
2014-06-27 15:49:17 +01:00
Spring Buildmaster
981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb
200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster
67189477fe Next development version 2014-06-26 10:51:35 -07:00
Phillip Webb
9632abf825 Formatting and cleanup 2014-06-26 09:41:15 -07:00
Phillip Webb
b01c1d36ae Attempt to fix Windows CI 2014-06-25 16:40:20 -07:00
Phillip Webb
e383d13ad9 Attempt to fix Windows CI 2014-06-25 16:32:16 -07:00
Phillip Webb
6311ae191f Throw exception on stop failure
Trying to fix the Windows CI build
2014-06-25 16:21:33 -07:00
Phillip Webb
03b281278a Trying to break windows build 2014-06-25 16:20:39 -07:00
Phillip Webb
d4ad67af44 Relax expected exception when connection fails
Exception appears to be different on Windows JVMs
2014-06-25 16:10:02 -07:00
Phillip Webb
1f36d4657f Fix various Windows related issues
Fixes gh-1168
2014-06-25 14:31:41 -07:00
Dave Syer
5d317f2dc7 Reflection hack for Tomcat 8 API change
Fixes gh-1148
2014-06-25 11:35:44 +01:00
Dave Syer
b0bf9c776f Fix logic error in ErrorPageFilter (fixes gh-1149) 2014-06-25 08:47:24 +01:00
Spring Buildmaster
542f3cbda8 Next development version 2014-06-24 13:53:56 -07:00
Phillip Webb
1f1a7e0ed3 Polish 2014-06-24 11:46:15 -07:00
Dave Syer
078e5425cd Avoid eager factory bean instantiation for container customizers 2014-06-24 14:52:38 +01:00
Dave Syer
999748bdab Fix some sloppy code in context hierarchy support
* The SpringApplicationBuilder was registering the parent context initializer
twice (not really a problem, but confusing if you are debugging).

* ParentContextApplicationContextInitializer itself should have been
checking that the current context is not the parent

* The EventPublishingRunListener as a result needs to call
setApplicationContext on any listeners that are AplicationContextAware

* ParentContextCloserApplicationListener can ensure that there is
only one of its kind per application context by implementing hashCode
and equals

Fixes gh-1142
2014-06-24 14:31:22 +01:00
Dave Syer
d2b88d741c Re-register SpringApplication listeners in context once it is available
Fixes gh-1141
2014-06-24 11:18:14 +01:00
Phillip Webb
ed3df32cdd Extract resource handling to TomcatResources
Extract the nasty Tomcat resource handling reflection code to its own
class.
2014-06-23 19:34:08 -07:00
Dave Syer
1bcc136374 Hack around with Tomcat resource paths
Tomcat 8 has different APIs again so it was quite difficult to
get it working and test it. The test is manual anyway (multi-module
project with JSPs in /META-INF/resources, not part of the samples),
and requires you to build a war and execute it (since the resource
paths are different when it's an archive).

Fixes gh-1131
2014-06-21 15:35:29 +01:00
Dave Syer
51496b4e4f Log exception in ErrorPageFilter
Fixes gh-1130
2014-06-21 09:32:36 +01:00
Phillip Webb
bfe4240ed2 Polish 2014-06-20 10:29:04 -07:00
Dave Syer
88379e2aa3 Check if response is committed before tryying to forward
It' sthe best we can do, but the container seems to still use our error page
(it just can't have the status code that we asked for).

Fixes gh-748
2014-06-20 12:15:10 +01:00
Phillip Webb
8a1279315e Move ApplicationContextTestUtils to src/test
Move ApplicationContextTestUtils from src/main to src/test since it
is probably of limited use to others.

Fixes gh-1034
2014-06-17 12:14:24 -07:00
Phillip Webb
25eb6fb81a Polish 2014-06-17 12:14:24 -07:00
Stephane Nicoll
f6ae300ec3 Fix parsing of properties in @IntegrationTest
This commit reuses the standard behavior provided by Properties for
parsing keys rather than parsing the keys ourselves. This provides a
consistent features set regardless of where the property is defined.

Fixes gh-1110
2014-06-17 14:57:04 +02:00
Stephane Nicoll
b646231327 Properly close context hierarchy in tests
Prior to this commit, some tests were creating a parent/child
relationship but were only closing the child context. This could
be an issue with the autoconfig module as a lot of auto-config
kicks in by default.

This commit adds a new test utility designed to properly handle
those situations. Updated tests that were creating a context
hierarchy to benefit from that.

Fixes gh-1034
2014-06-17 10:58:33 +01:00
Dave Syer
7c0c2e9ea5 Be defensive about factory beans in ConfigurationPropertiesBindingPostProcessor 2014-06-16 09:22:09 +01:00
Dave Syer
c5d46d0cab Re-instate test when fixed 2014-06-13 12:24:02 +01:00
Dave Syer
bb50e1ef8c Ignore test that is WIP 2014-06-13 12:05:41 +01:00
Dave Syer
1bf256dd58 Ensure Weblogic and Websphere JMX are covered
To ensure an MBeanServer is available when needed you have to
look in JNDI before resorting to the JDK platform factory.

I had to copy some private code from Spring, but it seems
worth it.

Fixes gh-1092
2014-06-13 11:27:41 +01:00
Dave Syer
d842446186 Catch application exception in tomcat starter thread and rethrow
Fixes gh-1088
2014-06-12 16:06:30 +01:00
Dave Syer
b4aaeaac7e Set Thread context class loader while Tomcat starts up
Fixes gh-1085
2014-06-12 15:10:53 +01:00
Spring Buildmaster
4ca26a21dc Next development version 2014-06-11 10:46:27 -07:00
Spring Buildmaster
05ed7b3bcd Next development version 2014-06-10 12:40:35 -07:00
Phillip Webb
3007a777d0 Roll back to 1.1.0.BUILD-SNAPSHOT 2014-06-10 09:00:08 -07:00
Spring Buildmaster
c650f2391e Next development version 2014-06-09 21:55:19 -07:00
Andrey Hihlovskiy
216e93fc5c Improve Jetty third-party integration support
Make JettyEmbeddedServletContainerFactory more useful for third-parties
by providing protected configureWebAppContext, addDefaultServlet and
addJspServlet methods that sub-classes can call.

Fixes gh-1056
2014-06-09 11:42:28 -07:00
Dave Syer
b75578d99c Adjust order of property sources
@PropertySources *can* and should be added in the slot
after the application.properties (code that is part of the
application should have lower precedence than external
configuration).

Fixes gh-1044
2014-06-07 11:10:51 +01:00
Phillip Webb
e891aa3525 Polish 2014-06-06 22:58:43 -07:00