報錯Cannot determine embedded database driver class for database type NONE解決方法


由於我不需要數據庫,啟動springboot報錯:

Cannot determine embedded database driver class for database type NONE
If you want an embedded database please put a supported one on the classpath.
If you have database settings to be loaded from a particular profile
you may need to active it (no profiles are currently active).

刪掉pom里全部相關數據庫的jar,也exclude相關DataSource的class,都不能解決,報錯依舊。最后:

pom增加:

	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
	</dependency>

完整的:

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-config</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-eureka</artifactId>
		</dependency>
		<!-- Cannot determine embedded database driver class for database type 
			NONE 不需要調用數據源解決方法 -->
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>
	</dependencies>

注意:參考了以下網址方法,但並不能解決問題。
https://blog.csdn.net/hengyunabc/article/details/78762097


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM