SpringBoot起動エラーFailed to determine a suitable driver class
1557 ワード
SpringBoot起動エラーは次のとおりです.
これを注釈に頼めばいい
アプリケーションはDataSourceには使用していませんがpom.xmlにはmybatis-spring-boot-starterが導入されています
問題解決策は2つあります.mybatis-spring-boot-starterの依存を取り除くことで、spring boot関連のコードがspring boot自動初期化DataSource関連のコードを禁止することはありません.
禁止する方法は2つあります.
起動クラスの@SpringBootApplicationに加えて
アプリケーションでpropertiesでの構成:
個人情報サイト
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-06 21:27:18.275 ERROR 10968 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1
これを注釈に頼めばいい
の原因となる
アプリケーションはDataSourceには使用していませんがpom.xmlにはmybatis-spring-boot-starterが導入されています
問題解決策は2つあります.mybatis-spring-boot-starterの依存を取り除くことで、spring boot関連のコードがspring boot自動初期化DataSource関連のコードを禁止することはありません.
禁止する方法は2つあります.
起動クラスの@SpringBootApplicationに加えて
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })
アプリケーションでpropertiesでの構成:
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
個人情報サイト