亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如果缺少 hibernate 依賴項,方法 org.postgresql.jdbc

如果缺少 hibernate 依賴項,方法 org.postgresql.jdbc

叮當貓咪 2023-05-17 16:59:06
我為 spring batch 創建了一個小的 hello world 項目:構建.gradle:buildscript {    repositories {        mavenCentral()    }    dependencies {        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE")    }}apply plugin: 'java'apply plugin: 'eclipse'apply plugin: 'idea'apply plugin: 'org.springframework.boot'apply plugin: 'io.spring.dependency-management'bootJar {    baseName = 'gs-batch-processing'    version = '0.1.0'}repositories {    mavenCentral()}sourceCompatibility = 1.8targetCompatibility = 1.8dependencies {    compile("org.springframework.boot:spring-boot-starter-batch")    compile("org.postgresql:postgresql")    compile("org.springframework.boot:spring-boot-starter-data-jpa")    //to fix exception on startup    //compile('org.hibernate:hibernate-core:5.4.2.Final')    testCompile("junit:junit")}配置:@Configuration@EnableBatchProcessingpublic class BatchConfiguration {    @Autowired    public JobBuilderFactory jobBuilderFactory;    @Autowired    public StepBuilderFactory stepBuilderFactory;    @Autowired    private DbPersonWriter dbPersonWriter;    @Autowired    private ToLowerCasePersonProcessor toLowerCasePersonProcessor;    @Value("${app.users-location}")    Resource csvResource;    @Bean    public Job job() {        return jobBuilderFactory.get("myJob")                .incrementer(new RunIdIncrementer())                .flow(csvToDataBaseStep())                .end()                .build();    }    private Step csvToDataBaseStep() {        return stepBuilderFactory.get("csvToDatabaseStep")                .<Person, Person>chunk(100)                .reader(csvPersonReader())                .processor(toLowerCasePersonProcessor)                .writer(dbPersonWriter)                .build();    }
查看完整描述

1 回答

?
繁花不似錦

TA貢獻1851條經驗 獲得超4個贊

這是一個 Hibernate問題。如果您使用的是 Spring Boot 最新版本,您可以?在2.0.x此處查看,但此問題已在5.4.0.CR1上修復,那么您需要添加該依賴項,或者如果可能,請添加最新版本:2.1.xHibernate 5.3.10.finalHibernate version

對于搖籃:

compile('org.hibernate:hibernate-core:5.4.2.Final')

對于胃:

<dependency>
????<groupId>org.hibernate</groupId>
????<artifactId>hibernate-core</artifactId>
????<version>5.4.2.Final</version>
</dependency>

更新“彈簧啟動 2.2.0.M(1-4)”

此外Spring boot v2.2.0.Mx,現在還包括Hibernate v5.4.x這些版本的此問題已修復。


查看完整回答
反對 回復 2023-05-17
  • 1 回答
  • 0 關注
  • 196 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號