国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

mybatis添加分頁(yè)配置時(shí)報(bào)錯(cuò) No bean named ‘org.springframework...ConfigurationClassPostProcessor.importRegistry

這篇具有很好參考價(jià)值的文章主要介紹了mybatis添加分頁(yè)配置時(shí)報(bào)錯(cuò) No bean named ‘org.springframework...ConfigurationClassPostProcessor.importRegistry。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

場(chǎng)景:在mybatis 添加分頁(yè)配置時(shí)報(bào)錯(cuò)
現(xiàn)象:No bean named ‘org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry
原因:版本問(wèn)題
正確版本:

com.baomidou
mybatis-plus-boot-starter
3.4.0

錯(cuò)誤版本:

com.baomidou
mybatis-plus-boot-starter
3.5.3.1

附MybatisPlusConfig 配置文件:
package com.example.demo.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {

// // 舊版
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// // 設(shè)置請(qǐng)求的頁(yè)面大于最大頁(yè)后操作, true調(diào)回到首頁(yè),false 繼續(xù)請(qǐng)求 默認(rèn)false
// // paginationInterceptor.setOverflow(false);
// // 設(shè)置最大單頁(yè)限制數(shù)量,默認(rèn) 500 條,-1 不受限制
// // paginationInterceptor.setLimit(500);
// // 開(kāi)啟 count 的 join 優(yōu)化,只針對(duì)部分 left join
// paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
// return paginationInterceptor;
// }

// 最新版
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
    return interceptor;
}

}文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-640908.html

到了這里,關(guān)于mybatis添加分頁(yè)配置時(shí)報(bào)錯(cuò) No bean named ‘org.springframework...ConfigurationClassPostProcessor.importRegistry的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘s

    ????????在練習(xí)一個(gè)springboot項(xiàng)目時(shí),在執(zhí)行時(shí)出現(xiàn)了下面的報(bào)錯(cuò)信息,找了好久都不知道怎么回事,因此,記錄下整個(gè)過(guò)程,從而鞭策如菜雞一樣的自己。我的問(wèn)題是打包問(wèn)題(刪除pom打包方式就可以了) 目? 錄 前言 1、報(bào)錯(cuò)問(wèn)題 2、解決過(guò)程 3、解決方式 4、總結(jié) Cause

    2023年04月22日
    瀏覽(29)
  • No qualifying bean of type ‘org.springframework.transaction.TransactionManager‘ available: expected

    報(bào)錯(cuò)信息 Spring Boot 啟動(dòng)報(bào)錯(cuò): 報(bào)錯(cuò)信息顯示:沒(méi)有可注入的 TransactionManager ,因?yàn)橐蟠耸挛锕芾砥鲬?yīng)該是一個(gè),但是發(fā)現(xiàn)了兩個(gè),容器不知道應(yīng)該注入哪個(gè),存在的兩個(gè)容器分別是: transactionManager 、 mongoTransactionManager 解決辦法 方法一:Primary 查找項(xiàng)目?jī)?nèi)bean名稱(chēng)為: tra

    2024年02月03日
    瀏覽(16)
  • 解決:No qualifying bean of type ‘org.springframework.web.client.RestTemplate‘ available:

    SpringBoot 項(xiàng)目啟動(dòng)時(shí)報(bào)錯(cuò): ?No qualifying bean of type \\\'org.springframework.web.client.RestTemplate\\\' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} ? ? 產(chǎn)生原因 :由于springboot版本問(wèn)題,當(dāng)前項(xiàng)目的版本需要

    2024年02月04日
    瀏覽(24)
  • No qualifying bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate‘ a

    No qualifying bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 提示找不到 ElasticsearchRestTemplate 寫(xiě)一個(gè)配置類(lèi)注入

    2024年02月17日
    瀏覽(19)
  • Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed;

    更新更高版本的SpringBoot依賴(lài)解決了 來(lái)自GitHub上面的GitHub - echisan/springboot-jwt-demo: 這是一個(gè)使用了springboot+springSecurity+jwt實(shí)現(xiàn)的基于token的權(quán)限管理的一個(gè)demo項(xiàng)目,本地啟動(dòng)后報(bào)錯(cuò) 完整報(bào)錯(cuò)信息如下 提示信息里有 Hibernate 應(yīng)該和數(shù)據(jù)庫(kù)持久層框架有關(guān),項(xiàng)目用的是 jpa ,底層是

    2024年02月15日
    瀏覽(20)
  • 已解決org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factor

    已解決org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factory.異常的正確解決方法,親測(cè)有效!?。?org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factor 對(duì)于 org.springframework.beans.factory.UnsatisfiedDependencyException 異常,通常是由于依賴(lài)注

    2024年02月05日
    瀏覽(20)
  • org.springframework.context.ApplicationContextException: Failed to start bean ‘org.springframework.a

    使用RabbitMq測(cè)試交換機(jī)、隊(duì)列時(shí)候報(bào)的錯(cuò) 一開(kāi)始我以為是隊(duì)列的監(jiān)聽(tīng)器配置信息和監(jiān)聽(tīng)器代碼寫(xiě)錯(cuò)了,反復(fù)查看并沒(méi)有錯(cuò)誤。 然后繼續(xù)往下看報(bào)錯(cuò),有這倆報(bào)錯(cuò),瞬間頓悟。 ACCESS_REFUSED 這么大個(gè)字,看了好幾遍居然沒(méi)想到這方面的錯(cuò)誤,大概是配置密碼的時(shí)候copy錯(cuò)了 hotel

    2024年02月15日
    瀏覽(44)
  • 關(guān)于org.springframework.beans.factory.NoSuchBeanDefinitionException

    關(guān)于org.springframework.beans.factory.NoSuchBeanDefinitionException

    這個(gè)報(bào)錯(cuò)可能是因?yàn)椋?1. spring的xml配置文件Bean中的id和getBean的id不一致 spring的配置文件中: 而程序中 applicationContext.getBean(“studenta”, Student.class)中的是studenta而spring配置文件的id是student,不一致。 2. 是否是忘記加注解了 @Resource或@Autowired都可以(@Resource是jdk自帶的) 3.如果

    2024年02月13日
    瀏覽(18)
  • exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException

    exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException

    原因: Spring Boot異常org.springframework.beans.factory.NoUniqueBeanDefinitionException:沒(méi)有可用的合格Bean類(lèi)型:預(yù)期匹配單個(gè)Bean,但是匹配到了多個(gè),當(dāng)該bean被自動(dòng)裝配時(shí)與Spring Boot應(yīng)用程序上下文中的兩個(gè)或多個(gè)加載的Bean匹配時(shí),就會(huì)發(fā)現(xiàn)該異常。 Spring Boot允許從一個(gè)接口或抽象類(lèi)創(chuàng)

    2024年02月09日
    瀏覽(30)
  • Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

    修改為: ? ?解決辦法: BookDao層中添加@Mapper, 告訴springboot這是一個(gè)mybatis代理接口類(lèi)型, 快來(lái)掃描我!, 由此生成代理對(duì)象 原因三:?? 測(cè)試類(lèi)ModuleSetApplicationTests和引導(dǎo)程序ModuleSetApplication沒(méi)有在同名包下, 例如下圖, ModuleSetApplication類(lèi)在com.itheima下ModuleSetApplicationTests沒(méi)有直接在com

    2024年02月11日
    瀏覽(26)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包