Commit Graph

1341 Commits

Author SHA1 Message Date
Andy Wilkinson
0a3d8a9bfb Merge branch '1.1.x' and fix failure caused by XML response
Spring 4.1 has added support for XML HTTP message conversion using
Jackson. This was resulting in the response being sent back as XML
rather than JSON. Jackson's XML support doesn't cope well with lists
when it's being asked to deserialize to a Map [1] which is what the
test was doing.

This commit updates the test to indicate that it only accepts
application/json, thereby ensuring that the response can be correctly
deserialized into a Map.

Fixes gh-1715

[1] https://github.com/FasterXML/jackson-dataformat-xml/issues/122
2014-10-15 16:12:35 +01:00
Andy Wilkinson
fff94733ef Rename class so Maven runs its tests
Maven is configured to run tests found in classes ending in Tests.
This meant that the tests in BasicErrorControllerIntegrationTest (note
the missing s) were not being run.

This commit renames the test class so that it's picked up by Maven.
2014-10-15 16:05:25 +01:00
Dave Syer
cd3729b49d Merge branch '1.1.x' 2014-10-15 11:32:05 +01:00
Dave Syer
ecee19057c Add some precautionary tests for documenting AuthenticationManager config 2014-10-15 11:31:44 +01:00
Andy Wilkinson
a156ae3434 Add missing @since tag 2014-10-14 09:11:56 +01:00
Stephane Nicoll
e60cc57807 Fix typo
Fixes gh-1701
2014-10-13 20:39:30 +02:00
Andy Wilkinson
4b9f14f55b Separate out the auto-configuration of Spring Data’s web support
Previously, Spring Data’s web support was auto-configured as part of the
JPA repositories auto-configuration. However, Spring Data’s web support
isn’t dependent on the use of Spring Data JPA or even repositories.

This commit moves the auto-configuration into a standalone class, making
it independent of the use of Spring Data JPA and Spring Data
repositories.

Closes gh-1097
2014-10-13 15:14:26 +01:00
Andy Wilkinson
2b7bf3e733 Fix ArrayStoreException caused by JerseyAutoConfiguration
JerseyAutoConfiguration is annotated with @ConditionalOnClass. It
references both SpringComponentProvider.class and
ServletRegistration.class. Normally, this wouldn't be a problem as, in
the absence of either of those classes, the configuration class bean
will not be present in the bean factory and, therefore, its
annotations will never be introspected using reflection.

However, JerseyAutoConfiguration is a WebApplicationInitializer. This
means that when it's deployed to a standalone container,
JerseyAutoConfiguration is found by the container and its class is
passed to SpringServletContainerInitializer.
SpringServletContainerInitializer introspects every
WebApplicationInitializer class so that it can order them. This blows
up if Jersey's SpringComponentProvider class isn't on the classpath as
the annotation is referencing SpringComponentProvider as a Class and
the attempt to load it fails. The problem can be avoided by
referencing SpringComponentProvider using a String.

Fixes gh-1696
2014-10-13 11:21:55 +01:00
Spring Buildmaster
3e71a21b30 Next development version 2014-10-10 15:19:47 -07:00
Phillip Webb
c40aab657f Don't import JmsBootstrapConfiguration directly
Remove the direct unconditional JmsBootstrapConfiguration @Import from
JmsAnnotationDrivenConfiguration in favor of the nested
EnableJmsConfiguration class.

Fixes gh-1513
2014-10-10 14:08:24 -07:00
Phillip Webb
517b40d9b9 Don't call close() on JNDI DataSource
Update the JNDI auto-configured DataSource so that the close method
isn't called when the ApplicationContext is closed.

Fixes gh-1520
2014-10-10 13:49:15 -07:00
Phillip Webb
a3527521a2 Also resolve favicon.ico from resource folders
Update FaviconConfiguration to allow favicon.ico files to be resolved
from static resource folders (/META-INF/resources, /resources, /static,
/public) in addition to the root classpath.

Fixes gh-1656
2014-10-10 13:09:30 -07:00
Phillip Webb
001f2d6c69 Improve performance of MessageSource condition
Update the MessageSourceAutoConfiguration condition to skip scanning for
well known JARs. Results are now also cached.

Fixes gh-1689
2014-10-10 11:48:12 -07:00
Phillip Webb
dca637f51f Replace @ConditionalOnExpression with OnProperty
Replace where possible all @ConditionalOnExpression annotations with
@ConditionalOnProperty which is both faster to run and more descriptive.

Fixes gh-1685
2014-10-10 11:48:05 -07:00
Phillip Webb
b87a591d27 Revert "Add ActiveMQ MQTT connection URL auto-detection"
This reverts commit 0d8bde58c9.

Fixes gh-1679
2014-10-09 19:24:47 -07:00
Phillip Webb
30f8954b4a Add @since tag 2014-10-09 13:04:44 -07:00
Phillip Webb
6281070d0a Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
2014-10-09 13:00:27 -07:00
Phillip Webb
6009f41782 Polish 2014-10-09 12:58:55 -07:00
Andy Wilkinson
4cf9e0457f Provide auto-configuration of persistence exception translation
Closes gh-1435
2014-10-09 16:19:33 +01:00
Dave Syer
fa95a6f6bd Merge branch '1.1.x' 2014-10-09 16:11:52 +01:00
Dave Syer
3135c7f8ae Escape strings in whitelabel error page (HTML) 2014-10-09 16:10:57 +01:00
Andy Wilkinson
07cb8f2836 Ensure that spring.data.rest.* configuration takes effect
Previously, RepositoryRestMvcBootConfiguration was not annotated with
@Configuration. This meant that it was processed in lite mode.
Crucially, in lite mode, there’s no proxying so each call to the
config() @Bean method from within other @Bean methods resulted in the
creation of a new RepositoryRestConfiguration instance. Furthermore, as
each of these instances wasn’t a Spring bean the configuration
properties were not applied.

This commit updates RepositoryRestMvcBootConfiguration to annotate it
with @Configuration so that it’s no longer processed in lite mode. It
also updates the unit tests and the Spring Data REST sample to verify
that the baseUri can be configured using application.properties.

Fixes gh-1675
2014-10-09 14:29:38 +01:00
Henryk Konsek
0d8bde58c9 Add ActiveMQ MQTT connection URL auto-detection
Fixes gh-1638
2014-10-08 11:53:06 -07:00
Michael Stummvoll
5d32ec7463 Add VelocityProperties.preferFilesystemAccess
Update VelocityProperties to include a preferFilesystemAccess attribute.

Fixes gh-1652
2014-10-07 09:47:29 -07:00
Phillip Webb
62eb01f0b8 Polish 2014-10-06 12:03:51 -07:00
Sebastien Deleuze
315213ea4e Support Jackson based XML serialization and Jackson2ObjectMapperBuilder
This commit introduces support for Jackson based XML serialization, using the
new MappingJackson2XmlHttpMessageConverter provided by Spring Framework
4.1. It is automatically activated when Jackson XML extension is detected on the
classpath.

Jackson2ObjectMapperBuilder is now used to create ObjectMapper and XmlMapper
instances with the following customized properties:
 - MapperFeature.DEFAULT_VIEW_INCLUSION is disabled
 - DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabled

JodaModuleAutoConfiguration and Jsr310ModuleAutoConfiguration have been removed
since their behaviors are now handled directly by the ObjectMapper builder.

In addition to the existing @Bean of type ObjectMapper support, it is now
possible to customize Jackson based serialization properties by declaring
a @Bean of type Jackson2ObjectMapperBuilder.

Fixes gh-1237
Fixes gh-1580
Fixes gh-1644
2014-10-06 10:54:38 +01:00
Stephane Nicoll
30351c6277 Provide native JtaTransactionManager when applicable
This commit updates JndiJtaConfiguration to provide the same detection
algorithm as <tx:jta-transaction-manager>. If a native JTA transaction
manager exists for the current platform, it is used instead of the regular
JtaTransactionManager implementation.

Fixes gh-1576
2014-10-02 16:33:31 +02:00
Dave Syer
339f3b7bf0 Add autoconfig support for Jersey (2)
Jersey 2 has some Spring support built in but it's a bit awkward to
use in a Boot app, so autoconfiguration seems appropriate. The tests
and sample show how to use it, but the short story is that any
@Component can define JAX-RS endpoints via @GET etc.

There's a sample for Jersey 1 as well (pay careful attention to
the plugin configuration if you want to build an executable jar)

Fixes gh-1651
2014-10-02 11:22:00 +01:00
Andy Wilkinson
de8a2a71d0 Turn (Jackson|Gson)AutoConfiguration into true auto-configuration
Previously JacksonAutoConfiguration and GsonAutoConfiguration were
not actually auto-configuration classes. They were only processed
due to being imported by HttpMessageConvertersAutoConfiguration.
In addition to being misleadingly named, this meant that they could
not be included or excluded individually and were also tightly coupled
to HTTP message conversion.

This commit updates spring.factories to make both
JacksonAutoConfiguration and GsonAutoConfiguration actual
auto-configuration classes. As a result, they can now be enabled or
disabled individually and are no longer coupled to HTTP message
conversion.

Closes gh-1562
2014-10-02 10:33:02 +01:00
Manuel Doninger
02e33c125c Use reflection to load Hibernate version specific classes
This adds support for Hibernate 4.2 again by loading the specific
classes with reflection.

Fixes gh-1460, fixes gh-1557
2014-10-02 09:49:11 +01:00
Andy Wilkinson
c601c09ecc Upgrade to Hibernate Validator 5.1.2.Final
Closes gh-1595
2014-10-01 17:28:29 +01:00
Dave Syer
8d5f26f6bd Fix missing resource exception if spring-cloud not on classpath 2014-09-30 15:08:58 +01:00
Marcel Overdijk
e070d55491 Make Jackson date format and property naming strategy configurable
Allow the environment to be used to configure Jackson's date format
and property naming strategy

Closes gh-1628
2014-09-30 11:07:29 +01:00
Phillip Webb
a7a337a14f Merge branch '1.1.x' 2014-09-25 22:04:23 -07:00
Phillip Webb
d0990c06a6 Fix typo in HttpMessageConverters auto-conf Tests 2014-09-25 22:03:30 -07:00
Spring Buildmaster
edb4b7ed7d Next development version 2014-09-25 21:02:37 -07:00
Phillip Webb
08f2522eba Add missing @since tag 2014-09-25 20:09:49 -07:00
Phillip Webb
1ed90df630 Merge branch '1.1.x' 2014-09-25 13:06:54 -07:00
Phillip Webb
bff39e954e Add server.tomcat.port-header support
Update Tomcat ServerProperties to support the RemoteIpValve portHeader
property.

Fixes gh-1616
2014-09-25 13:04:12 -07:00
Phillip Webb
0dc46a2fe7 Drop protocolHeader and remoteIpHeader defaults
The `protocolHeader` and `remoteIpHeader` no longer have default values
and must be opt-in.

Fixes gh-1624
2014-09-25 12:58:23 -07:00
Phillip Webb
abed1f4d4c Restore ThymeleafAutoConfiguration test
Restore the test removed during the merge.
2014-09-25 10:41:32 -07:00
Phillip Webb
38585ec4eb Merge branch '1.1.x' 2014-09-25 10:40:49 -07:00
Phillip Webb
258059ea08 Fix failing ThymeleafAutoConfigurationTests
Remove accidental addition of a 1.2 test.
2014-09-25 10:27:05 -07:00
Phillip Webb
0d0e5eb590 Merge branch '1.1.x' 2014-09-25 10:05:35 -07:00
Dave Syer
304920df07 Make Thymeleaf @ConditionalOnWebApplication
If user creates a Thymeleaf app with a parent-child context then the
child should contain all the web-specific pieces (and they are likely
to fail fast if they need to be ServletContextAware, or slower if they
try to locate a WebApplicationContext at runtime). This can't happen
if the view resolver is being added to the parent.

Freemarker and Velocity already have similar tests because it is assumed
that they should be usable outside a web app, so this change just does the
same for Thymeleaf.

Fixes gh-1611
2014-09-25 09:54:50 -07:00
Phillip Webb
0b50fe4eff Support String to char[] bindings
Update RelaxedConversionService to also support String to char[]
conversion. Primarily to support the `password` field in
MongoProperties.

Fixes gh-1572
2014-09-24 16:03:51 -07:00
Andy Wilkinson
5d1a114aa6 Merge branch '1.1.x'
Redundant @ConditionalOnMissingBean annotation has been removed.
ActiveMQConnectionFactoryConfiguration is not auto-configuration and
is imported by ActiveMQAutoConfiguration which is protected by
@ConditionalOnMissingBean(ConnectionFactory.class)
2014-09-23 10:14:03 +01:00
Andy Wilkinson
cf22e28ddc Add tests to verify that ActiveMQAutoConfiguration backs off
See gh-1599
2014-09-23 10:11:26 +01:00
Andy Wilkinson
42821990f4 Merge branch '1.1.x' 2014-09-23 09:42:29 +01:00
Tomas Lin
38d8a5cda0 Fix typo in comment
Closes gh-1596
2014-09-23 09:42:03 +01:00