Commit Graph

4213 Commits (0f14210937f93c28fa3e0586d3f57341909bdf0d)
 

Author SHA1 Message Date
Andy Wilkinson 6d2bb68aba Ensure that ErrorPageFilter handles errors during async dispatch
Previously, the ErrorPageFilter was not invoked for async dispatches.
This meant that an error that was set during an async dispatch would
go undetected and a 200 response with an empty body would be returned.

This commit updates ErrorPageFilter to configure its
OncePerRequestFilter so that async dispatches are filtered and the
correct error handling is performed.

Closes gh-2711
10 years ago
Andy Wilkinson c3a040acb3 Polishing
Remove unwanted System.out.println call
10 years ago
Stephane Nicoll c9997f7a4d Upgrade to Spring Framework 4.1.6
Closes gh-2702
10 years ago
Phillip Webb 35bfa16315 Use file based loader with MockServletContext
Update SpringApplicationContextLoader so that the MockServletContext
uses FileSystemResourceLoader. This allows `/src/main/webapp` folder
to be found.

See gh-2654
10 years ago
Andy Wilkinson 219317e8c7 Make web security config require spring-security-web on classpath
Previously, SpringBootWebSecurityConfiguration required a web
application and @EnableWebSecurity to be on the classpath.
@EnableWebSecurity is in spring-security-config so this could lead
to the configuration being active when spring-security-web isn't
on the classpath but the rest of Spring Security is.

This commit updates SpringBootWebSecurityConfiguration to also make it
conditional on a class in spring-security-web.

Fixes gh-2717
10 years ago
Phillip Webb 60c1a150b3 Polish 10 years ago
Phillip Webb bd2735ad66 Add alwaysMapUrl flag to ServletRegistrationBean
Add an additional constructor to ServletRegistrationBean that indicates
if a URL mapping is always required. If set to false, the registration
will not longer use the default '/*' mapping.

Fixes gh-2596
10 years ago
Phillip Webb 90bff0b603 Fix outdated RandomAccessJarFile documentation
Fixes gh-2598
10 years ago
Phillip Webb 4c50c9eaa8 Allow basic SystemPublicMetrics on GAE
Update SystemPublicMetrics to silently ignore ManagementFactory
NoClassDefFoundErrors which can occur when deploying to Google App
Engine.

Fixes gh-2701
10 years ago
Phillip Webb 6a6ae64aac Merge branch '1.1.x' into 1.2.x 10 years ago
Phillip Webb 4d8cf71496 Polish VcapApplicationListenerTests 10 years ago
Phillip Webb 6d880cf7f8 Merge pull request #2707 from nebhale/vcap-service-numbers
* vcap-service-numbers:
  Support VcapApplicationListener Number Credentials
10 years ago
Ben Hale 147755f396 Support VcapApplicationListener Number Credentials
Update VcapApplicationListener to support Number based credentials.
Previously, any service credential value that wasn't a String would
be discarded. This was particularly a problem for services that exposed
a port as a JSON Number.  This change takes numbers in the credential
payload into account, converting them to Strings so that they will pass
through the properties system properly. There's no real downside to this
as Spring will coerce them back into Numbers if needed by an application.

Fixes gh-2707
10 years ago
Phillip Webb 6322ea142d Upgrade to Spring Framework 4.1.6.BUILD-SNAPSHOT
See gh-2702
10 years ago
Phillip Webb 7c9ab5ced2 Minor documentation polish 10 years ago
Stephane Nicoll a615f8a44a Merge pull request #2698 from rtack/patch-1
* gh-2698:
  fix typo in javadoc
10 years ago
Raphael Ackermann 1235a35f2a fix typo in javadoc
{@code tomat-embedded.jar} --> {@code tomcat-embedded.jar}
10 years ago
Marcel Overdijk c0c67f2593 Update doc
Add note about escaping Spring property placeholders when using Gradle
automatic expansion.

Closes gh-2695
10 years ago
Andy Wilkinson c1eea4cf40 Ensure that a TTL of zero is honoured by HealthMvcEndpoint
See gh-2630
10 years ago
Andy Wilkinson c849a0aba1 Cache /health response irrespective of sensitivity and security
Previously, the response from /health was not cached if the request
was secure, i.e. the user has authenticated, or the endpoint was
configured as not being sensitive. 

The commit updates HealthMvcEndpoint to apply the caching logic
all the time. Users that do not want caching can disable it by 
configuring the TTL with a value of zero.

Closes gh-2630
10 years ago
Andy Wilkinson 0a38b9b3ab Enable the configuration of arbitrary Elasticsearch client properties
Previously, only a handful of properties could be set when
auto-configuring an Elasticsearch client. This commit introduces support
for configuring arbitrary properties using the
spring.data.elasticsearch.properties prefix. For example,
client.transport.sniff can be configured using
spring.data.elasticsearch.properties.client.transport.sniff.

Closes gh-1838
10 years ago
Andy Wilkinson 8b20403c41 Use a String when referencing a class with @ConditionalOnMissingClass
Using a Class reference can cause reflection problems at runtime (see
gh-1065).

Closes gh-2674
10 years ago
Dave Syer c153c4e517 Make tomcat provided in a war sample 10 years ago
Andy Wilkinson 89b4cac8b0 Allow Elasticsearch client-transport-sniff to be configured via the env
Previously, a TransportClient sniff property could not be configured
while using Spring Boot’s Elasticsearch auto-configuration. This commit
adds a new property, spring.data.elasticsearch.client-transport-sniff,
that can be used to configure the TransportClient while continuing to
use the auto-configuration support.

Closes gh-1838
10 years ago
Andy Wilkinson b82e220008 Polish spring-boot-features
Wrap at 90 chars more consistently
10 years ago
izeye a4be4670c3 Polish the documentation
Closes gh-2570
10 years ago
Andy Wilkinson 40fd0dce3c Merge branch '1.1.x' into 1.2.x
Conflicts:
	spring-boot-dependencies/pom.xml
10 years ago
Andy Wilkinson 1fba81e4ba Upgrade Spring Security 3.2.6.RELEASE
Closes gh-2582
10 years ago
Phillip Webb a717813c83 Update required Spring Framework version in docs
The actual required Spring Framework version is 4.1.5.

See gh-2575
10 years ago
Phillip Webb cac6ad21c1 Fix WebIntegrationTest JavaDoc
The example `@Value("server.local.port")` should read
`@Value("${local.server.port}")`.

Fixes gh-2628
10 years ago
Phillip Webb 16495d223a Polish 10 years ago
Phillip Webb bdd61b8ec2 Merge branch '1.1.x' into 1.2.x 10 years ago
Phillip Webb 8b979fa2e6 Polish 10 years ago
Andy Wilkinson 1f40c8a9ba Tolerate breaking API changes in ActiveMQ 5.11.0
In ActiveMQ 5.11 the signature of
PooledConnectionFactory.setConnectionFactory has changed. It now takes
an Object rather than a ConnectionFactory. This change is not binary
backwards compatible so it causes a NoSuchMethodError as we compile
against 5.10.

This commit updates ActiveMQConnectionFactoryConfiguration to call
the setConnectionFactory method reflectively, looking for both the
ConnectionFactory and Object variants.

Closes gh-2640
10 years ago
Andy Wilkinson 78a00b1658 Polish EmbeddedServletContainer’s javadoc
Closes gh-2647
10 years ago
Andy Wilkinson fc4376145c Process CompositePropertySources before EnumerablePropertySources
PropertySourcePropertyValues tries to process a PropertySource first
as an EnumerablePropertySource and then as a CompositePropertySource.
In Spring 4.1.2 CompositePropertySource was updated to extend
EnumerablePropertySource. This change meant that a
CompositePropertySource would always be processed as an
EnumerablePropertySource.

This commit updates PropertySourcePropertyValues to process a
PropertySource as a CompositePropertySource first and to then try it
is an EnumerablePropertySource.

Fixes gh-2608
10 years ago
Dave Syer f1ecf53495 Delay instantiation of DataSource as late as possible
Unfortunately it still has to happen in a @PostConstruct (otherwise
JPA never sees the schema in time), but we can delay a bit by not
using @Autowired. Appears to fix the Spring Cloud problem
(https://github.com/spring-cloud/spring-cloud-config/issues/105).

Fixes gh-2658
10 years ago
Eric Dahl 018310e478 Fix broken link in docs 10 years ago
Andy Wilkinson 743482ab69 Tolerate Gauges with non-Number values
Spring Boot's metrics infrastructure requires a Metric to have a
Number value. Coda Hale's ThreadStatesGaugeSet includes a Gauge
named deadlocks with a Set<String> value (each entry in the set is a
description, including stacktrace, of a deadlocked thread). There's
no obvious way to coerce this to a Number, and there's already a
deadlocks.count metric in the set.

This commit updates MetricRegistryMetricReader to ignore the addition
of any Gauge with a non-Number value.

Fixes gh-2593
10 years ago
Andy Wilkinson 9f0654bd77 Merge branch '1.1.x' into 1.2.x
Conflicts:
	spring-boot-dependencies/pom.xml
10 years ago
Andy Wilkinson 44d98c6186 Upgrade to Freemarker 2.3.22
Closes gh-2581
10 years ago
Andy Wilkinson 71dde3ec89 Tolerate removal of JacksonJodaFormat in Jackson 2.5
We currently officially support Jackson 2.4, but some users wish to
use Jackson 2.5. This causes a failure as JacksonAutoConfiguration
depends on JacksonJodaFormat which exists in 2.4 but not in 2.5. This
commit updates JodaDataTimeJacksonConfiguration to make it conditional
on JacksonJodaFormat being on the classpath. This means that Jackson
2.5 users will not have configurable DateTime formatting
(added in 201fb5e5) but things will generally work once again.

Closes gh-2573
10 years ago
Andy Wilkinson e927f52f26 Don’t use findAvailableTcpPort to allocate Undertow a random port
Using findAvailableTcpPort is prone to failure when another process
starts using the available port before Undertow starts. This commit
changes UndertowEmbeddedServletContainerFactory to pass the value of
zero down into Undertow where it will ultimately be passed to a
ServerSocket which will then use the underlying OS’s support for binding
to an available port.

Undertow doesn’t provide an API for getting the port(s) on which it’s
listening. Previously, reflection was being used to access the listener
configuration but, when a random port is used, this configuration would
return zero rather than the actual port. The reflective logic has been
updated to look at Undertow’s channels from which the underlying
ServerSocket can be accessed and the local port retrieved

Closes gh-2584
10 years ago
Andy Wilkinson 4487823ff9 Improve thread-safety of MetricRegistryMetricReader
ee567fa boldy claimed that it had made MetricRegistryMetricReader
thread-safe. It had not. This commit should actually make it thread
safe. I hope.

One notable improvement is that MetricRegistryMetricReader.findAll()
will no longer contain null values if a metric is removed on another
thread during iteration.

names is now a ConcurrentHashMap to allow it to be safely read and
written without holding a lock.

reverse is a LinkedMultiValueMap  which is not thread-safe. This could
lead to values being lost when concurrent add calls were made. Access
to reverse is now protected by synchronizing on an internal monitor
object.

Calls to containsKey(key) followed by get(key) have been reworked to
only call get(key), this avoids the possibility of the key being
removed after the contains check but before the get.

Closes gh-2590
10 years ago
Andy Wilkinson f761916b51 Honor unpack for war files
Previously repackaging of an archive was performed in three steps:

1. Write the manifest
2. Write entries from the source archive into the destination
3. Write any libraries into the destination if they’re not already there

This worked fine for jar files, but not for war files. In the war file
case the libraries are already in the source archive’s WEB-INF/lib
directory so they’re copied into the destination in step 2. This means
that step 3 largely becomes a no-op and, crucially, the UNPACK comment
is not applied to any libraries that require it.

This commit reorders steps 2 and 3 so that the libraries are copied into
the destination first (allowing the UNPACK comment to be written, if
required) and then any entries in the source are written into the
destination if they’re not already there.

Fixes gh-2588
10 years ago
Andy Wilkinson ee567fa8dd Make MetricRegistryMetricReader thread-safe
MetricRegistryMetricReader’s fields where neither final, nor volatile
but could be accessed on multiple threads. This lead to visibility
problems where the value of a field would unexpectedly be null, causing
an NPE.

This commit updates all of the fields to declare them as final, thereby
ensuring that their values are guaranteed to be visible across different
threads.

Fixes gh-2590
10 years ago
Rob Winch 493d7a364d Merge branch '1.1.x' into 1.2.x 10 years ago
Rob Winch 760d6eceee Fix Unnecessarily Adding Default Security User
Fixes gh-2567
10 years ago
Phillip Webb 0174476ff1 Merge branch '1.1.x' into 1.2.x 10 years ago
Phillip Webb 50e1f80581 Remove .factorypath files 10 years ago