The layout (the directory structure) of executable jars has changed. If you are using Spring Boot’s Maven, Gradle, or Ant support to build your application this change will not affect you. If you are building an executable archive yourself, please be aware that an application’s dependencies are now packaged in BOOT-INF/lib rather than lib , and an application’s own classes are now packaged in BOOT-INF/classes rather than the root of the jar.
Classes, methods and properties that were deprecated in Spring Boot 1.3 have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading.
In particular, log4j 1 support has been removed following Apache EOL announcement.
Prior to Spring Boot 1.4, auto-configured datasources were bound to the spring.datasource namespace . In 1.4, we only bind the common settings to spring.datasource (see DataSourceProperties ) and we have defined new specific namespaces for the four connections pools we support (in that order):
spring.datasource.tomcat for org.apache.tomcat.jdbc.pool.DataSource
spring.datasource.hikari for com.zaxxer.hikari.HikariDataSource
spring.datasource.dbcp for org.apache.commons.dbcp.BasicDataSource
spring.datasource.dbcp2 for org.apache.commons.dbcp2.BasicDataSource
If you were using specific settings of the connection pool implementation that you are using, you will have to move that configuration to the relevant namespace. For instance, if you were using Tomcat’s testOnBorrow flag, you’ll have to move it from spring.datasource.test-on-borrow to spring.datasource.tomcat.test-on-borrow .
If you are using configuration assistance in your IDE, you can now see which settings are available per connection pools rather than having all of them mixed in the spring.datasource namespace. This should make your life much easier figuring out what implementation supports what features.
Similarly to DataSource binding, JTA provider-specific configuration properties for Atomikos and Bitronix were bound to spring.jta . They are now bound to spring.jta.atomikos.propertiesand spring.jta.bitronix.propertiesrespectively; the meta-data for these entries has been greatly improved as well.
When a @ConfigurationProperties bean is registered via @EnableConfigurationProperties(SomeBean.class) , we used to generate a bean name of the form <prefix>.CONFIGURATION_PROPERTIES . As of Spring Boot 1.4, we have changed that pattern to avoid name clashes if two beans use the same prefix.
The new conventional name is <prefix>-<fqn> , where <prefix> is the environment key prefix specified in the @ConfigurationProperties annotation and <fqn> the fully qualified name of the bean. If the annotation does not provide any prefix, only the fully qualified name of the bean is used.
The spring-boot-starter-jetty “Starter POM” no longer includes org.eclipse.jetty:jetty-jndi. If you are using Jetty with JNDI you will now need to directly add this dependency yourself.
Spring Boot will now perform analysis of common startup failures and provide useful diagnostic information rather than simply logging an exception and its stack trace. For example, a startup failure due to the embedded servlet container’s port being in use looked like this in earlier versions of Spring Boot:
ERROR 24753 --- [ main] o.s.boot.SpringApplication : Application startup failed
java.lang.RuntimeException: java.net.BindException: Address already in use
at io.undertow.Undertow.start(Undertow.java:181) ∼[undertow-core-1.3.14.Final.jar:1.3.14.Final]
at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainer.start(UndertowEmbeddedServletContainer.java:121) ∼[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293) ∼[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141) ∼[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ∼[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ∼[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at sample.undertow.SampleUndertowApplication.main(SampleUndertowApplication.java:26) [classes/:na]
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method) ∼[na:1.8.0_60]
at sun.nio.ch.Net.bind(Net.java:433) ∼[na:1.8.0_60]
at sun.nio.ch.Net.bind(Net.java:425) ∼[na:1.8.0_60]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ∼[na:1.8.0_60]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ∼[na:1.8.0_60]
at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:190) ∼[xnio-nio-3.3.4.Final.jar:3.3.4.Final]
at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243) ∼[xnio-api-3.3.4.Final.jar:3.3.4.Final]
at io.undertow.Undertow.start(Undertow.java:137) ∼[undertow-core-1.3.14.Final.jar:1.3.14.Final]
... 11 common frames omitted
In 1.4, it will look like this:
ERROR 24745 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Embedded servlet container failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
if you still want to see the stacktrace of the underlying cause, enable debug logging for org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter .
spring-boot-starter-testnow brings the Assert4J assertions library. Test utilities from the org.springframework.boot.test package have been moved to a spring-boot-test dedicated artifact.
You can get all the new changes at this address : https://github.com/spring-projects/spring-boot/wiki , look for the Release Notes and the section New and Noteworthy.
Abstract Syntax Tree (AST)
/actuator endpoint
Advance Message Queuing Protocol (AMQP)
bindings
default exchange
direct exchange
fanout exchange
headers exchange
queues
topic exchange
Amazon
ApplicationRunner interface
Authenticated() method
/autoconfig endpoint
Auto-configuration
ActiveMQAutoConfiguration class
DataSourceAutoConfiguration
DemoApplication.java—Spring Boot snippet
@EnableAutoConfiguration annotation
@Grab(spring-boot-web-starter) annotation
jackson-core library
@RequestMapping
@RestController
Spring Boot application
Spring Boot modules
API_PATH, BANNER
@Bean SimpleUrlHandlerMapping urlHandler()
@ConditionalOnClass(JournalRepository.class), 344
@ConditionalOnWebApplication
@Configuration
configureRepositoryRestConfiguration(RepositoryRestConfiguration config)
EnableAutoConfiguration class
health indicator
JournalAutoConfiguration class
journal-spring-boot-autoconfigure
journal-spring-boot-starter
RepositoryRestMvcConfiguration
spring-boot-journal
web application
Backing services
cURL command
Journal app home page
MySQL
PCFDev
/beans endpoint
class SimpleWebTest
Cloud computing
microservices
twelve-factor application guide
admin processes
backing services
Codebase
concurrency
configuration
dependencies
disposability
environment parity
logs
port binding
processes
Cloud Foundry
Application Execution (DEA)
authentication
blob store
CLI
cloud controller
HM9000
logging and statistics
message bus
PaaS
Pivotal Cloud Foundry
router
service brokers
Cloud-native architecture
Cloud Profile
application-cloud.properties
new entry to journal app
Command line interface (CLI)
UNIX cURL command
grab command
help command
init command
install command
jar command
run command
shell command
test command
uninstall command
war command
WebApp.java
CommandLineRunner interface
/configprops endpoint
Continuous integration, continuous delivery (CI/CD)
Cross-origin resource sharing (CORS)
Data access
JDBC template
H2 web console
Journal.java class
spring-boot-starter-jdbc
SQL statements
JournalService.java class
findAll
insertData
JdbcTemplate
Logger
using JPA, Spring Boot. Java Persistence API (JPA)
SimpleJdbcAppApplication.java class
Demo.zip structure
Docker
ADD
application-docker.properties
Docker property prefix
ENTRYPOINT
ENV
EXPOSE
FROM java
Maven Docker plugin
VOLUME
/docs endpoint
/dump endpoint
EnableAutoConfiguration annotation
@Enable<Technology> annotations
EndpointHandlerMapping
/env endpoint
Executable and Deployable WARs
activating profiles
build.gradle
Gradle version
JBoss
Pivotal tc Server
SpringBootServletInitializer
target/spring-boot-journal-0.0.1-SNAPSHOT.war file
Tomcat
Tomcat-based server
Tomcat dependencies
WEB-INF/lib
Executable JARs
Java application
MANIFEST.MF file
public static void main method
@FixMethodOrder(MethodSorters.NAME_ASCENDING) annotation
Groovy Domain Specific Language
groupId=com.apress.spring
/health endpoint
HTTP GET methods
HTTP POST
HttpSecurity method
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration
/info endpoint
InternalResourceViewResoulver class
J2EE Web applications
Java Message Service (JMS)
application.properties
Consumer.java class
definition
MessagingConfig.java class
pom.xml file
Producer.java class
simpler consumer
application.properties
creation
remote connection
SpringBootJmsV2Application app
SpringBootJmsApplication class
Java persistence API (JPA)
CommandLineRunner interface
findAll
insertData
Journal.java class
JournalRepository interface
JournalRepository.java
JpaRepository interface
@Service
SimpleJpaAppApplication.java class
@SpringBootApplication
spring-boot-starter-data-jpa
spring-data technology
Spring Initializr
JavaServer Pages (JSP)
journal.api-path
Journal app directory structure
JournalAutoConfiguration
journal.banner
Journal Project, package and installation
Journal-spring-boot-autoconfigure Project
Journal-spring-boot-starter project
/liquibase endpoint
/logfile endpoint
/mappings endpoint
MessageListener interface
Messaging
definition
JMS
RabbitMQ
redis
WebSockets
Microservices
vs. monolithic
Spring Boot Journal App
Model View Controller (MVC)
MongoDB
db.journal.find() query
Journal.java class
MongoRepository
spring-boot-starter-data-mongodb
start method
MyTest.java
NetFlix
NoSQL databases
classification system
MongoDB
onMessage method
org.springframework.boot.Banner interface
org.springframework.boot.Banner interface
PCFDev
Pivotal Cloud Foundry Dev (PCFDev)
deployment
installation
login into
Pivotal Web Services (Cloud Foundry)
ClearDB MySQL Database
deployment
installation
journal app
journal application dashboard
marketplace
mysql service instance
scale app
SMS verification
welcome page
QuotaHealthIndicator class
RabbitMQ
AMQP
Consumer.java class
creation
installation
pom.xml file
Producer.java class
remote connection
SpringBootRabbitmqApplication.java
web console management
web console Queues tab
Redis
Consumer.java class
Installation
pom.xml file
Producer.java class
RedisConfig.java class
remote connection
SpringBootRedisApplication.java
sendTo method
setConverters(HttpMessageConverter).
/shutdown endpoint
SimpleJdbcAppApplication.java class
SimpleServlet class
Simple-web-app structure
Simple-web-spring-boot
Spring actuator module
/actuator endpoint
/autoconfig endpoint
/beans endpoint
/configprops endpoint
CORS
definition
/docs endpoint
/dump endpoint
endpoint ID
/env endpoint
/flyway endpoint
/health endpoint
/info endpoint
/liquibase endpoint
/logfile endpoint
management
/mappings endpoint
/metrics endpoint
non-web application
pom.xml file
sensitive endpoints
SpringBootWebActuatorApplication.java
/trace endpoint
SpringApplicationBuilder class
@SpringApplicationConfiguration(classes = SprintBootApplication.class)
SpringApplication.run(SpringBootSimpleApplication.class, args)
Spring Boot
address
analysis
app.groovy
applications
auto-configuration
@Bean annotation
build.gradle
@Configuration annotation
with Docker
spring init command
$ spring run app.groovy
WAR/JAR executable
as Windows Service
@ConfigurationProperties bean
CLI
UNIX cURL command
grab command
help command
init command
install command
jar command
run command
shell command
test command
uninstall command
war command
WebApp.java
deprecated methods
executable jars
features
application.properties
application.yml
ASCII art
command-line arguments
configuration properties
custom property prefix
data.server property
directory structure
environment variables
location and name
profile based
SPRING_APPLICATION_JSON
src/main/java/com/apress/spring/SpringBootSimpleApplication.java
using Gradle
home page
installation
Linux, OS X, and Solaris
Windows OS
java extension
jetty-jndi
Journal application
add JSON data
application.properties
build.gradle file
commands
directory structure
HTTPS
index.html file
InMemorySecurityConfig class
Journal.java
JournalController.java
JournalRepository.java
pom.xml
reusable code summary
SecurityConfig
@SpringBootApplication
SpringBootJournalApplication.java
Spring Boot journal web application
Spring Starter Project wizard
using STS
web.JournalController.java
using Maven
SimpleWebApp.java
SimpleWebController.java
spring.datasource namespace
Spring Initializr
spring.jta.atomikos.property
spring.jta.bitronix.property
STS web page
test utility
UNIX cURL command
WAR file
web application
spring-boot-calendar Project
spring-boot-journal-oauth directory structure
Spring-boot-journal project
Spring Boot Relaxed Binding
Spring-boot-starter-test
Spring-boot-starter-web dependency
Spring-boot-web
SpringClassRule
Spring Initializr
Spring integration test
add()
findByTitle()
getAll()
Hamcrest
HttpMessageConverter<T>
journal domain class
JsonPath
@RunWith annotation
setup()
spring-boot-starter-test
STS IDE
toJsonString(Object)
SpringMethodRule
Spring MVC applications
Spring security
application.properties
AuthenticationManagerConfiguration class
basic security window
custom login.html page
definition
http://localhost:8080/api, accessing
index html page
InMemorySecurityConfiguration.java class
JournalController.java class
journal-secure project structure
login.html page
MySQL
OAuth2
api endpoint
client ID
index.html page
JournalController.java class
ResourceOAuthSecurityConfiguration.java class
OAuth2 pom.xml
OAuth flow
pom.xml
ResourceSecurityConfiguration class
ResourceSecurityConfiguration.java class
JdbcSecurityConfiguration.java class
src/main/resources/data.sql
src/main/resources/schema.sql
Spring Technologies in Spring Boot
Spring Tool Suite (STS)
SQL databases
SSL self-signed keystore file
Certificate Authority
Google Chrome’s version
keytool command
/login endpoint
Standalone spring apps vs. Spring Boot apps
String method
@Test
Thymeleaf technology
Tomcat-based server
/trace endpoint
WebSecurityConfigurerAdapter class
WebSockets
definition
index.html web page
pom.xml file
Producer.java class
REST endpoint
SockJS and Stomp messages
WebSocketConfig class
Web testing
XML with Spring Boot
3.129.218.45