Appendix Spring Boot 1.4.x

Spring Boot 1.4.X Release Notes

Upgrading from Spring Boot 1.3

Executable Jar Layout

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.

Deprecations from Spring Boot 1.3

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.

DataSource Binding

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.

Jta Settings Binding

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.

@ConfigurationProperties Default Bean Names

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.

Jetty JNDI Support

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.

Analysis of Startup Failures

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 .

Test Utilities

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.

New and Noteworthy

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.

Index

A

  1. Abstract Syntax Tree (AST)

  2. /actuator endpoint

  3. Advance Message Queuing Protocol (AMQP)

    1. bindings

    2. default exchange

    3. direct exchange

    4. fanout exchange

    5. headers exchange

    6. queues

    7. topic exchange

  4. Amazon

  5. ApplicationRunner interface

  6. Authenticated() method

  7. /autoconfig endpoint

  8. Auto-configuration

    1. ActiveMQAutoConfiguration class

    2. DataSourceAutoConfiguration

    3. DemoApplication.java—Spring Boot snippet

    4. @EnableAutoConfiguration annotation

    5. @Grab(spring-boot-web-starter) annotation

    6. jackson-core library

    7. @RequestMapping

    8. @RestController

    9. Spring Boot application

    10. Spring Boot modules

      1. API_PATH, BANNER

      2. @Bean SimpleUrlHandlerMapping urlHandler()

      3. @ConditionalOnClass(JournalRepository.class), 344

      4. @ConditionalOnWebApplication

      5. @Configuration

      6. configureRepositoryRestConfiguration(RepositoryRestConfiguration config)

      7. EnableAutoConfiguration class

      8. health indicator

      9. JournalAutoConfiguration class

      10. journal-spring-boot-autoconfigure

      11. journal-spring-boot-starter

      12. RepositoryRestMvcConfiguration

    11. spring-boot-journal

    12. web application

B

  1. Backing services

    1. cURL command

    2. Journal app home page

    3. MySQL

    4. PCFDev

  2. /beans endpoint

C

  1. class SimpleWebTest

  2. Cloud computing

    1. microservices

    2. twelve-factor application guide

      1. admin processes

      2. backing services

      3. Codebase

      4. concurrency

      5. configuration

      6. dependencies

      7. disposability

      8. environment parity

      9. logs

      10. port binding

      11. processes

  3. Cloud Foundry

    1. Application Execution (DEA)

    2. authentication

    3. blob store

    4. CLI

    5. cloud controller

    6. HM9000

    7. logging and statistics

    8. message bus

    9. PaaS

    10. Pivotal Cloud Foundry

    11. router

    12. service brokers

  4. Cloud-native architecture

  5. Cloud Profile

    1. application-cloud.properties

    2. new entry to journal app

  6. Command line interface (CLI)

    1. UNIX cURL command

    2. grab command

    3. help command

    4. init command

    5. install command

    6. jar command

    7. run command

    8. shell command

    9. test command

    10. uninstall command

    11. war command

    12. WebApp.java

  7. CommandLineRunner interface

  8. /configprops endpoint

  9. Continuous integration, continuous delivery (CI/CD)

  10. Cross-origin resource sharing (CORS)

D

  1. Data access

    1. JDBC template

      1. H2 web console

      2. Journal.java class

      3. spring-boot-starter-jdbc

      4. SQL statements

    2. JournalService.java class

      1. findAll

      2. insertData

      3. JdbcTemplate

      4. Logger

    3. using JPA, Spring Boot. Java Persistence API (JPA)

    4. SimpleJdbcAppApplication.java class

  2. Demo.zip structure

  3. Docker

    1. ADD

    2. application-docker.properties

    3. Docker property prefix

    4. ENTRYPOINT

    5. ENV

    6. EXPOSE

    7. FROM java

    8. Maven Docker plugin

    9. VOLUME

  4. /docs endpoint

  5. /dump endpoint

E

  1. EnableAutoConfiguration annotation

  2. @Enable<Technology> annotations

  3. EndpointHandlerMapping

  4. /env endpoint

  5. Executable and Deployable WARs

    1. activating profiles

    2. build.gradle

    3. Gradle version

    4. JBoss

    5. Pivotal tc Server

    6. SpringBootServletInitializer

    7. target/spring-boot-journal-0.0.1-SNAPSHOT.war file

    8. Tomcat

    9. Tomcat-based server

    10. Tomcat dependencies

    11. WEB-INF/lib

  6. Executable JARs

    1. Java application

    2. MANIFEST.MF file

    3. public static void main method

F

  1. @FixMethodOrder(MethodSorters.NAME_ASCENDING) annotation

G

  1. Groovy Domain Specific Language

  2. groupId=com.apress.spring

H

  1. /health endpoint

  2. HTTP GET methods

  3. HTTP POST

  4. HttpSecurity method

I

  1. import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration

  2. /info endpoint

  3. InternalResourceViewResoulver class

J, K

  1. J2EE Web applications

  2. Java Message Service (JMS)

    1. application.properties

    2. Consumer.java class

    3. definition

    4. MessagingConfig.java class

    5. pom.xml file

    6. Producer.java class

    7. simpler consumer

      1. application.properties

      2. creation

      3. remote connection

      4. SpringBootJmsV2Application app

    8. SpringBootJmsApplication class

  3. Java persistence API (JPA)

    1. CommandLineRunner interface

    2. findAll

    3. insertData

    4. Journal.java class

    5. JournalRepository interface

    6. JournalRepository.java

    7. JpaRepository interface

    8. @Service

    9. SimpleJpaAppApplication.java class

    10. @SpringBootApplication

    11. spring-boot-starter-data-jpa

    12. spring-data technology

    13. Spring Initializr

  4. JavaServer Pages (JSP)

  5. journal.api-path

  6. Journal app directory structure

  7. JournalAutoConfiguration

  8. journal.banner

  9. Journal Project, package and installation

  10. Journal-spring-boot-autoconfigure Project

  11. Journal-spring-boot-starter project

L

  1. /liquibase endpoint

  2. /logfile endpoint

M

  1. /mappings endpoint

  2. MessageListener interface

  3. Messaging

    1. definition

    2. JMS

SeeJava Message Service (JMS)
  1. RabbitMQ

SeeRabbitMQ
  1. redis

SeeRedis
  1. WebSockets

SeeWebSockets
  1. Microservices

    1. vs. monolithic

    2. Spring Boot Journal App

  2. Model View Controller (MVC)

  3. MongoDB

    1. db.journal.find() query

    2. Journal.java class

    3. MongoRepository

    4. spring-boot-starter-data-mongodb

    5. start method

  4. MyTest.java

N

  1. NetFlix

  2. NoSQL databases

    1. classification system

    2. MongoDB

O

  1. onMessage method

  2. org.springframework.boot.Banner interface

  3. org.springframework.boot.Banner interface

P

  1. PCFDev

SeePivotal Cloud Foundry Dev (PCFDev)
  1. Pivotal Cloud Foundry Dev (PCFDev)

    1. deployment

    2. installation

    3. login into

  2. Pivotal Web Services (Cloud Foundry)

    1. ClearDB MySQL Database

    2. deployment

    3. installation

    4. journal app

    5. journal application dashboard

    6. marketplace

    7. mysql service instance

    8. scale app

    9. SMS verification

    10. welcome page

Q

  1. QuotaHealthIndicator class

R

  1. RabbitMQ

    1. AMQP

    2. Consumer.java class

    3. creation

    4. installation

    5. pom.xml file

    6. Producer.java class

    7. remote connection

    8. SpringBootRabbitmqApplication.java

    9. web console management

    10. web console Queues tab

  2. Redis

    1. Consumer.java class

    2. Installation

    3. pom.xml file

    4. Producer.java class

    5. RedisConfig.java class

    6. remote connection

    7. SpringBootRedisApplication.java

S

  1. sendTo method

  2. setConverters(HttpMessageConverter).

  3. /shutdown endpoint

  4. SimpleJdbcAppApplication.java class

  5. SimpleServlet class

  6. Simple-web-app structure

  7. Simple-web-spring-boot

  8. Spring actuator module

    1. /actuator endpoint

    2. /autoconfig endpoint

    3. /beans endpoint

    4. /configprops endpoint

    5. CORS

    6. definition

    7. /docs endpoint

    8. /dump endpoint

    9. endpoint ID

    10. /env endpoint

    11. /flyway endpoint

    12. /health endpoint

    13. /info endpoint

    14. /liquibase endpoint

    15. /logfile endpoint

    16. management

    17. /mappings endpoint

    18. /metrics endpoint

    19. non-web application

    20. pom.xml file

    21. sensitive endpoints

    22. SpringBootWebActuatorApplication.java

    23. /trace endpoint

  9. SpringApplicationBuilder class

  10. @SpringApplicationConfiguration(classes = SprintBootApplication.class)

  11. SpringApplication.run(SpringBootSimpleApplication.class, args)

  12. Spring Boot

    1. address

    2. analysis

    3. app.groovy

    4. applications

      1. auto-configuration

      2. @Bean annotation

      3. build.gradle

      4. @Configuration annotation

      5. with Docker

      6. spring init command

      7. $ spring run app.groovy

      8. WAR/JAR executable

      9. as Windows Service

    5. @ConfigurationProperties bean

    6. CLI

      1. UNIX cURL command

      2. grab command

      3. help command

      4. init command

      5. install command

      6. jar command

      7. run command

      8. shell command

      9. test command

      10. uninstall command

      11. war command

      12. WebApp.java

    7. deprecated methods

    8. executable jars

    9. features

      1. application.properties

      2. application.yml

      3. ASCII art

      4. command-line arguments

      5. configuration properties

      6. custom property prefix

      7. data.server property

      8. directory structure

      9. environment variables

      10. location and name

      11. profile based

      12. SPRING_APPLICATION_JSON

      13. src/main/java/com/apress/spring/SpringBootSimpleApplication.java

    10. using Gradle

    11. home page

    12. installation

      1. Linux, OS X, and Solaris

      2. Windows OS

    13. java extension

    14. jetty-jndi

    15. Journal application

      1. add JSON data

      2. application.properties

      3. build.gradle file

      4. commands

      5. directory structure

      6. HTTPS

      7. index.html file

      8. InMemorySecurityConfig class

      9. Journal.java

      10. JournalController.java

      11. JournalRepository.java

      12. pom.xml

      13. reusable code summary

      14. SecurityConfig

      15. @SpringBootApplication

      16. SpringBootJournalApplication.java

      17. Spring Boot journal web application

      18. Spring Starter Project wizard

      19. using STS

      20. web.JournalController.java

    16. using Maven

    17. SimpleWebApp.java

    18. SimpleWebController.java

    19. spring.datasource namespace

    20. Spring Initializr

    21. spring.jta.atomikos.property

    22. spring.jta.bitronix.property

    23. STS web page

    24. test utility

    25. UNIX cURL command

    26. WAR file

    27. web application

  13. spring-boot-calendar Project

  14. spring-boot-journal-oauth directory structure

  15. Spring-boot-journal project

  16. Spring Boot Relaxed Binding

  17. Spring-boot-starter-test

  18. Spring-boot-starter-web dependency

  19. Spring-boot-web

  20. SpringClassRule

  21. Spring Initializr

  22. Spring integration test

    1. add()

    2. findByTitle()

    3. getAll()

    4. Hamcrest

    5. HttpMessageConverter<T>

    6. journal domain class

    7. JsonPath

    8. @RunWith annotation

    9. setup()

    10. spring-boot-starter-test

    11. STS IDE

    12. toJsonString(Object)

  23. SpringMethodRule

  24. Spring MVC applications

  25. Spring security

    1. application.properties

    2. AuthenticationManagerConfiguration class

    3. basic security window

    4. custom login.html page

    5. definition

    6. http://localhost:8080/api, accessing

    7. index html page

    8. InMemorySecurityConfiguration.java class

    9. JournalController.java class

    10. journal-secure project structure

    11. login.html page

    12. MySQL

    13. OAuth2

      1. api endpoint

      2. client ID

      3. index.html page

      4. JournalController.java class

      5. ResourceOAuthSecurityConfiguration.java class

    14. OAuth2 pom.xml

    15. OAuth flow

    16. pom.xml

    17. ResourceSecurityConfiguration class

    18. ResourceSecurityConfiguration.java class

    19. JdbcSecurityConfiguration.java class

    20. src/main/resources/data.sql

    21. src/main/resources/schema.sql

  26. Spring Technologies in Spring Boot

  27. Spring Tool Suite (STS)

  28. SQL databases

  29. SSL self-signed keystore file

    1. Certificate Authority

    2. Google Chrome’s version

    3. keytool command

    4. /login endpoint

  30. Standalone spring apps vs. Spring Boot apps

  31. String method

T, U, V

  1. @Test

  2. Thymeleaf technology

  3. Tomcat-based server

  4. /trace endpoint

W

  1. WebSecurityConfigurerAdapter class

  2. WebSockets

    1. definition

    2. index.html web page

    3. pom.xml file

    4. Producer.java class

    5. REST endpoint

    6. SockJS and Stomp messages

    7. WebSocketConfig class

  3. Web testing

X, Y, Z

  1. XML with Spring Boot

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.218.45