spring jpa data筆記

來源:互聯網
上載者:User

標籤:

tomcat啟動Maven項目的時候總拋出這樣的錯誤:

Error creating bean with name ‘org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration‘: Injection of autowired dependencies failed;

看了一下錯誤的最後一句是

Cannot determine embedded database driver class for database type NONE

找到一個國外問類似問題的,有一個人給出的答案是在pom.xml裡加上依賴

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

下面有人問你確定你要在我們討論GAE/Datastore的時候亂入H2 database?一個人跟進說他成功了,又有一個人說他也成功了。於是我試了一下,搞定了!

後面有人分析說因為Spring Boot會自動載入幾種資料庫,所以需要Datasource等等,另一個人說只要在spring-boot-starter-data-jpa依賴中去掉hibernate-entitymanager,但我沒成功,看評論也有懷疑他寫錯了的。還有人想取消DataSourceAutoConfiguration,有空再研究下。

reference:http://stackoverflow.com/questions/24074749/spring-boot-cannot-determine-embedded-database-driver-class-for-database-type


 

 


 
 

spring jpa data筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.