踩坑实录
# 踩坑实录
慕白Lee
业精于勤荒于嬉,行成于思毁于随。 学业由于勤奋而专精,由于玩乐而荒废;德行由于独立思考而有所成就,由于因循随俗而败坏。 ——出自(唐)韩愈《进学解》
展开
-
错误: 找不到或无法加载主类
【代码】错误: 找不到或无法加载主类。原创 2020-10-29 19:44:51 · 7019 阅读 · 1 评论 -
springboot文件上传大小限制:The field file exceeds its maximum permitted size of 1048576 bytes
文件上传报错,接口断点不走,原因是tomcat默认限制。原创 2021-08-06 19:27:49 · 1188 阅读 · 0 评论 -
Untracked Files Prevent MergeMove or commit them before merge
拉取代码莫名出现。原创 2021-08-09 14:48:56 · 2888 阅读 · 0 评论 -
【Java】Could not initialize class net.sf.cglib.beans.BeanMap$Generator异常解决
使用easyexcel时,研发环境正常, 服务器编译正常, EasyExcel调用方法的时候, 服务器出现Could not initialize class net.sf.cglib.beans.BeanMap$Generator问题。springboot最好是不用动了, 查询springboot的asm依赖版本, 跟cglib依赖 asm版本保持一致。easyexcel 3.3.0 依赖 cglib 3.1,cglib又依赖 asm;项目的springboot版本2.x,底层会依赖 asm。原创 2023-08-25 16:37:17 · 3392 阅读 · 1 评论 -
Tomcat控制台中文乱码
【代码】Tomcat控制台中文乱码。原创 2022-10-16 22:12:25 · 472 阅读 · 0 评论 -
Spring Boot上传文件后台报错:MissingServletRequestPartException:Required request part ‘File‘ is not present
一、报错信息上传文件时报错:[org.springframework.web.multipart.support.MissingServletRequestPartException: Required request part ‘File’ is not present。二、正确代码layui.upload.render({ elem: "#impo...原创 2020-04-09 21:38:20 · 38242 阅读 · 7 评论 -
IDEA的MAVEN不下载jar包<dependencyManagement>
一、问题怎么调都不下载,检查Maven配置也没有错误二、方法删掉 pom文件中的 < dependencyManagement >,就开始下载了。在内部的依赖不会马上到中央仓库中去下载jar包,而是在子工程引用的时候才会去下载jar包三、详解.........原创 2022-07-07 12:54:00 · 7249 阅读 · 1 评论 -
Error: could not find java.dll Error: Could not find Java SE Runtime Environment解决方法
Error: could not find java.dll Error: Could not find Java SE Runtime Environment解决方法原创 2022-07-07 10:43:23 · 2693 阅读 · 0 评论 -
Springboot拦截器注入service为null
目录一、过滤器调用service二、方法1(失败)三、方法2:手动获取bean(成功)一、过滤器调用service自定义的过滤器调用日志方法时发现service为null,加@Component配置扫描依然不好使,下面又做了几次尝试,记录下二、方法1(失败)首先,自定义异常统一处理类,然后,自定义异常DemoException,最后,统一捕获处理,想法很好,但是此处无法抛出异常,十分尴尬。。。package com.sgcc.censor.common.b.原创 2022-05-25 23:24:37 · 1481 阅读 · 0 评论 -
Field mapper in xxxServiceImpl required a single bean, but 5 were found:
目录一、问题二、解决方法一、问题重构代码时,遇到一个问题,写的基础实现类被多个类继承,下面按照错误提示修改一下Field mapper in com.move.exam.app.service.base.BaseServiceImpl required a single bean, but 5 were found: - pageHelperProperties: defined by method 'pageHelperProperties' in class path reso.原创 2022-04-26 00:11:10 · 2608 阅读 · 0 评论 -
Error creating bean with name ‘projectingArgumentResolverBeanPostProcessor‘ defined in class path re
由于更改了包名,导致此处报错。发生的原因:切入点错误。原创 2022-04-25 23:45:00 · 6816 阅读 · 1 评论 -
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
yml或者properties文件没有被扫描到,在pom文件中添加如下,来保证文件都能正常被扫描到并且加载成功。很明显,就是在应用中没有配置datasource的一些相关属性,例如:数据库DataSource或者一些配置出错了。无法配置DataSource:未指定'url'属性,也无法配置嵌入数据源。启动Springboot项目后启动报错,本人第一种方法解决。排除此类的autoconfig。启动以后就可以正常运行。检查application.yml文件中数据库配置信息。原创 2022-03-22 14:29:50 · 17968 阅读 · 8 评论 -
error setting certificate verify locations: CAfile: E:/01java/Git/mingw64/ssl/certs/ca-bundle.crt
14:09:08.160: [xx-parent] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/dev-1:refs/heads/dev-1 --set-upstream --tagsfatal: unable to access 'https://github.com/xx/demo.git/': e..原创 2022-02-18 14:19:51 · 2075 阅读 · 0 评论 -
Could not autowire. No beans of ‘xxxx‘ type found.
尽管这两个注解在许多情况下都可以互换使用,但是`@Resource`的注入更加灵活,因为它可以通过名称注入,而`@Autowired`则更加Spring-centric。`@Resource` 和 `@Autowired` 都是用于依赖注入的注解,它们可以将Spring容器中的bean注入到其他bean中,但它们之间有一些关键的区别。`@Autowired` 默认情况下要求依赖对象必须存在,如果允许为null,可以设置它的`required`属性为`false`。疑问、交流、鼓励请留言!原创 2021-12-20 18:35:53 · 410 阅读 · 0 评论 -
getWriter() has already been called for this response
报错信息ERROR 977 --- [io-8686-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: get原创 2021-12-20 18:30:01 · 1766 阅读 · 0 评论 -
java.lang.NullPointerException: element cannot be mapped to a null key
该报错是使用Stream的groupingBy方法,key为null导致的,可以加一个filter过滤null值Map<String, List<WorkflowVo>> collect = collect0.stream(). filter(l -> !StringUtils.isEmpty(l.getBusinessType())). collect(groupingBy(WorkflowVo::getBusinessType));..原创 2021-10-21 18:30:25 · 4394 阅读 · 0 评论 -
java.lang.IncompatibleClassChangeError: Found interface org.apache.poi.util.POILogger, but class was
原因: poi 引入的版本不一样原创 2021-06-17 18:36:41 · 2381 阅读 · 0 评论 -
lombok插件问题
查询数据存redis时,出现两份,不过名称不一样经查不是redis序列化的问题发现对象名不是驼峰命名原创 2020-12-30 18:06:38 · 336 阅读 · 0 评论 -
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
在JDBC URL中使用autoReconnect属性,实际测试时使用了autoReconnect=true&failOverReadOnly=false,网上所说的只对mysql 4之前的版本有效。重启生效,需要同时修改这两个参数。原创 2020-11-27 10:11:57 · 7044 阅读 · 1 评论 -
org.springframework.web.multipart.MultipartException
一、情况1表单属性设置属性enctype="multipart/form-data"二、情况2前端input标签name属性值与后台的MultipartFile的一致三、情况3postman重新打开后要重新选择excel文件原创 2020-09-01 09:21:17 · 1427 阅读 · 0 评论 -
程序包org.junit.jupiter.api不存在
目录一、提示信息二、Spring Boot 2.2 前后区别❶Spring Boot 2.2 之前的测试类❷Spring Boot 2.2 之后的测试类❸Spring Boot 2.2 之前的 pom.xml❹Spring Boot 2.2 之后的 pom.xml一、提示信息Error:(3, 29) java: 程序包org.junit.jupiter.api不存在二、Spring Boot 2.2 前后区别❶Spring Boot 2.2 之前的测试类.原创 2020-07-31 17:50:06 · 7852 阅读 · 3 评论 -
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of ty
一.报错信息Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.data.redis.core.RedisTemplate<java.lang.String, java.lang.Object...原创 2020-03-21 09:11:20 · 12143 阅读 · 0 评论 -
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing
一、报错信息org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/ss/add.html]org.thymeleaf.exceptions.TemplateInputExcep...原创 2020-03-12 10:28:23 · 40384 阅读 · 0 评论 -
java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.ExampleProvider.「init」()
一、报错信息java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.ExampleProvider.<init>() at java.lang.Class.getConstructor0(Class.java:3082) ~[na:1.8.0_201] at java.lang.Class.newIn...原创 2020-03-09 16:51:29 · 1845 阅读 · 0 评论 -
Field userMapper in com.example.playspring.service.UserService required a bean of type ‘com.example.
一、报错信息Field sysUserMapper in com.example.playspring.service.sysUserService required a bean of type 'com.example.playspring.mapper.sysUserMapper' that could not be found.二、解决办法:在主函数类上添加以上注解,可以...原创 2020-03-09 16:43:04 · 6768 阅读 · 2 评论 -
Consider revisiting the entries above or defining a bean of type ‘org.springframework.data.redis.con
一、报错信息Description:Parameter 1 of method sessionRepositoryFilterRegistration in org.springframework.boot.autoconfigure.session.SessionRepositoryFilterConfiguration required a bean of type 'org.spr...原创 2020-03-06 14:44:46 · 52568 阅读 · 1 评论 -
Caused by: java.lang.ClassNotFoundException: org.springframework.core.log.LogMessage
搭建项目启动报错一、错误信息java.lang.NoClassDefFoundError: org/springframework/core/log/LogMessage at org.springframework.boot.StartupInfoLogger.logStarting(StartupInfoLogger.java:55) ~[spring-boot-2.2....原创 2020-03-06 14:36:47 · 35533 阅读 · 0 评论 -
Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to c
一、报错信息Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested except...原创 2019-12-25 13:16:16 · 7782 阅读 · 4 评论 -
Cannot find template location: classpath:/templates/ (please add some templates or check your Thymel
一、异常信息Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)。找不到模板位置:classpath:/ templates /(请添加一些模板或检查您的Thymeleaf配置)二、解决方法...原创 2019-12-23 23:55:40 · 9139 阅读 · 0 评论 -
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath
一、报错信息Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:...原创 2019-12-23 23:46:40 · 18169 阅读 · 1 评论 -
HikariPool-1 - Thread starvation or clock leap detected与Hikari数据源配置
2019-12-04 12:10:51.494 WARN 14480 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=7m48s317ms362µs591ns)....原创 2019-12-04 15:57:44 · 65010 阅读 · 11 评论 -
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1
一、pom中添加 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> ...原创 2019-12-03 18:57:08 · 155 阅读 · 0 评论 -
An error happened during template parsing (template: “class path resource [
An error happened during template parsing (template: "class path resource [theamleaf相关的错误,一个一个排除即可,以下本人遇到,仅供参考,记录下。原创 2019-11-14 17:39:43 · 780 阅读 · 0 评论 -
【IDEA】一直scanning files to index的四种解决方法(VIP典藏版)
目录方法一、File -> Invalidate Caches / Restart方法二、删除C:\Users\xxx\.IntelliJIdea2018.2\system文件夹方法三、将扫描的文件夹排除在建立索引的范围之外,即将xxx文件夹标记为Excluded。方法四、更改Edit Configurations和idea配置路径第四种方法摸索研究后得出,亲测好用!............原创 2019-10-29 15:34:37 · 266521 阅读 · 34 评论 -
Information:Internal caches are corrupted or have outdated format, forcing project rebuild:
一、报错信息信息:内部缓存已损坏或格式已过时,强制项目重建:com.intellij.util.io.PersistentEnumeratorBase $ CorruptedException:PersistentEnumerator存储已损坏Information:Internal caches are corrupted or have outdated format,forc...原创 2019-10-29 13:09:08 · 4568 阅读 · 0 评论 -
启动项目报错:Failed to extract parameter names for org.apache.ibatis.mapping.ParameterMapping
Description: Failed to bind properties under 'mybatis.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping: Reason: Failed to...原创 2019-10-24 17:48:29 · 4991 阅读 · 1 评论 -
Failed to bind properties under 'mybatis.configuration.mapped-statements[0]亲测可用
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2019-10-22 15:18:06.597 ERROR 14268 --- [ main] o.s.b.d.LoggingFailureAnalys...原创 2019-10-24 17:45:30 · 3695 阅读 · 1 评论 -
cannot resolve method 'run(java.lang.class)
springboot项目创建常见问题:https://blog.csdn.net/libusi001/article/details/97267365~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、分析都是Gitdownload的项目,其他人的项目没问题说明是环境的问题,配置/缓存或者其他...二、清理缓存:File-invalidate Cache...原创 2019-10-23 15:08:53 · 5246 阅读 · 0 评论 -
Cannot load JDBC driver class 'com.mysql.jdbc.driver'
springboot项目创建常见问题:https://blog.csdn.net/libusi001/article/details/97267365~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~首先检查配置文件有没有空格添加版本号重新Reimport....原创 2019-10-23 15:07:17 · 354 阅读 · 0 评论 -
springboot配置文件com.mysql.jdbc.Driver报红
springboot项目创建常见问题:https://blog.csdn.net/libusi001/article/details/97267365~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~一、问题二、解决依赖里把runtime去掉就行了。...原创 2019-10-23 15:03:18 · 1184 阅读 · 0 评论