后端
a better world
这个作者很懒,什么都没留下…
展开
-
IDEA创建Spring Boot项目无法连接http://start.spring.io 解决方法
IDEA创建项目的时候显示无法连接到https://start.spring.io。解决办法:1.IDEA设置问题 点击IDEA setting之后,找到Http Proxy 选择Atuo-detect proxy settings 之后点击check connection。弹出输入框,在输入框内输入http://start.spring.io或者是https://start.spring.io 点击ok,直到弹出connection successful。这时就可以再次回到创建项目的步骤了。原创 2021-06-30 11:17:19 · 4762 阅读 · 6 评论 -
解决java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have availa
解决java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: xxx-xxx-xxx小弟第一次发博客,不喜勿喷 各位大佬你们,最近在接触微服务项目,在运行的过程中遇到许多问题,第一次写博客,就发一个比较简单的,有什么写错的地方望大佬们指点一下,好及时更改 直接上图 从报错中能够很明显的看到,我这里显示的是does not转载 2021-05-19 15:29:35 · 5839 阅读 · 0 评论 -
IDEA错误:SpringBoot启动提示找不到或无法加载主类 解决方法
参考连接:添加链接描述原创 2021-05-19 11:23:13 · 1112 阅读 · 1 评论 -
maven出现:Failed to execute goal on project ...: Could not resolve dependencies for project ...
1、我的项目结构是一个父项目,多个子项目目录如下: 2、我这里就举个例子,所以应用的也就是core和domain这两个项目。 3、两个项目都继承父项目 4、在模块中domain依赖于core,在core中执行完clean和install之后,本地仓库也存在依赖,但是在domain中进行install就会出现 Failed to execute goal on project ...: Could not resolve dependencies for project ... 这样测错误,最后发转载 2021-05-19 10:44:39 · 887 阅读 · 0 评论 -
异常:This application has no explicit mapping for /error, so you are seeing this as a fallback解决方法
目录 一、错误提示: 二、原因: 三、解决方法1,移动控制层的包: 四、解决方法二,添加@SpringBootApplication(scanBasePackages="controller") 五、汇总可能出现报错的原因: 原因1: 原因2: 原因3: 六、关于eclipse启动springboot报错原因: 运行springboot的时候报错,其他配置都没有问题,看了很久总算找到原因。 ...转载 2021-05-09 20:56:42 · 4769 阅读 · 0 评论 -
springboot报错An attempt was made to call a method that does not exist.
这个问题网上坑太多,花了两三个小时才搞明白~主要是父子依赖版本不一致造成的~例如:我之前的pom文件中的版本如下: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId&g...转载 2021-05-09 14:20:23 · 984 阅读 · 0 评论 -
thymeleaf关闭缓存失败
application.yml配置缓存关闭,不起作用spring: thymeleaf: cache: false解决办法:Edit Configurations,如下图所示设置即可原创 2021-05-06 09:23:38 · 578 阅读 · 2 评论 -
Error resolving template “demo1“, template might not exist or might not be accessible by any of the
tymeleaf入门案例,页面跳转失败!Error resolving template "demo1", template might not exist or might not be accessible by any of the configured Template Resolvers原因: html文件未放置到templates文件夹下解决:html文件放置到templates文件夹下,并且删除之前的html文件...原创 2021-05-06 08:36:24 · 197 阅读 · 1 评论 -
com.netflix.client.ClientException: Load balancer does not have available server for client: goods
畅购商城实现索引库数据导入,访问http://localhost:18085/search/import报错:控制台报错信息如下:com.netflix.client.ClientException: Load balancer does not have available server for client: goods原因:没有启动goods微服务解决:右键运行GoodsApplication即可...原创 2021-05-04 22:29:20 · 343 阅读 · 1 评论 -
Exception in thread “main“ org.csource.common.MyException: item “tracker_server“ in not found
使用Fdfs上传文件,postman发送请求失败。查看控制台,报错信息如下:Exception in thread "main" org.csource.common.MyException: item "tracker_server" in src/main/resources/fdfs_client.conf not found 该异常是表示tracker_server未找到,但看了一下配置tracker_server是存在的,fdfs_client.conf之前用的是相对路径,改为绝对路径原创 2021-04-28 21:24:40 · 763 阅读 · 1 评论 -
idea maven 项目src下的配置文件没有同步至target的解决操作
如果发现maven项目里面src/main/resources下的配置文件或src/main/java下的xml配置文件未能同步至target,首先,要确保src下的文件夹职能划分好,如下图,请注意java, resources这些目录的图标,如果不是这样,请选中后右键->make directory as来指明文件夹用途。 其次是pom.xml,如果pom里面没有配置参数就没问题,如果有,需要将下面这些resource的配置参数加上(需要添加在标签下):<resources>原创 2021-04-28 21:23:40 · 3252 阅读 · 0 评论 -
Postman发post请求读取不到文件的情况
使用Fdfs上传文件,postman发post请求读取不到文件,postman报错信息如下:This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can setup your working directory in Settings.解决方法:File-->原创 2021-04-28 21:22:33 · 10773 阅读 · 4 评论 -
spring笔记-MultiValueMap
即一个键对应多个值,Spring的内部实现是LinkedMultiValueMap(非线程安全)一键多值的使用场景是比较多的,在使用该数据结构之前,通常会自己定义:Map<K, List>可以使用该数据结构进行代替使用。import org.junit.Before;import org.junit.Test;import org.springframework.util.LinkedMultiValueMap;import org.springframework.util.Mult原创 2021-04-26 19:26:06 · 1332 阅读 · 3 评论 -
(已解决)Request execution error. endpoint=DefaultEndpoint{ serviceUrl=‘http://localhost:8761/eureka/}
使用SpringCloud中注册Eureka报错报错主要信息:Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connectCaused by: java.net.Conn原创 2021-04-25 20:43:06 · 7284 阅读 · 3 评论 -
intellij idea配置自己安装的Maven home directory后会自动变为C:/Users/xxx/.m2/wrapper/dists/...
原因是从2020.2版本开始,IDE支持Maven包装器,如果项目配置了Maven包装器,则IDEA会将其用于项目,如果不想从包装器中使用Maven,可以将项目中.mvn/wrapper/下的maven-wrapper.properties从项目中删除即可解决 [原文链接](https://blog.csdn.net/zha6476003/article/details/110292705)...转载 2021-04-25 19:53:50 · 1507 阅读 · 2 评论 -
Spring Boot调用Python脚本
1、准备工作在D盘创建一个python脚本,脚本路径为D:\python\hello.py,脚本内容为print(“Hello World!”)在代码中定义python脚本private static final String PATH = “D:\python\helloWorld.py”;2、Spring Boot调用Python脚本的方法方法一:使用ProcessBuilder,代码如下 @Test public void testMethod1() throws IOExcep转载 2021-04-19 10:50:48 · 5269 阅读 · 0 评论 -
Springboot启动 Cannot invoke “xxx.UserBatchService.xxx“ because “this.userBatchService“ is null
Springboot启动,报错没找到UserBatchService,报错详细信息如下:出错原因:这里只介绍列举我的原因,UserBatchService对象为空,大概率就是没有成功注入,查看注解,发现自己没有加@Sercice。其次,注入两个service,只标注了一个@Autowired注解,正确的做法是每个service分别用一个@Autowired注解。其他:UserBatchService没有成功注入的话,在UserBatchServiceImpl类打断点是进不去的,只有成功注入才能进原创 2021-04-16 14:33:16 · 14351 阅读 · 3 评论 -
SpringBoot: Could not resolve placeholder ‘XXXX‘ in value “${XXXX}“
在做图片上传的时候(springboot+vue,前后端分离),费好大劲解决跨域问题后。然后请求到SpringBoot时,读取配置文件信息时,读取失败抛出异常,报错信息如下:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'picInfoController': Injection of autowired dependencies failed; nested exceptio原创 2021-04-07 22:49:37 · 1186 阅读 · 0 评论 -
Springboot 集成rabbitmq报错 - ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN
https://blog.csdn.net/TT18949344290/article/details/96194409application.properties中修改rabitmq密码为初始密码guest,如果想修改用户名和密码应该在rabitmq中进行原创 2021-04-03 22:23:58 · 8247 阅读 · 4 评论 -
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.springboot.chap
springboot结合mybatis,redis案例,页面打不开,报错信息如下所示:控制台:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.springboot.chapter7.dao.UserDao.getUser原因:当使用IDEA编译器的时候,IDEA编译后默认会把resource下的文件放到target的classpath下,但是src下的只有Java文件编译生成.cl原创 2021-03-31 19:46:54 · 226 阅读 · 1 评论 -
缓存神器——redis初探
Redis在企业开发中通常充当高速缓存的作用,用于保护接口或者数据库。在高并发的场景、分布式场景下也可以充当分布式锁,避免多个JVM进程在同一时间对同一资源进行修改,从而引发非线程安全的问题。一.Redis安装下载链接Redis 支持 32 位和 64 位。这个需要根据你系统平台的实际情况选择,这里我们下载 Redis-x64-xxx.zip压缩包到指定位置,解压后,将文件夹重新命名为 redis。使用时启动服务端和客户端二.Spring中如何使用Redis 在 Java 中与 Redis原创 2021-03-30 20:30:01 · 2653 阅读 · 1 评论 -
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
报错信息如下图所示:原因:maven打包项目时,项目没有加载到yml或者properties文件,请查看自己的pom.xml文件中的packaging。<packaging>war</packaging>如果pom中指定使用war,系统不会自动读取到yml或者properties文件的,需要我们手动配置pom.xml<resources> <resource> <directory>原创 2021-03-29 17:01:10 · 208 阅读 · 0 评论 -
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.1.RELEASE fr
maven项目打包时,出现报错,如下图所示:解决方案:打开maven的setting文件,将阿里云镜像注释掉。原创 2021-03-29 16:03:49 · 498 阅读 · 0 评论 -
in comment after two dashes (--) next character must be > not (position: START_TAG seen ...
报错信息如下图所示:原因:注释错误在两个破折号(-)之后的注释中,下一个字符必须是>不-(位置:start_tag看到…这句话的大概意思是在两个-后面必须是>检查发现第一个注释只有左标签<!–,没有右标签–>,加上右标签,问题解决!...原创 2021-03-29 15:20:46 · 2876 阅读 · 1 评论 -
springboot 启动报错Field XXX required a bean of type XXX that could not be found.
今天自己搭建springboot项目,连接数据库,启动的时候发现报错,如下: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-06-08 14:28:58.065 ERROR 4656 --- [ ...转载 2021-03-18 14:34:44 · 791 阅读 · 0 评论 -
java: 不兼容的类型: java.lang.Class<cn.itcast.config.IoCTest>无法转换为java.lang.String
最近学习《深入浅出SpringBoot2.x》,在案例"装配自己的Bean"中,使用logger打印信息,出现报错:java: 不兼容的类型: java.lang.Class<cn.itcast.config.IoCTest>无法转换为java.lang.String解决方法改为使用LoggerFactory类并把上图第一个圈出的导入文件改为import org.slf4j.Logger;import org.slf4j.LoggerFactory;参考博客...原创 2021-03-16 18:37:40 · 2124 阅读 · 0 评论 -
idea创建一个maven(springboot)项目报错:Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:2.5
今天新建一个Springboot项目,然后出现报错:Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:2.5解决方案:1.本地maven的配置文件和仓库地址不一致参考链接2.配置镜像源因为网络问题导致不能下载插件,那就多配几个镜像。配置settings.xml文件中的镜像: <mirrors> <!-- maven官方镜像 --><mirror><id>mi原创 2021-03-16 17:00:01 · 604 阅读 · 0 评论 -
SpringBoot输出,网页出现乱码
SpringBoot输出,网页出现乱码:解决方案:file->settings->Editor->File Encodings,如下图所示进行设置:修改设置之后,配置文件application.properties中文出现乱码,重新修改后即可正常输出。原创 2021-03-15 11:32:02 · 897 阅读 · 0 评论 -
java.lang.NoSuchMethodError: ‘void org.springframework.core.annotation.AnnotationUtils.clearCache()‘
在做Springboot入门案例(将配置文件的数据注入Bean中),出现错误:java.lang.NoSuchMethodError: 'void org.springframework.core.annotation.AnnotationUtils.clearCache()'解决方案:maven中 spring jar包版本号不统一,改成一致就可以了其实,parent指定了版本,dependency中不用再指定。...原创 2021-03-15 11:22:59 · 976 阅读 · 0 评论 -
spring boot创建入门程序时报错,Failed to read candidate component class: URL...
spring boot创建入门程序打印helloworld时报错如下:复制报错信息去网上找了一些方法试了一下,没有解决。没办法,想起来之前看黑马课程做案例的时候没有报错,只能暴力匹配找错误,发现原因:创建maven工程时,给定组织名称goupId为cn.itacst,但是我在java下...原创 2021-03-14 21:14:58 · 1404 阅读 · 0 评论