第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

找不到 Spring Boot 2.1 EntityManagerFactory Bean

找不到 Spring Boot 2.1 EntityManagerFactory Bean

眼眸繁星 2022-06-30 19:00:42
我有一個(gè)簡(jiǎn)單的帶有 JPA、Web 和 PostgreSQL 的 Spring Boot 項(xiàng)目。我正在使用最新的 Spring Boot 版本2.1.3.RELEASE。添加簡(jiǎn)單的 JpaRepository 應(yīng)用程序后啟動(dòng)失敗并出現(xiàn)以下錯(cuò)誤:***************************APPLICATION FAILED TO START***************************Description:Field dataMappingRepository in com.my.example.service.impl.SimpleServiceImpl required a bean named 'entityManagerFactory' that could not be found.The injection point has the following annotations:    - @org.springframework.beans.factory.annotation.Autowired(required=true)Action:Consider defining a bean named 'entityManagerFactory' in your configuration.我有一個(gè)簡(jiǎn)單的@Service 類,例如:public class SimpleServiceImpl implements SimpleService {  @Autowired private SimpleJpaRepository repo;}和 JpaRepository:public interface SimpleJpaRepository extends JpaRepository<SimpleEntity, Long> {}這是我的application.yml:spring:   datasource:      url: jdbc:postgresql://localhost:5432/simple      username: user      password: pass      driver-class-name: org.postgresql.Driver   jpa:      show-sql: false      properties:         hibernate:            dialect: org.hibernate.dialect.PostgreSQLDialect      hibernate:         ddl-auto: validate如果我將spring-boot-starter-parent更改為2.0.8.RELEASE應(yīng)用程序?qū)⒄_啟動(dòng)。
查看完整描述

2 回答

?
千巷貓影

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊

好的,所以最后問(wèn)題出在Andy Wilkinson所說(shuō)的緩存 Hibernate 依賴項(xiàng)上。

從我的 M2 存儲(chǔ)庫(kù)中刪除org.hibernate文件夾并更新 maven 項(xiàng)目后,它可以正常工作。


查看完整回答
反對(duì) 回復(fù) 2022-06-30
?
POPMUISE

TA貢獻(xiàn)1765條經(jīng)驗(yàn) 獲得超5個(gè)贊

我正在使用最新的 Spring Boot 版本 2.1.2.RELEASE。
但是錯(cuò)誤地,在屬性標(biāo)簽中我忘記刪除 4.3.5 版本,如下所示,這會(huì)導(dǎo)致加載的庫(kù)之間出現(xiàn)混淆。 在 org.hibernate 文件夾的 .m2 存儲(chǔ)庫(kù)中,我下載了兩個(gè)版本庫(kù)。刪除 org.hibernate 文件夾并更新 maven 項(xiàng)目。它會(huì)運(yùn)行。
<properties><hibernate.version>4.3.5.Final</hibernate.version></properties>

查看完整回答
反對(duì) 回復(fù) 2022-06-30
  • 2 回答
  • 0 關(guān)注
  • 265 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)