最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

mybatis-plus-boot-starter包與mybatis-plus-generator的沖突解決

 更新時(shí)間:2023年10月25日 11:33:05   作者:L564458192  
本文主要介紹了mybatis-plus-boot-starter包與mybatis-plus-generator的沖突解決,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

我這里搭建框架時(shí)mybatis-plus-boot-starter 包的版本是3.5.0,一定要注意版本,因?yàn)楝F(xiàn)在很多spring高版本的jar包都要求高于jkd8,但是因?yàn)閷W(xué)習(xí)、開發(fā)及維護(hù)成本,市面上主流的還是jkd8。

繼續(xù)說我這次搭建框架所遇到到的問題,先看具體的UBG內(nèi)容:

2023-04-03 18:23:52.052 [INFO ] org.springframework.data.repository.config.RepositoryConfigurationDelegate 262 Multiple Spring Data modules found, entering strict repository configuration mode 
2023-04-03 18:23:52.052 [INFO ] org.springframework.data.repository.config.RepositoryConfigurationDelegate 132 Bootstrapping Spring Data Redis repositories in DEFAULT mode. 
2023-04-03 18:23:52.052 [INFO ] org.springframework.data.repository.config.RepositoryConfigurationDelegate 201 Finished Spring Data repository scanning in 9 ms. Found 0 Redis repository interfaces. 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseAuthMapper' and 'com.javahome.dao.mapper.BaseAuthMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseAuthResourceMapper' and 'com.javahome.dao.mapper.BaseAuthResourceMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseDeptMapper' and 'com.javahome.dao.mapper.BaseDeptMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseRoleAuthMapper' and 'com.javahome.dao.mapper.BaseRoleAuthMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseRoleMapper' and 'com.javahome.dao.mapper.BaseRoleMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseUserInfoMapper' and 'com.javahome.dao.mapper.BaseUserInfoMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'baseUserRoleMapper' and 'com.javahome.dao.mapper.BaseUserRoleMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 Skipping MapperFactoryBean with name 'sysResourceMapper' and 'com.javahome.dao.mapper.SysResourceMapper' mapperInterface. Bean already defined with the same name! 
2023-04-03 18:23:52.052 [WARN ] org.mybatis.spring.mapper.ClassPathMapperScanner 44 No MyBatis mapper was found in '[com.javahome.dao.mapper]' package. Please check your configuration. 
2023-04-03 18:23:53.053 [WARN ] io.undertow.websockets.jsr 68 UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used 
2023-04-03 18:23:53.053 [INFO ] io.undertow.servlet 382 Initializing Spring embedded WebApplicationContext 
2023-04-03 18:23:53.053 [INFO ] org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext 292 Root WebApplicationContext: initialization completed in 2210 ms 
2023-04-03 18:23:54.054 [WARN ] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext 591 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginController': Unsatisfied dependency expressed through method 'setRoleService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseRoleServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'baseRoleMapper' defined in file [D:\ctvit_code\springboot-javahome\javahome-dao\target\classes\com\javahome\dao\mapper\BaseRoleMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler 
2023-04-03 18:23:54.054 [INFO ] org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener 136 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 
2023-04-03 18:23:54.054 [ERROR] org.springframework.boot.SpringApplication 824 Application run failed 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginController': Unsatisfied dependency expressed through method 'setRoleService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseRoleServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'baseRoleMapper' defined in file [D:\ctvit_code\springboot-javahome\javahome-dao\target\classes\com\javahome\dao\mapper\BaseRoleMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:767)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:719)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
	at com.javahome.web.JavahomeWebApplication.main(JavahomeWebApplication.java:31)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseRoleServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'baseRoleMapper' defined in file [D:\ctvit_code\springboot-javahome\javahome-dao\target\classes\com\javahome\dao\mapper\BaseRoleMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:332)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:759)
	... 20 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'baseRoleMapper' defined in file [D:\ctvit_code\springboot-javahome\javahome-dao\target\classes\com\javahome\dao\mapper\BaseRoleMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1534)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1417)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:479)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:550)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:520)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:673)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:329)
	... 31 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1519)
	... 45 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	... 58 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/baomidou/mybatisplus/core/handlers/PostInitTableInfoHandler
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration.sqlSessionFactory(MybatisPlusAutoConfiguration.java:215)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 59 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.baomidou.mybatisplus.core.handlers.PostInitTableInfoHandler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 65 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:56832', transport: 'socket'

Process finished with exit code 1

我的pom.xml引用:

    <!-- 引入Druid依賴,阿里巴巴所提供的數(shù)據(jù)源 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.28</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.29</version>
        </dependency>

具體是什么原因?qū)е碌牟磺宄苯诱f解決辦法:?jiǎn)栴}就在mybatis-plus-generator 這個(gè)包及版本上,將mybatis-plus-generator刪除,并降低版本至3.5.0,項(xiàng)目正常啟動(dòng)訪問。

到此這篇關(guān)于mybatis-plus-boot-starter包與mybatis-plus-generator的沖突的文章就介紹到這了,更多相關(guān)mybatis-plus-boot-starter與mybatis-plus-generator內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

无为县| 奉化市| 镇坪县| 辽中县| 鸡东县| 台南县| 淮南市| 托克逊县| 高碑店市| 吴旗县| 调兵山市| 通州市| 兰西县| 莱阳市| 鹤山市| 苍山县| 阳西县| 涞水县| 石台县| 龙井市| 灵寿县| 高陵县| 敦煌市| 鹤峰县| 体育| 哈尔滨市| 大邑县| 怀宁县| 财经| 新宁县| 洮南市| 昌吉市| 乐清市| 恩施市| 长宁县| 巩义市| 蓬安县| 广德县| 崇阳县| 嵩明县| 伊宁县|