
错误处理
天狼1222
不是试图,而是切切实实去做,只想一味尝试的人终归一事无成
展开
-
Caused by: feign.RetryableException: Connect to user-service:80 [user-service/192.168.129.12] failed
如果遇到feign请求失败的情况(之前都是正常的),检查下服务上配置的host的地址。如果不是默认的nacos,比如用的是nacos.k8s命名空间,那可能导致服务注册有问题,服务之间无法直接调用。因为nacos要开启鉴权,调整了项目里面gradle、springCloud,springBoot和nacos客户端引用的版本(也不能升得太高,不然无法启动)。检查了下,并没有80端口,用户中心的服务设置的端口是:8793。至于为啥这样的写法会连接不上,没理解过来。如果服务有开放端口的,就改成具体的ip地址。原创 2025-04-16 15:53:32 · 585 阅读 · 0 评论 -
jar 生成的jar包去掉-plain后缀
gradle升级到高版本后,生成jar包带有plain后缀,可以设置archiveClassifier.set(""),把后缀置空。原创 2024-07-09 07:55:23 · 974 阅读 · 0 评论 -
applicationContext.getBean 为null
使用applicationContext进行初始化的话,要注意项目里面是有已经存在该实现类,其次注意初始化顺序,不能在项目初始的时候就进行调用原创 2023-11-17 08:54:58 · 2333 阅读 · 0 评论 -
idea module 重命名
修改module名称是比较麻烦的,一开始就要遵循基本规范,减少改动的可能原创 2023-11-10 08:37:10 · 755 阅读 · 0 评论 -
Error creating bean with name ‘apiModelSpecificationReader‘ defined in URL
启动报Error creating bean with name 'apiModelSpecificationReader' defined in URL 是版本不一致的问题,加个去除对应模块去处理:exclude group: 'io.springfox', module: 'springfox-boot-starter'原创 2023-11-09 14:57:46 · 701 阅读 · 0 评论 -
mvn: Downloading from pluginRepository
maven镜像下载不下来,或者读取的地址不对,要检查指定的目录下的settings.xml地址是否正确,再检查下C盘用户目录下settings.xml 的地址是否对。两个保持一致。原创 2023-11-07 09:05:40 · 455 阅读 · 1 评论 -
This is often the result of over-eager type matching - consider using ‘getBeanNamesForType‘
碰到循环依赖的,把类之间的关系理清楚,看看哪些是相互引用了,把循环引用给断了。这样是比较好的原创 2023-09-08 14:56:51 · 4315 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException hibernate-validator
java.lang.ClassNotFoundException: javax.xml.bind.JAXBException 对于引用hibernate-validator参数验证报错的,记得看jdk版本,如果是jdk8版本以上,要添加jaxb-api的引用原创 2023-08-08 16:52:26 · 630 阅读 · 0 评论 -
返回值 <h2>Moved</h2>
如果返回值是特别的,比如Moved,不是具体的,先问问对方是否有收到,没有基本就是网络不通的问题了。需要加下网络访问地址的白名单原创 2023-05-31 16:18:49 · 1682 阅读 · 0 评论 -
Factory method ‘dataSource‘ threw exception Failed to determine a suitable driver class
对应的配置文件没有生成,这个更容易出现,是常常默认以为是有的,就没注意到原创 2023-05-17 15:24:12 · 2421 阅读 · 0 评论 -
win10 电脑连手机wifi 无法打开浏览器
如果电脑连接手机wifi连不上,DNS也未设置,就重新设置下ip。使用命令管理员,输入 netsh int ip rest。原创 2023-04-26 11:14:44 · 564 阅读 · 0 评论 -
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request
文件上传失败 tomcat.max-http-form-post-size原创 2023-04-13 15:08:32 · 1014 阅读 · 0 评论 -
Content type ‘multipart/form-data;boundary=----WebKitFormBoundaryF28EY3GDJybEjJPM;charset=UTF-8‘ not
文件上传报错。前端传的类型不对原创 2023-04-13 10:08:16 · 3419 阅读 · 0 评论 -
applicationContext=null的问题
如果在单个项目中,启动类需要在顶层的位置,才不用设置@ComponentScan,否则需要进行设置,才能读取得到。原创 2023-03-20 16:20:13 · 4025 阅读 · 1 评论 -
Cannot deserialize instance of `java.lang.String` out of START_OBJECT token at
map toString原创 2023-01-29 16:02:25 · 3166 阅读 · 0 评论 -
no suitable HttpMessageConverter found for response type [class java.io.InputStream]
restful获取文件流原创 2022-12-08 14:29:06 · 935 阅读 · 0 评论 -
All elements are null
All elements are null原创 2022-08-12 11:38:37 · 347 阅读 · 0 评论 -
TestEngine with ID ‘junit-vintage‘ failed to discover tests
单元测试原创 2022-06-10 14:37:48 · 3218 阅读 · 0 评论 -
java.lang.NullPointerException: null at org.springframework.util.ReflectionUtils.invokeMethod(Reflec
在使用ReflectionUtils反射处理调用方法的时候报错了错误:java.lang.NullPointerException: null at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]原因: 未找到对应的方法。处理思路:先单元测试,看看该...原创 2022-04-28 17:02:47 · 1112 阅读 · 0 评论 -
unable to initialize ‘javax.el.ExpressionFactory‘
build.gradle里面升级tomcat的版本ext['tomcat.version'] = '9.0.58'项目启动报错:javax.validation.ValidationException: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessag..原创 2022-03-01 11:33:48 · 2084 阅读 · 0 评论 -
Result window is too large, from + size must be less than or equal to: [10000] but was [111116]
es查询的时候,报错:具体的错误信息:{"error":{"root_cause":[{"type":"query_phase_execution_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [111116]. See the scroll api for a more efficient way to request.原创 2022-01-26 17:06:46 · 1233 阅读 · 0 评论 -
Failed to introspect Class
集成环境,项目启动报错:Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.XXX] from ClassLoader查了下introspect: 反省的,内省的意思。我理解为内部引用原因: XXX类内部引用的外部类的方法,没有对应的内容,即引用的jar包不是最...原创 2022-01-24 16:20:21 · 17223 阅读 · 0 评论 -
numHits must be > 0
在查询es的时候,报错:{ "type": "illegal_argument_exception", "reason": "numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count", "caused_by": { "type": "illegal_argument_exception", "reason": "numHits must be >..原创 2021-10-27 08:38:56 · 1636 阅读 · 1 评论 -
Caused by: java.io.FileNotFoundException: AbstractJsonpResponseBodyAdvice.class
原因:在一个项目,添加SpringBoota启动的内容,报错误Caused by: java.io.FileNotFoundException:class path resource [org/springframework/web/servlet/mvc/method/annotation/AbstractJsonpResponseBodyAdvice.class] cannot be opened because it does not exist看得挺懵的。Spring ...原创 2021-08-01 15:56:01 · 2180 阅读 · 0 评论 -
Could not GET ‘https://repo.spring.io/plugins-release/org/springframework/build/gradle/xxx
启动spring-framework项目的时候,报错:Could not GET 'https://repo.spring.io/plugins-release/org/springframework/build/gradle/propdeps-plugin/0.0.7/propdeps-plugin-0.0.7.jar'. at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClie..原创 2021-06-24 09:57:39 · 5316 阅读 · 0 评论 -
idea启动报错Native memory allocation (malloc) failed to allocate
idea启动报错Native memory allocation (malloc) failed to allocateidea启动的时候经常报内存不足。找了一些方法去设置,但是并没有什么卵用。只能关了idead重新跑,经常出现就很烦。无独有偶在阅读Idea跑Junit报错 这边文章的时候,里面提到一个扩大虚拟内存的方法,就试了下,可以用。有碰到类似的问题可以去试试,看看是否可以解决问题。处理:我的电脑->属性->高级系统设置->高级->设置...原创 2021-06-02 10:15:48 · 22788 阅读 · 5 评论 -
idea 创建module 没有src
在使用spring-framework-4.2.x 创建module,生成gradle项目,都没有生成src的内容,只有孤零零的gradle文件可能的原因之一: 网络的问题处理:1,检测网络: 如果有设置代理,就去settings那查询proxy把代理关了2,移除刚创建的module,然后把setting.gradle 里面 indule 新增项目 删了3,重新建立一个module依次往下点就可以。如果还不行,就多试几次。网络正常都会有...原创 2021-04-27 10:19:26 · 4774 阅读 · 0 评论 -
idea 找不到或无法加载主类
错误: 找不到或无法加载主类 com.yan.ms.work.WorkServiceApplicationDisconnected from the target VM, address: '127.0.0.1:51456', transport: 'socket'有时候更新gradle后,启动项目就报错了,错误: 找不到或无法加载主类 com.yan.ms.work.WorkServiceApplicationDisconnected from the target VM, ...原创 2021-03-31 14:05:21 · 1584 阅读 · 1 评论 -
springboot 启动 ApplicationContext applicationContext = null
ApplicationContext applicationContext = nullSpringboot 启动的时候,调用报错了,applicationContext = null 该如何处理呢?代码:@Componentpublic class SpringUtils implements ApplicationContextAware { private static ApplicationContext applicationContext; @O...原创 2021-03-26 20:52:32 · 7525 阅读 · 1 评论 -
ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifie
在使用idea2018导入 spring-framework5.2.x,编译的时候报错了Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;不明所以。导入 spring-framework4.2.x 编译没问题,gradle使用默认的也没问题。找了下spring-f.原创 2021-03-19 08:57:38 · 724 阅读 · 0 评论 -
Fielddata is disabled on text fields by default. Set fielddata=true
Fielddata is disabled on text fields by default. Set fielddata=true目录问题:处理:语法找my_type试错:使用 提示的type总结:问题:使用es语句进行排序查询的时候,GET /flow_basic_index*/_search { "size": 20, "from": 0, "sort": [ { "state": { "order": "desc" }原创 2021-03-15 09:31:29 · 1281 阅读 · 0 评论 -
org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.getPartConverters
使用maven项目启动的时候报错:nested exception is java.lang.NoSuchMethodError: org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.getPartConverters()Ljava/util/List;NoSuchMethodError:org.springframework.web.bind.annotation.RequestM.原创 2021-03-03 15:55:42 · 2767 阅读 · 2 评论