Commit Graph

752 Commits (6c3d490c748bcc31382a25fe792ac16bbc489ebe)

Author SHA1 Message Date
Dave Syer f39d4978c3 Fix tests for JSON error rendering
See gh-1762
10 years ago
Dave Syer 254ab55476 Re-arrange priority of error message 10 years ago
Dave Syer 7bac7370c8 Use request attribute if available for error message
Fixes gh-1762, gh-1731
10 years ago
Phillip Webb 2e7aa4685b Polish 10 years ago
Phillip Webb d1ce83e3c3 Merge branch '1.1.x' 10 years ago
Phillip Webb 41b2e58476 Polish 10 years ago
Stephane Nicoll d2198c417d Fix ConnectionFactory auto-configuration with XA
Previously, the regular jms connection factory was always overriding
the xaConnectionFactory when using ActiveMQ. While
ActiveMQAutoConfiguration is namely shielded with a condition on a
missing ConnectionFactory bean, said configuration class also imports the
XA and regular configuration classes that both can create the connection
factory.

This commit adds a ConditionalOnMissingBean in the second class that is
imported in case the XA configuration has already defined what it needs.

Fixes gh-1727
10 years ago
Andy Wilkinson 31874090b8 Fix ArrayStoreException caused by JerseyAutoConfiguration again
This is a follow-on from the changes made in 2b7bf3e. In addition to the
problematic use of @ConditionalOnClass that was addressed in 2b7bf3e,
JerseyAutoConfiguration also used @ConditionalOnBean referencing a 
Jersey class. This has the same problem when used on a class that
implements WebApplicationInitializer. Implementing
WebApplicationInitializer causes the class’s annotations to be
introspected during servlet container initialiser processing. If a
@ConditionalOnBean annotation references a Class that cannot be
loaded an ArrayStoreException occurs.

This commit updates JerseyAutoConfiguration to reference ResourceConfig
as a String. This allows it annotations to be introspected without
attempting to load a Jersey class that may not be on the classpath.

Fixes gh-1733
Fixes gh-1719
10 years ago
Brett Wooldridge 9984939c47 Update HikariCP to 2.1.0, compile against the Java 6-compatible artifact
For those running applications on Java 8, dependency management for the
Java 8-compatible artifact is also provided.

Closes gh-1721
10 years ago
Andy Wilkinson 01fd8cb8f3 Reinstate Bitronix's default server ID, provide property to override it
Previously, Bitronix's server ID was hard-coded to be
spring-boot-jta-bitronix. This created the possibility of multiple
transaction managers performing recovery on each other's behalf as
they would be unable to identify their own XIDs due to the common
server ID.

This commit reinstates the default (which is the IP address of the
machine on which Bitronix is running), and introduces a new
property, spring.jta.transaction-manager-id, that can be used to
configure the id for both Atomikos and Bitronix. A cautionary note
has also been added to the documentation for Atomikos and Bitronix
explaining the need to configure this property.

Closes gh-1548
10 years ago
Andy Wilkinson 261b3afca1 Apply spring.jackson.* config to Spring Data REST object mappers
Closes gh-1698
10 years ago
Andy Wilkinson 9a2d654eba Rename test classes so that their tests are run by Maven 10 years ago
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
10 years ago
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.
10 years ago
Dave Syer cd3729b49d Merge branch '1.1.x' 10 years ago
Dave Syer ecee19057c Add some precautionary tests for documenting AuthenticationManager config 10 years ago
Andy Wilkinson a156ae3434 Add missing @since tag 10 years ago
Stephane Nicoll e60cc57807 Fix typo
Fixes gh-1701
10 years ago
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
10 years ago
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
10 years ago
Spring Buildmaster 3e71a21b30 Next development version 10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Phillip Webb b87a591d27 Revert "Add ActiveMQ MQTT connection URL auto-detection"
This reverts commit 0d8bde58c9.

Fixes gh-1679
10 years ago
Phillip Webb 30f8954b4a Add @since tag 10 years ago
Phillip Webb 6281070d0a Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
10 years ago
Phillip Webb 6009f41782 Polish 10 years ago
Andy Wilkinson 4cf9e0457f Provide auto-configuration of persistence exception translation
Closes gh-1435
10 years ago
Dave Syer fa95a6f6bd Merge branch '1.1.x' 10 years ago
Dave Syer 3135c7f8ae Escape strings in whitelabel error page (HTML) 10 years ago
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
10 years ago
Henryk Konsek 0d8bde58c9 Add ActiveMQ MQTT connection URL auto-detection
Fixes gh-1638
10 years ago
Michael Stummvoll 5d32ec7463 Add VelocityProperties.preferFilesystemAccess
Update VelocityProperties to include a preferFilesystemAccess attribute.

Fixes gh-1652
10 years ago
Phillip Webb 62eb01f0b8 Polish 10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
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
10 years ago
Andy Wilkinson c601c09ecc Upgrade to Hibernate Validator 5.1.2.Final
Closes gh-1595
10 years ago
Dave Syer 8d5f26f6bd Fix missing resource exception if spring-cloud not on classpath 10 years ago
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
10 years ago
Phillip Webb a7a337a14f Merge branch '1.1.x' 10 years ago
Phillip Webb d0990c06a6 Fix typo in HttpMessageConverters auto-conf Tests 10 years ago
Spring Buildmaster edb4b7ed7d Next development version 10 years ago
Phillip Webb 08f2522eba Add missing @since tag 10 years ago
Phillip Webb 1ed90df630 Merge branch '1.1.x' 10 years ago