springboot日常问题处理手记
springboot启动问题
1.@Autowired报错Could not autowire. No beans of xxx
解决:只需在DAO接口加上@Component 或者 @Repository
参考:https://blog.csdn.net/Mr_EvanChen/article/details/84035445
2.Consider defining a bean of type ‘XXX’ in your configuration.
解决:在启动类上加上@MapperScan或者@ComponentScan注解,手动指定application类要扫描哪些包下的注解,如下所示:
@SpringBootApplication
@ComponentScan(basePackages = {"com.xxx.xxx.dao"})
参考:https://www.cnblogs.com/nananana/p/9333917.html
https://blog.csdn.net/suxiexingchen/article/details/84984349
3.Failed to configure a DataSource: 'url' attribute is not specified and no embedd
问题:应用中没有配置datasource的一些相关属性,例如:地址值啊,数据库驱动啊,用户名啊,密码啊
解决: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
5.Exception in thread "main" java.lang.NoSuchMethodError: freemarker.template.Configuration.
定位是freemarker版本问题:
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>
</dependency>
改为:
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.28</version>
</dependency>
就正常了
springboot运行中问题
1.mybatis-plus驼峰下划线转换问题
设置不用其下划线命名法,在MybatisPlusConfig.java中设置
MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
mybatisPlus.setDbColumnUnderline(true);
也可以在application.yml配置
mybatis-plus:
global-config:
#驼峰下划线转换
db-column-underline: true
springboot日常问题处理手记的更多相关文章
- 【日常错误】spring-boot配置文件读取不到
最近在用spring-boot做项目时,遇到自定义的配置文件无法读取到的问题,通过在appcation.java类上定义@PropertySource(value = {"classpath ...
- Java SpringBoot 手记
SpringBoot Git:https://github.com/spring-projects/spring-boot Maven (mvn)环境配置: 下载地址:http://maven.apa ...
- [转]mysql日常工作手记
1. 给navy加show权限: 1 2 update mysql.user set Show_db_priv='Y' where user='navy'; flush privileges; 2. ...
- springboot常用方法手记
1.Map方法 获取map的key和value的方法 Map<String, Object> map = new HashMap<>(); map.put("mobi ...
- 关于《Linux.NET学习手记(8)》的补充说明
早前的一两天<Linux.NET学习手记(8)>发布了,这一篇主要是讲述OWIN框架与OwinHost之间如何根据OWIN协议进行通信构成一套完整的系统.文中我们还直接学习如何直接操作OW ...
- [小北De编程手记] : Lesson 08 - Selenium For C# 之 PageFactory & 团队构建
本文想跟大家分享的是Selenium对PageObject模式的支持和自动化测试团队的构建.<Selenium For C#>系列的文章写到这里已经接近尾声了,如果之前的文章你是一篇篇的读 ...
- springboot 入门二- 读取配置信息一
在上篇入门中简单介绍下springboot启动使用了大量的默认配置,在实际开发过程中,经常需要启动多个服务,那端口如何手动修改呢? 此篇就是简单介绍相关的配置文件信息. Spring Boot允许外部 ...
- SpringBoot入门:Spring Data JPA 和 JPA(理论)
参考链接: Spring Data JPA - Reference Documentation Spring Data JPA--参考文档 中文版 纯洁的微笑:http://www.ityouknow ...
- springboot集成jpa
spring data jpa简介 spring data jpa是spring基于hibernate及jpa规范封装出来的一套持久层框架.该框架极大的降低了开发者工作量,提升开发效率.提供的关键字可 ...
随机推荐
- wal2json Dockerfile
以下是一个wal2json pg扩展的dockerfile,方便测试使用 dockerfile FROM postgres:11.2 AS build ENV VERSION 1_0 RUN buil ...
- 初识xls文件的读写
# 开发人员 : llm#时间ccc:import xlrdimport xlwt def read_xls(): info = xlrd.open_workbook('pytest.xls') pr ...
- <BackTracking> dfs: 39 40
39. Combination Sum Combination,组合问题用DFS罗列全部的答案. class Solution { public List<List<Integer> ...
- [LeetCode] 898. Bitwise ORs of Subarrays 子数组按位或操作
We have an array A of non-negative integers. For every (contiguous) subarray B = [A[i], A[i+1], ..., ...
- [转]VS2017避免全部安装至C盘
VS2017避免全部安装至C盘 版权声明:商业用途请联系博主,非商业转载请标明出处. https://blog.csdn.net/qq_15807167/article/details/7247208 ...
- java byte[]和base64互相转换
1.方式一 import java.io.UnsupportedEncodingException; import java.util.Base64; // byte[]转base64 Strin ...
- docker 发布应用时添加 git revision
概要 实施步骤 获取 git revision 前端 git revision 注入 后端 git revision 注入 概要 docker 发布应用时, 将 git revision 注入到应用中 ...
- [转帖]CHROME开发者工具的小技巧
CHROME开发者工具的小技巧 https://coolshell.cn/articles/17634.html 需要仔细学习看一看呢. 2017年01月19日 陈皓 评论 58 条评论 64,08 ...
- [转帖]Linux监测某一时刻对外的IP连接情况
Linux监测某一时刻对外的IP连接情况 https://blog.csdn.net/twt326/article/details/81454171 公司机器有病毒 需要分析一下. 之前有需要,在CS ...
- sql server的for xml path与变通的行转列
SQL Server中有提供一个FOR XML PATH的子句(不知道能不能叫函数),用来将查询结果行输出成XML格式,我们可以通过这个语法做一些变通实现一些特定的功能,比如说行转列.要会变通的话,当 ...