Commit Graph

7054 Commits (7a5fabf59d838c3e70cc24b38ddc41db773504ce)
 

Author SHA1 Message Date
Andy Wilkinson f94e8bd287 Do not try to auto-configure Jolokia if Spring MVC is not on classpath
The Jolokia auto-configuration requires ServletWrappingController from
Spring MVC to be on the classpath. This commit updates the
auto-configuration to make it conditional on the presence of this
class.

Closes gh-5153
9 years ago
Andy Wilkinson b4cda625c4 Break cycle caused by JndiDataSourceAutoConfiguration
There's a long cycle when Spring Data REST, Data JPA and Actuator
are used in an app that retrieves its DataSource from JNDI. The cycle
is:

- WebMvcAutoConfiguration
- HttpMessageConverters
- MappingJackson2HttpMessageConverter (needs an ObjectMapper)
- SpringBootRepositoryRestMvcConfiguration
- ObjectMapper
- RepositoryResourceMappings (part of a custom Jackson module)
- Repositories
- EntityManagerFactory (Triggered by application's Spring Data JPA repository)
- HibernateJpaAutoConfiguration
- JndiDataSourceAutoConfiguration
- MBeanExporter (Used to prevent export of DataSource MBean that's already in JMX)
- EndpointMBeanExportAutoConfiguration
- ObjectMapper (Used to format JSON produced by the exported endpoints)

Spring Data Rest caused the ObjectMapper to depend on JPA. JPA depends
on the DataSource. JnidDataSourceAutoConfiguration depends on the
MBeanExporter. Actuator's MBeanExporter requires an ObjectMapper to
produce JSON strings.

This commit breaks the cycle by making JndiDataSourceAutoConfiguration
access the MBeanExporter lazily. Rather than using `@Lazy`. which does
not work with `@Autowired(required=false)`, the application context
is injected and the MBeanExporter is retrieved manually when it is
needed.

Closes gh-4980
9 years ago
Andy Wilkinson d05f94170b Merge pull request #5190 from Gary Russell
* gh-5190:
  Upgrade to Spring Integration 4.2.5.RELEASE
9 years ago
Gary Russell 5e180641ec Upgrade to Spring Integration 4.2.5.RELEASE
Closes gh-5190
9 years ago
Andy Wilkinson 1c00fdd80c Upgrade to Undertow 1.3.18.Final
Closes gh-5182
9 years ago
Andy Wilkinson 5d256196a6 Upgrade to Groovy 2.4.6
Closes gh-4149
9 years ago
Stephane Nicoll 094f7aa20e Fix Hazelcast Cache auto-configuration ordering
Spring Boot supports the automatic configuration of an additional
HazelcastInstance if one already exists and an explicit property has been
set to use a different configuration for caching. So three cases are
supported really: no `HazelcastInstance` exists so we need to create one
anyway or an `HazelcastInstance` already exists; in that latter case, we
should either reuse it or create a new one.

Unfortunately, the conditions that checked those three use cases were
not ordered consistently and we could easily get in a situation where
both conditions were evaluated.

This commit makes sure that we  first check if an `HazelcastInstance`
exists and then (and only then) we create the missing `HazelcastInstance`
used for caching. The tests have also been improved to validate the
proper `HazelcastInstance` is used for caching.

Closes gh-5181
9 years ago
Dave Syer 14a5feacea Update to OAuth 2.0.9 9 years ago
Phillip Webb a9afe0a944 Formatting 9 years ago
Andy Wilkinson d3074a086c Increase timeout for startup of embedded Cassandra
The integration tests for the Spring Data Cassandra sample application
fail intermittently, apparently due to Cassandra failing to start
within the default timeout period of 10000ms.

In attempt to get the tests to pass reliably, this commit increases
the timeout to 60000ms (1 minute).
9 years ago
Stephane Nicoll 62bc2abac0 Better document JTA properties
Closes gh-5143
9 years ago
Andy Wilkinson fbbead622d Add dependency management for some more of Jetty's modules
Closes gh-5155
9 years ago
Andy Wilkinson d69e0486c1 Allow Thymeleaf's LayoutDialect to be overridden
Closes gh-5151
9 years ago
Stephane Nicoll b726974bca Allow to easily customize ListenerContainerFactory
Previously, if one wants to create a custom `JmsListenerContainerFactory`
or `RabbitListenerContainerFactory`, a bunch of code from the auto-
configuration must be duplicated.

This commit introduces two services to configure such factory for JMS
and AMQP with the same sensible defaults that were applied by the
auto-configufrations.

Closes gh-5138
9 years ago
Andy Wilkinson 1c170b35ea Improve handling of connection failures in remote debug tunnel
Previously, if an application had been started without remote
debugging enabled, an attempt to connect to it via
RemoteSpringApplication and the HTTP tunnel would result in the
application being hammered by connection attempts for 30 seconds.

This commit updates the tunnel server to respond with Service
Unavailable (503) when a connection attempt is made and the JVM
does not have remote debugging enabled. When the client receives a
503 response, it now logs a warning message describing the possible
problem before closing the connection.

The client has also been updated to provide improved diagnostics when
a connection to the tunnel server cannot be established, for example
because the remote URL is incorrect, or the remote application isn't
running.

Lastly, the client has been updated so that it continues to accept
connections when a connection to the server is closed. This allows
the user to correct a problem with the remote application, such as
restarting it with remote debugging enabled, without having to also
restart the process that's running RemoteSpringApplication.

Closes gh-5021
9 years ago
Andy Wilkinson 607dba97f8 Only access parameters in WebRequestTraceFilter when they are included
Previously, WebRequestTraceFilter would call request.getParameterMap()
before deciding whether or not the parameters should be included in
the trace. For a POST request, this had the unwanted side-effect
of always reading the request body.

This commit updates WebRequestTraceFilter so that it checks that
parameters are to be included in the trace before calling
request.getParameterMap()

Closes gh-5089
9 years ago
Andy Wilkinson 815da8b845 Upgrade to Tomcat 8.0.32
Closes gh-5122
9 years ago
Andy Wilkinson ac5c6f725c Correct the scope of the postgresql dependency in spring-boot-devtools 9 years ago
Andy Wilkinson 295dc65b78 Fix LoggingSystem tests following System property changes 9 years ago
Andy Wilkinson 7787321db4 Polishing 9 years ago
Andy Wilkinson ddfadce94d Set all documented system properties in LoggingApplicationListener
Closes gh-5073
9 years ago
Stephane Nicoll 4cbbd48f18 Polish documentation
Closes gh-5131
9 years ago
Andy Wilkinson 31aa5ad8dd Remove redundant public modifier 9 years ago
Andy Wilkinson a8f4708ffb Shut down in-memory database when DevTools restarts the context
Previously an in-memory database that wasn’t pooled (an
EmbeddedDatabase) would be shutdown when the context restarted, but
an in-memory database wrapped in a connection pool was not. This meant
that the former would be be wiped clean after each restart, whereas the
latter would not. In addition to being inconsistent, this also
caused problems with schema.sql and data.sql scripts when using
DevTools. If you were using an in-memory database wrapped in a
connection pool, a failure may occur during a restart as the scripts
were not being run against in clean database.

This commit adds an auto-configured bean to DevTools that, when the
context is being closed, will execute “SHUTDOWN” if it identifies that
the DataSource is not an EmbeddedDatabase and is for an in-memory
database.

Closes gh-4699
9 years ago
Stephane Nicoll abf9d66edf Document how to configure access logging
Also, the section on `server.*` configuration was poor so this commit
also improves it.

Closes gh-4989
9 years ago
Andy Wilkinson fc2e51a773 Preserve ordering when auto-configuring WebSocket MessageConverters
Previously, WebSocketMessagingAutoConfiguration added a single
additional converter. This was a MappingJackson2MessageConverter
configured with the auto-configured ObjectMapper.
AbstractMessageBrokerConfiguration places additional converters before
any of the default converters. This meant that the auto-configuration
had the unwanted side-effect of changing the ordering of the
converters. A MappingJackson2MessageConverter was now first in the
list, whereas, by default, it's last in the list after a
StringMessageConverter and a ByteArrayMessageConverter.

This commit updates WebSocketMessagingAutoConfiguration so that it
switches off the registration of the default converters and registers
a StringMessageConverter, ByteArrayMessageConverter and
MappingJackson2MessageConverter in that order. A test has been
added to verify that the types of these three converters match
the types of the default converters. A second test that verifies
that String responses are converted correctly has also been added
alongside the existing test that verified the behaviour for JSON
responses.

Closes gh-5123
9 years ago
Stephane Nicoll c10943c653 Polish Javadoc
Closes gh-4936
9 years ago
Stephane Nicoll 594c8910c5 Clarify precedence of property sources
When the `locations` attribute is set for a given bean annotated with
`@ConfigurationProperties`, the configuration at these specified
locations take precedence over any other property sources. This means
that such values can't be overridden by a system property or a command
line switch for instance.

This commit clarifies this rules in the documentation.

Closes gh-5111
9 years ago
Stephane Nicoll 2a8a3741f5 Merge DriverClassNameProvider in DatabaseDriver
DriverClassNameProvider is unused but was probably restored by a merge
commit at some point. It wasn't obvious and updated that class rather
than `DatabaseDriver`.

This commit updates `DatabaseDriver` and deletes
`DriverClassNameProvider`.

Closes gh-5076
9 years ago
Andy Wilkinson ec8f7d3a0f Upgrade to SLF4J 1.7.15
Closes gh-5044
9 years ago
Andy Wilkinson aab678f499 Upgrade to Undertow 1.3.17.Final
Closes gh-5108
9 years ago
Stephane Nicoll 6710c05750 Document `DeprecatedConfigurationProperty`
Closes gh-5118
9 years ago
Andy Wilkinson a1fefb15ba Merge pull request #5059 from Vedran Pavić
* gh-5059:
  Remove Docker container after launch script test execution
9 years ago
Vedran Pavic 6540b1f383 Remove Docker container after launch script test execution
Closes gh-5059
9 years ago
Andy Wilkinson 29c7b93640 Update SpringApplicationBuilder to pass args to parent when it's run
Closes gh-5103
9 years ago
Andy Wilkinson c0a2c88da1 Stop referring to optional classes in BeanDefinitionLoader’s signature
Previously, BeanDefinitionLoader declared a field of type
GroovyBeanDefinitionReader which is a GroovyObject subclass. This is
problematic as BeanDefinitionLoader is always loaded but Groovy is an
optional dependency. Even on a JVM where class verification is performed
lazily, this can still cause problems if something reflectively tries
to access the class’s declared fields. On a JVM where classes are
verified at load time, it would be impossible to start a Spring Boot
application without having Groovy on the classpath.

This commit changes the field to be a BeanDefinitionReader, removing
the indirect reference to GroovyObject form BeanDefinitionLoader’s
signature. The reader is downcast to a GroovyBeanDefinitionReader in the
body of a method body that will only be invoked when Groovy is on the
classpath.

Closes gh-5040
9 years ago
Phillip Webb 43a5b77256 Ensure logback is reset after test
Update SpringBootJoranConfiguratorTests to ensure that logback
is left in a sane state. Prior to this commit, running all tests
in eclipse would fail due to ErrorPageFilterTests expecting
specific log output.
9 years ago
Karol Rynio 19afae7fe6 Fix typos
Closes gh-5025
9 years ago
Stephane Nicoll 6ea74501e7 Clarify registration of ApplicationListener
Spring Boot fires event very early in the application lifecycle and we
should make crystal clear that a regular `@Bean` registration cannot be
used to register a listener on them.

Closes gh-5061
9 years ago
Stephane Nicoll 74bff1f275 Merge remote-tracking branch 'origin/1.3.x' into 1.3.x 9 years ago
Andy Wilkinson ee409482b3 Enable the use of formatter off and on tags in Eclipse
This commit enables the use of // @formatter:off and // @formatter:on
to surround lines of code that should not be formatted. It also adds
a code template that can be used to quickly wrap the selected lines
of text with the off and on comments.

Closes gh-5050
9 years ago
Vedran Pavic 93de0d7dc0 Improve systemd service documentation
Closes gh-5041
9 years ago
Stephane Nicoll 135ebb8ded Merge pull request #5013 from izeye/polish-20160123
* pr/5013:
  Polish
9 years ago
Johnny Lim 9a31e02806 Polish
Closes gh-5013
9 years ago
Andy Wilkinson 4c1bb38878 Fix broken locking in Restarter.initialize
Closes gh-4955
9 years ago
Phillip Webb c77a7e0cba Fixup version numbers following release 9 years ago
Spring Buildmaster 504d3e97ba Next development version 9 years ago
Phillip Webb 6d19d737a4 Downgrade to Spring Web Services 2.2.3
Since 2.2.5 hasn't yet been released we'll need to rollback for our
release.

See gh-4789
9 years ago
Phillip Webb ebabc63bbb Refine ContextId NAME_PATTERN
Update the ContextIdApplicationContextInitializer default NAME_PATTERN
to favor the developer defined `${spring.application.name}` value over
the deployer defined `${vcap.application.name}`.

Fixes gh-4926
9 years ago
Phillip Webb fd3e5cf304 Defer disable persistence logic to a listener
Update TomcatEmbeddedServletContainerFactory so that logic to disable
persistent sessions happens after Tomcat's standard Manager creation
logic.

Fixes gh-4543
9 years ago