Commit Graph

2570 Commits (55b0c0911df81743023d6f683bd417d7711a485d)

Author SHA1 Message Date
Mandap 82465cf435 Fix JSP availability check when not running as a packaged war
See gh-12859
7 years ago
Andy Wilkinson e7b03f7ca3 Don't auto-configure MultipartConfigElement when using Commons FileUpload
Previously, when a user had declared a custom MultipartResolver bean
that is a CommonsMultipartResolver, part resolution would fail. The
failure was occurring as the servlet container was consuming the parts
before CommonsMultipartResolver had a chance to read them. This was
happening because a MultipartConfigElement was being auto-configured.

This commit updates the multipart auto-configuration so that a
MultipartConfigElement is not auto-configured when there is a
CommonsMultipartResolver bean in the context.

Closes gh-7735
7 years ago
Stephane Nicoll 99f993bc82 Add tests for JndiConnectionFactoryAutoConfiguration
Closes gh-13526
7 years ago
Spring Buildmaster 36b8639853 Next Development Version 7 years ago
Brian Clozel 1b81f6f4c0 Fix security test with changes in SPR-16836
This commit replaces the use of a GET method by a DELETE method for
testing that the HiddenHttpMethodFilter is ordered before the security
filter. With SPR-16836 changes, only PUT DELETE and PATCH are now
allowed.
7 years ago
Stephane Nicoll c67aedd8bc Polish "Retrieve javax.cache.CacheManager using Bean ClassLoader"
Closes gh-13338
7 years ago
Martin Theiss 76b9d0d243 Retrieve javax.cache.CacheManager using Bean ClassLoader
This commit uses the bean's classloader to retrieve the CacheManager to
prevent issues with off-heap serialization.

See gh-13338
7 years ago
Stephane Nicoll f745f20c8c Clarify scope of JNDI-based MailSenderAutoConfiguration
This commit separates the auto-configuration of JavaMailSender in two
distinct configuration: one based on existing Session available on JNDI
and the other one based on properties configuration.

This clarifies the auto-configuration report and the fact that the JNDI
variant overrides any Session-related properties that would have been
set in the environment

Closes gh-13026
7 years ago
Phillip Webb 5243adce22 Restore Java 1.6 compatibility 7 years ago
Phillip Webb 4d84933ee4 Also call setHttpOnly property on Tomcat context
Update `ServerProperties` to also call `setHttpOnly` on the
`TomcatContext`. It appears that this is required in addition to
using the `ServletContextInitializer` to setup `SessionCookieConfig`.

Closes gh-12580
7 years ago
Stephane Nicoll 3118f14dbb Fix NPE when OnExpressionCondition is invoked with a null BeanFactory
Closes gh-13249
7 years ago
Phillip Webb 4853477081 Reformat code 7 years ago
Stephane Nicoll 8997143f31 Fix checkstyle violations 7 years ago
Phillip Webb 37646517cf Polish 7 years ago
Stephane Nicoll d9029ef69e Fix documentation of spring.kafka.producer.batch-size
Closes gh-13127
7 years ago
Stephane Nicoll b48f34117e Polish "Add support for Jersey WrappingResourceConfig"
Closes gh-13117
7 years ago
Zoltan Reegn dfcd87207f Add support for Jersey WrappingResourceConfig
See gh-13117
7 years ago
Spring Buildmaster 010b4fccbd Next development version 7 years ago
Phillip Webb 99dad81e9a Update copyright header year for changed files 7 years ago
Phillip Webb 0a0247975c Formatting 7 years ago
Stephane Nicoll 1314aaa368 Avoid early init of CacheManager
This commit restructures the Cache auto-configuration to avoid an early
init on CacheManager (and potentially all its infrastructure). Rather
than adding a dependency on the validator bean, this commit relies on
the fact CacheAspectSupport checks if a CacheManager is available in the
afterSingletonsInstantiated callback. In this case, a simple bean with
a postconstruct callback is enough.

Closes gh-13038
7 years ago
Phillip Webb 4e96587dc8 Polish modifier declaration ordering
Follow that Java language specification.
7 years ago
Phillip Webb 64930d4e5b Polish caught exception names
Prefer `ex` over `e`.
7 years ago
Phillip Webb 3ee777e142 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
7 years ago
Andy Wilkinson 06cf698387 Polish 7 years ago
Stephane Nicoll 08bc306a61 Guard IntegrationJmxConfiguration if no mBeanServer is available
Closes gh-12966
7 years ago
Andy Wilkinson df2372cd93 Avoid Kafka 0.10 destabilising the Windows build
Closes gh-12963
7 years ago
Spring Buildmaster c10aad165f Next Development Version 7 years ago
Spring Buildmaster ade4760842 Next Development Version 7 years ago
Phillip Webb 6b59814cbc Switch error views to use SimpleEvaluationContext
Update `ErrorMvcAutoConfiguration` to use `SimpleEvaluationContext`
rather than `StandardEvaluationContext`.

Fixes gh-12507
7 years ago
Phillip Webb dd0866000f Revert "Add text/plain error response support"
This reverts commit 23892e33d6.
7 years ago
Phillip Webb a8f366a554 Fix copyright header for edited files 7 years ago
Phillip Webb 23892e33d6 Add text/plain error response support
Refine `BasicErrorController` mappings so that only JSON and XML get
structured responses. A simple string response is returned for all
other media types.

Fixes gh-12513
7 years ago
igor-suhorukov 6bdfce5874 Polish
Closes gh-12422
7 years ago
Stephane Nicoll 66d1f5cd0b Fix expansion of static-locations array
This commit fixes a NPE when the static-locations array of
`ResourceProperties` has to be expanded as the setter is cleaning the
values of the array and is affected by a non-intuitive behaviour of the
binder.

When the binder needs to set an element of an array and the size of the
array isn't large enough, the binder proceeds as follows:

* An array of the required size is created
* The content of the original array is copied over
* The setter of the property is invoked with the new array
* The setter of the property is invoked and the returned array is
mutated to set the requested value

While one would expect the array to contain the requested value when the
setter is invoked, this is not the case. Also, the array might contain
null values if a value at index 8 should be set and the array has a size
of 3.

All in all, `ResourceProperties#appendSlashIfNecessary` has to account
for `null` and an additional round of cleaning has to happen once
binding has completed.

Closes gh-12360
7 years ago
Madhura Bhave c2f7dd86dc Revert default for CRSF enabled to false
Fixes gh-12267
7 years ago
Stephane Nicoll b4a7e1d64b Use toLowerCase() and toUpperCase() with Locale.ENGLISH
This commit updates all `toLowerCase()` and `toUpperCase` invocations to
use the variant that takes a `Locale` to avoid locale-specific side
effect.

Closes gh-12213
7 years ago
Madhura Bhave 4e61136948 Enable CSRF protection by default
See gh-11758
7 years ago
Andy Wilkinson 145d8d2673 Defer removal of Connectors until after ServletContext initialization
Previously, we removed the Connectors from Tomcat's Service before
the Context was started. The removal of the Connectors is required as
it prevents Tomcat from accepting requests before we're ready to
handle them.

Part of starting the Context is creating and initializing the
ServletContext. ServerProperties uses a ServletContextInitializer to
set the session tracking modes and Tomcat rejects the SSL tracking
mode if there is no SSL-enabled connector available. With the previous
arrangement this led to a failure as the Connectors had been removed
so the SSL-enabled connector could not be found.

This commit updates the embedded Tomcat container to defer the
removal of the Connectors until after the context has been started
but still at a point that is before the Connectors themselves would
have been started.

Closes gh-12058
7 years ago
Phillip Webb 798522d890 Format with Eclipse Oxygen SR2 7 years ago
Spring Buildmaster 6414b42335 Next Development Version 7 years ago
Phillip Webb 61f7bd8576 Polish 7 years ago
Stephane Nicoll 11f700aa9d Fix handling of redis password containing a colon
Closes gh-11371
7 years ago
Andy Wilkinson 5a74f63f7c Polish "Configure ErrorReportValve not to report stack traces"
Closes gh-11790
7 years ago
Alex Panchenko 29736e340e Configure ErrorReportValve not to report stack traces
See gh-11790
7 years ago
Andy Wilkinson c06956376c Use correct Assert class in ServerPropertiesAutoConfiguration 7 years ago
Phillip Webb 8e783cdae9 Polish 7 years ago
Stephane Nicoll 6c191e149d Fix broken usage of LiquibaseServiceLocatorApplicationListener 7 years ago
Stephane Nicoll 8529913b24 Improve error message when no ServerProperties bean is found
Closes gh-11511
7 years ago
Stephane Nicoll 7b3bedc468 Fix detection of dot-based resource bundle basenames
This commit makes sure that properties-based resource bundle location
with a dot is detected. It also harmonizes the description of the
configuration key as our support is not stricly matching the convention.

Closes gh-10092
7 years ago
Johnny Lim d2109ddf4d Use MongoClient consistently
Closes gh-11431
7 years ago
Stephane Nicoll 29565a7981 Polish 7 years ago
Stephane Nicoll dbae4fc1c3 Make it easier to use jOOQ with several data sources
Closes gh-11324
7 years ago
Phillip Webb 6a55623910 Polish 7 years ago
Stephane Nicoll 7b8adfab41 Polish 7 years ago
Stephane Nicoll d920b49ba1 Polish
See gh-11193
7 years ago
Spring Buildmaster df2ae7aa19 Next Development Version 7 years ago
Andy Wilkinson 137d3f3533 Test Flyway location checking with implicit classpath: prefix
Closes gh-10894
7 years ago
Andy Wilkinson d4e19f8170 Auto-configure jOOQ after transaction auto-configuration
jOOQ auto-configuration will make use of a PlatformTransactionManager
bean if available. This commit ensures that jOOQ is auto-configured
after transaction auto-configuration, thereby ensuring that any
auto-configuration PlatformTransactionManager bean can be consumed.

Closes gh-11052
7 years ago
Stephane Nicoll fc3d25d705 Properly document spring.data.neo4j.open-in-view's default value
Closes gh-10826
7 years ago
Marten Deinum ab3d65ccae Polish JobLauncherCommandLineRunner
The JobLauncherCommandLineRunner reassigned method arguments inside the
merge method. Instead of reassigning the method argument just return
the new instance directly.

Also some minor cleanup (unnesseccary null check and continue keyword).

Closes gh-10612
7 years ago
Stephane Nicoll 81e33dc801 Fix NPE in url is null and no embedded database is available
Closes gh-10626
7 years ago
Spring Buildmaster c0f9f64776 Next Development Version 7 years ago
Andy Wilkinson ffdff1cdc2 Consider multiple MBeanExporters when excluding beans from export
Closes gh-10632
7 years ago
Johnny Lim bfa291f671 Polish 7 years ago
Andy Wilkinson 616d11c00a Only wait for background preinit to complete when it has started
Closes gh-10362
7 years ago
Eddú Meléndez 93844bffbc Polish JacksonAutoConfiguration
This commit removes unused constructor parameters introduced in 0c2ecb7.

Closes gh-10412
7 years ago
Stephane Nicoll d490b99473 Clarify scope of spring.datasource.platform
Closes gh-10416
7 years ago
Stephane Nicoll 61ae92992b Polish "Document default value change for proxy-target-class"
Closes gh-10134
7 years ago
Stephane Nicoll fbb6b88155 Document default prefix/suffix values
Closes gh-10290
7 years ago
Stephane Nicoll b309495c2e Polish 7 years ago
Spring Buildmaster 30eb937a83 Next Development Version 7 years ago
Andy Wilkinson 5938df52ea Stop auto-config of MethodValidationPP triggering early init
Previously, if a user's configuration class provided a custom
Validator bean, that configuration class would be initialized very
early so that the Validator could be used to create the
auto-configured MethodValidationPostProcessor. This early
initialization could problems as it may prevent any of the
configuration class's dependencies from being post-processed.

This commit updates the injection of the Validator bean to be lazy,
thereby preventing the creation of the auto-configured
MethodValidationPostProcessor from triggering early initialization.

Closes gh-9416
7 years ago
Stephane Nicoll db18abc542 Fix Elasticsearch template condition if no client is defined
This commit makes sure to backoff if a Client bean is not available.

Closes gh-10143
7 years ago
Stephane Nicoll 5fc01880bc Polish 7 years ago
Madhura Bhave 64ffcfc83f Document JWK property
Closes gh-10022
7 years ago
Paul Vorbach 04ca7f137d Identify and fix incomplete assertions
Several calls to assertThat lacked a following assertion most often due
to wrong use of parenthesis.

See gh-10084
7 years ago
Madhura Bhave 9b5e5f32e1 ClientId not always required for client credentials
Fixes gh-10013
7 years ago
Stephane Nicoll fa037610f8 Add missing class check on Neo4jDataAutoConfiguration
Neo4jDataAutoConfiguration is meant to kick in when Spring Data Neo4J is
on the classpath. Yet, we were only checking for the presence of neo4j
itself and the transaction manager provided by spring-tx.

This commit makes sure to back off if Spring Data Neo4J is not present.

Closes gh-10038
7 years ago
Stephane Nicoll dbaaf2a5fa Improve conditions on FreeMarkerWebConfiguration
This commit makes sure to prevent the Freemarker web auto-configuration
to kick in if `spring-webmvc` is not on the classpath.

Closes gh-10027
7 years ago
Andy Wilkinson e08d09f5a3 Polish "Fix logged property names when initializing OAuth2 client"
See gh-9944
7 years ago
Christian Bühler 6babd41f19 Fix logged property names when initializing OAuth2 client
Closes gh-9944
7 years ago
Johnny Lim 56f47e1a50 Polish
Closes gh-9938
7 years ago
Gytis Trikleris f43ad00129 Delay Narayana recovery manager until it's started explicitly
Closes gh-9641
7 years ago
Andy Wilkinson d62c26c971 Ensure that preinitialization has completed before run returns
Previously, background preinitialization was started in response to
an ApplicationEnvironmentPreparedEvent and would complete at an
undetermined time later. This opened a window where SpringApplication
run could return and background preinitialization could still be
in progress. If, within this window, something attempted to configure
the logging system, an IO failure could occur as logging on the
background preinitialization thread would attempt to use resources
that had been closed.

This commit updates BackgroundPreinitializer so that it waits for
preinitialization to have completed when it receives an application
ready or application failed event. This prevents SpringApplication
run from returning while preinitialization is still in progress,
closing the window described above.

With info level logging enabled it appears that background
preinitialization consistently completes before the application ready
event is published. As a result, waiting should have no adverse effect
on performance in normal circumstances. With logging configured such
that background preinitialization outputs a large volume of log
messages (enabling trace logging for the root logger, for example), it
will be slowed down sufficiently for waiting to be necessary.

Closes gh-5669
7 years ago
Andy Wilkinson 42eec50e90 Perform background preinitialization once per class loader
Background preinitialization triggers static initialization of a
number of components that are slow to initialize. As the
initialization is static, it's only necessary once per class loader.

Previously, a new background preinitialization thread would be
created and started for each ApplicationEnvironmentPreparedEvent.
This commit updates the preinitializer to only create and start the
thread if preinitialization has not already been started for the
current class loader.

Closes gh-9869
7 years ago
Spring Buildmaster 17a5bb0be4 Next development version 7 years ago
Spring Buildmaster 41c5c0e7c9 Next development version 7 years ago
Phillip Webb dca463c7d9 Polish 7 years ago
Phillip Webb 66619bbe2b Formatting 7 years ago
Phillip Webb b9cfe21193 Make @ImportAutoConfiguration not register package
Update `@ImportAutoConfiguration` so that it is no longer annotated with
`@AutoConfigurationPackage` and as such isn't a marker for
`AutoConfigurationPackages`.

Having `@ImportAutoConfiguration` marked as an auto-configuration
package is particularly problematic in tests since it frequently breaks
context caching.

Fixes gh-9282
7 years ago
Stephane Nicoll 9fd94720f1 Better customization of the auto-configured ActiveMQConnectionFactory
This commit exposes additional properties and a callback interface to
further tune the auto-configured ActiveMQConnectionFactory.

Closes gh-9667
7 years ago
Stephane Nicoll 9a34d952e9 Provide an alternative to `spring.activemq.pool.configuration`
This commit expands the support of PooledConnectionFactory so that
binding the third party object is no longer necessary. All 3rd party
properties are now deprecated in favour of our explicit support.

The main reason behind this change is that a `connection-factory` and
`properties` property were exposed. The former is used to set the
`ConnectionFactory` and makes no sense as a key. The latter is
rebuilding the underlying `ActiveMQConnectionFactory` at each call
without reusing any existing settings.

Closes gh-9837
7 years ago
Andy Wilkinson d4ecda9030 Work around javac bug (internal review ID 9050163) 7 years ago
Andy Wilkinson bb35e772c2 Polish "Make NarayanaRecoveryManagerBean conditional on missing bean"
Closes gh-9724
7 years ago
Gytis Trikleris d8a6954744 Make NarayanaRecoveryManagerBean conditional on missing bean
See gh-9724
7 years ago
Andy Wilkinson 8f877dcee2 Disable auto-config of Narayana's JMS support when JMS module absent
Closes gh-9844
7 years ago
Andy Wilkinson 39b4ecdf63 Adapt to breaking change in Spring Data
See gh-9834
7 years ago
Andy Wilkinson c70cc55db8 Polishing
See gh-9827
7 years ago
Andy Wilkinson 15410a406e Revert "Stop auto-config of MethodValidationPP triggering early init"
5198fe887b. The underlying Framework
problem that prevents @Lazy from working properly is still there
in some form or another.

See gh-9416
7 years ago