Commit Graph

1343 Commits (1.3.x)

Author SHA1 Message Date
Spring Operator e401d02ced Use HTTPS for external links wherever possible
See gh-16316
6 years ago
Spring Operator adc2462689 Use HTTPS for external links from XML files where possible
See gh-16311
6 years ago
Andy Wilkinson 0e009ef047 Use HTTPS to link to the Apache license 6 years ago
Spring Operator 7c314122f7 Update build and setup configuration to use HTTPS
See gh-16243
6 years ago
Spring Buildmaster 5f959b074f Next Development Version 8 years ago
Andy Wilkinson b8833c40b6 Allow spring.config.location to be configured via servlet context
Previously, in a war deployment, the web environment’s property sources
were initialized using the servlet context after the application’s
configuration had been read by ConfigFileApplicationListener. This
meant that spring.config.location configured via the servlet context
had no effect.

This commit adds a new ApplicationListener,
ServletContextApplicationListener, that initialises the configurable
web environment’s property sources using the servlet context. It’s
ordered with higher precedence than ConfigFileApplicationListener to
ensure that any properties defined in the servlet context are available
when loading the application’s configuration.

Closes gh-6801
8 years ago
Andy Wilkinson 56cf49665f Add some tests for ServletContextApplicationContextInitializer 8 years ago
Andy Wilkinson ba51dc5c4a Make configuration of Liquibase’s logging more robust
We make Liquibase aware of our custom Commons Logging-based logger by
adding its package to the Liquibase ServiceLocator’s packages to scan.
Previously, this was happening too late so Liquibase may have already
initialized and cached a particular logger.

This commit moves the registration of the extra package from the
Liquibase auto-configuration to the application listener that customises
Liquibase’s ServiceLocator. This ensures that the package is added
before Liquibase is used. Unfortunately, configuring Liquibase’s
ServiceLocator and its packages to scan causes it to try to perform
some logging, resulting in it caching the wrong type of logger. We
work around this problem by resetting Liquibase’s LogFactory once we’ve
finished setting everything up.

Closes gh-6713
8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Phillip Webb 8e22f47916 Don't limit collection sizes in property binding
Update PropertiesConfigurationFactory so that collections can grow
beyond 256 items. Prior to this commit configuration property binding
used the default `DataBinder.autoGrowNestedPaths` setting of 256.

Fixes gh-6436
8 years ago
Phillip Webb 49676ee986 Polish 8 years ago
Phillip Webb 2cb38bc8e2 Apply Log4J2LoggingSystem.FILTER to main config
Update Log4J2LoggingSystem so that the FILTER is applied to the main
configuration and not to the root logger. Prior to this commit calls
to `logger.isErrorEnabled()` would not consider the filter and hence
would always return `true`. This caused `SpringApplication` to silently
swallow exceptions.

Fixes gh-5271
8 years ago
Phillip Webb 3b0b65cafc Fix deprecation warning 8 years ago
Phillip Webb fd6c0029dc Formatting 8 years ago
Dave Syer af426d0856 Be more defensive about a null password in Undertow SSL
Fixes gh-6387
8 years ago
Andy Wilkinson c2db9fa385 Update admin MBean to only be ready when its own context is ready
Previously, if there was a hierarchy of SpringApplications, the admin
MBean would report that the application was ready as soon as any
application in the hierarchy was ready. This could lead to a client
trying to query a property in the environment before it's available.

This commit updates the MBean registrar to that the MBean only reports
that the application is ready when the context that contains the
registrar has refreshed and fired its ApplicationReadyEvent.

Closes gh-6362
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Andy Wilkinson 02e989c863 Check that URL is actually a file URL before getting a File from it
Previously, Log4J2LoggingSystem used ResourceUtils.isFileURL(URL) to
check that the URL of the configuration was suitable for accessing as a
File. Unfortunately, this fails when the URL’s protocol is vfs or
vfsfile as both return true and then fail when the URL is subsequently
passed into ResourceUtils.getFile(URL).

This commit switches to checking that the URL’s protocol is file,
the only protocol that will allow getFile(URL) to succeed.

Closes gh-6246
9 years ago
Stephane Nicoll 17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
9 years ago
Phillip Webb 5b97981c87 Polish 9 years ago
Andy Wilkinson 9d194c2d43 Add test to verify binding of a property with all upper-case suffix
See gh-5330
9 years ago
Stephane Nicoll 6574feea87 Document limitations of logging.pattern.*
Closes gh-5653
9 years ago
Andy Wilkinson 76cd45e76e Fix checkstyle violation: remove unused import 9 years ago
Andy Wilkinson 5c43a5b7dd Honour custom bean name generator for non-web applications
Closes gh-6160
9 years ago
Phillip Webb 452281ca8d Fix property detection in SpringApplicationBuilder
Update SpringApplicationBuilder so that properties of the form
`abc=d:e:f` are correctly parsed. Prior to this commit the `:` delimiter
would always be chosen over `=`, even if `=` occurred first.

Fixes gh-6121
9 years ago
Phillip Webb a9b98cada5 Allow loading from package names without dots
Update BeanDefinitionLoader to support loading from package names that
do not contain dots.

Prior to this commit `new BeanDefinitionLoader(registry, "somepackage")`
would fail because "somepackage" exists and is a resource but does not
contain valid XML. Somewhat surprisingly the InputStream returned by
the resource actually contains the listing of files in the package.

Fixes gh-6126
9 years ago
Ivan Sopov 1528764194 Fix potential offset errors in BasicJsonParser
Update BasicJsonParser to fix potential exceptions if strings happen
to be empty.

Fixes gh-6136
9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Stephane Nicoll daf0b081e7 Revert "Add support for UTF-8 in application.properties"
This reverts commit d6a424f94c.

Closes gh-5361

# Conflicts:
#	spring-boot/src/test/resources/org/springframework/boot/env/test-encoded.properties
9 years ago
Andy Wilkinson 7709543e67 Set web application context on ServletContext in plain web app tests
Previously, the web application context was only set on the
ServletContext in a full-blown integration test or when MockMvc was
used.

This commit updates SpringApplicationContextLoader so that the context
is also set on the context in a plain web application test (one where
MockMvc is not being used). The change is a partial backport of commit
7dffb702.

Closes gh-4370
9 years ago
Phillip Webb b1656be3d0 Fix possible binder IndexOutOfBoundsException
Update RelaxedDataBinder.extendCollectionIfNecessary to use the current
index when checking if the path node is an array.

Fixes gh-5635
9 years ago
Phillip Webb 02764b8ff3 Support Jetty error page handling of PUT requests
Update JettyEmbeddedServletContainerFactory so that requests other than
just GET, POST and HEAD are handled by the ErrorHandler.

Fixes gh-5367
9 years ago
Phillip Webb 084b288947 Polish 9 years ago
Kazuki Shimizu b4b7e7ead3 Upgrade to Logback 1.1.6
Closes gh-5410
9 years ago
Phillip Webb 0a7a283f45 Apply logging system properties on reinitialize
Restore Spring Boot 1.3.2 behavior of re-applying system properties
when SLF4J based loggers are re-initialized. Reapplying system
properties is required when using the Spring Cloud config server since
PropertySourceBootstrapConfiguration directly calls the system
initialize method.

Fixes gh-5491
9 years ago
Andy Wilkinson 4eda91d6db Allow logging.file and logging.path to refer to logging system properties
Closes gh-5274
9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
Andy Wilkinson 6075682e64 Polishing
- Code formatting
 - Javadoc warnings
 - Deprecation warnings
9 years ago
Andy Wilkinson 1c715ab282 Upgrade to Jetty 9.2.15.v20160210
Upgrade to Jetty 9.2.15 and replace use of API that was deprecated
and changed to throw an UnsupportedOperationException in the same
release.

Closes gh-5218
9 years ago
Andy Wilkinson 1735fac3ab Upgrade to Logback 1.1.5
Closes gh-5212
9 years ago
Phillip Webb a9afe0a944 Formatting 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 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
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
Johnny Lim 9a31e02806 Polish
Closes gh-5013
9 years ago