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

為了賬號安全,請及時綁定郵箱和手機立即綁定

這個問題一直沒解決,有沒有人幫忙看下

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/imooc/demo/config/dao/SessionFactoryConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: The setting mapUnderScoreToCamelCass is not known.? Make sure you spelled it correctly (case sensitive).



正在回答

1 回答

錯誤提示:mapUnderScoreToCamelCass不能識別,可能的原因是Mybatis的SpringBoot的支持版本不一致,建議少使用XML配置文件。因為SpringBoot2.2以上直接在properties中進行Mybatis的配置了,如下所示:

<dependency>
??????????? <groupId>org.mybatis.spring.boot</groupId>
??????????? <artifactId>mybatis-spring-boot-starter</artifactId>
??????????? <version>2.1.2</version>
??????? </dependency>

在 application.properties 配置文件中, 增加
SpringBoot 和 MyBatis 整合的相關配置:
#加載 MyBatis 配置文件
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=org.edsia.entity //實體類的包路徑

#MySQL數據源配置
spring.datasource.url=jdbc:mysql://localhost:3306/testdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=admin
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

這個問題一直沒解決,有沒有人幫忙看下

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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