我得到这个,除了在AWS弹性豆茎,但应用程序在本地工作。
01-Aug-2018 07:44:54.815 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://d-use1-xx.xxxxxxxxxxx.us-east-1.rds.amazonaws.com:3306/xxxxxxxxxxx
正确指定了JDBC URL。我有这个
file.war/WEB-INF/classes/application.properties
spring.datasource.url = jdbc:mysql://d-use1-xx.xxxxxxxxxx.us-east-1.rds.amazonaws.com:3306/xxxxxxxxx
spring.datasource.username = xxxx
spring.datasource.password = xxxxxxxxx
我确实有
\WEB-INF\lib\mysql-connector-java-5.1.46.jar
在战争档案中。
我不知道这是否重要,但我最近为SpringSecurityOAuth2添加了一个JDBC令牌存储,并在主类中添加了它。
@SpringBootApplication
@MapperScan("com.xxxxxx.xxxxxx.mapper")
public class XxxxxxxxxxxxApplication extends SpringBootServletInitializer {
@Bean(name = "OAuth")
@ConfigurationProperties(prefix="spring.datasource")
public DataSource secondaryDataSource() {
return DataSourceBuilder.create().build();
}
我不知道它是否重要(以前从未发生过),但有一个空的环境变量集
2018年8月1日07:44:38.290 info[main]org.apache.catalina.startup.versionloggerlistener.log命令行参数:-djdbc_connection_string=