springboot啓動問題html
1.@Autowired報錯Could not autowire. No beans of xxxjava
解決:只需在DAO接口加上@Component 或者 @Repositoryspring
參考:https://blog.csdn.net/Mr_EvanChen/article/details/84035445數據庫
2.Consider defining a bean of type ‘XXX’ in your configuration.瀏覽器
解決:在啓動類上加上@MapperScan或者@ComponentScan註解,手動指定application類要掃描哪些包下的註解,以下所示: springboot
@SpringBootApplication @ComponentScan(basePackages = {"com.xxx.xxx.dao"})
參考:https://www.cnblogs.com/nananana/p/9333917.htmlmybatis
https://blog.csdn.net/suxiexingchen/article/details/84984349app
3.Failed to configure a DataSource: 'url' attribute is not specified and no embeddide
問題:應用中沒有配置datasource的一些相關屬性,例如:地址值啊,數據庫驅動啊,用戶名啊,密碼啊url
解決:application.properties文件中加spring.datasource相關配置
參考:https://blog.csdn.net/qq_40223688/article/details/88191732
4.org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException
問題:以前生成了引發異常的隊列,一啓動就報錯
解決:瀏覽器打開http://192.168.0.100:15672/#/把以前相關的隊列刪除,再次啓動不報錯了
參考:https://www.cnblogs.com/javawxid/p/10855071.html
springboot運行中問題
1.mybatis-plus駝峯下劃線轉換問題
設置不用其下劃線命名法,在MybatisPlusConfig.java中設置
MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean(); mybatisPlus.setDbColumnUnderline(true);
也能夠在application.yml配置
mybatis-plus: global-config: #駝峯下劃線轉換 db-column-underline: true