Hello everyone, I am a duck:
Share issue a springboot flash back today. Exactly have to say it is not.
surroundings:
springboot version 2.1.0.RELEASE
abnormal:
2019-05-25 19:39:00.822 ==> [main] ==> INFO com.cgmanage.migrate.MigrateApplication - Starting MigrateApplication v1.0.0-SNAPSHOT on localhost with PID 27493 (/opt/web_app/data_migrate/test-1.0.0.jar started by root in /opt/web_app/data_migrate)
2019-05-25 19:39:00.827 ==> [main] ==> DEBUG com.cgmanage.migrate.MigrateApplication - Running with Spring Boot v2.1.0.RELEASE, Spring v5.1.2.RELEASE
2019-05-25 19:39:00.830 ==> [main] ==> INFO com.cgmanage.migrate.MigrateApplication - No active profile set, falling back to default profiles: default
2019-05-25 19:39:04.153 ==> [main] ==> INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8085"]
2019-05-25 19:39:04.172 ==> [main] ==> INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2019-05-25 19:39:04.172 ==> [main] ==> INFO org.apache.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/9.0.12
2019-05-25 19:39:04.195 ==> [main] ==> INFO org.apache.catalina.core.AprLifecycleListener - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2019-05-25 19:39:04.346 ==> [main] ==> INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2019-05-25 19:39:04.620 ==> [main] ==> INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
The main is that these two lines:
No active profile set, falling back to default profiles: default
org.apache.catalina.core.StandardService - Stopping service [Tomcat]
solution:
Internet, it said adding springboot-web of dependence, but useless.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Reduce springboot version to 2.0.5.RELEASE, or not.
The same project, you can run up a test environment, the production environment flash back, the only difference is specified at startup profiles differ.
Careful comparison of the configuration file, found that there is not the same place.
Test environment configuration file:
server:
port: 8085
spring:
application:
name: test-migrate
datasource:
write:
jdbc-url: jdbc:mysql://localhost:3306/test?useSSL=false&allowMultiQueries=true&useUnicode=true&characterEncoding=utf8
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
idleTimeout: 180000
connectionTimeout: 180000
validationTimeout: 6000
maxPoolSize: 200
minIdle: 100
Production profile less than the test line.
idleTimeout: 180000
Yes. It sent this line.
If you also have the same problem with me, logs the error did not print the words.
Recommended to check the configuration file , compare carefully. . . surprise