自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

原创 spring cloud eureka 服务启动失败

spring cloud eureka server启动失败spring cloud eureka server启动失败环境: <spring-boot-version>2.3.5.RELEASE</spring-boot-version> <spring-cloud-version>Hoxton.SR8</spring-cloud-version>错误logUnable to start web server; n

2022-03-15 22:03:13 1100

原创 Okhttp3 Basic Authorization笔记

开篇:在调用其他API时候,经常会遇到Authentication问题,今天记录的是如下图所示的一种情况需求:用OKHTTP3工具实现功能先列举网上的大部分案例,写法各不同,但核心写的都是一样的new OkHttpClient().newBuilder().authenticator(new Authenticator()...)// RequestBody.create("{}".getBytes(Charset.forName("UTF-8"))) // 这种写法是因为请求是post,但是pay

2021-07-19 22:43:05 1028 1

原创 Java 批量重命名文件/文件夹,删除指定文件

public class BatchReName { private static String str1 = "你想要删除的内容"; private static String str2 = ""; public static void main(String[] args) { String path = "E:\\Java\\source"; change(path); changeFileName(path); }// 修改文件夹名 private static File

2021-03-23 13:37:26 270

原创 java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFacto

背景:spring boot 2.4.0 +nacos+ES 7.4.2 ,pom添加如下: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency><dependency> <groupId>org.

2021-01-03 22:14:23 6504 2

原创 java.sql.SQLException: Incorrect string value: ‘\xE6\x89\x8B\xE6\x9C\xBA‘ for column

java.sql.SQLException: Incorrect string value: '\xE6\x89\x8B\xE6\x9C\xBA' for column xxxx针对这个问题的处理方案:show variables like 'character%';查看MySQL中character_set_server的字符类型:可能出现的字符集是如下这种:操作:SELECT VERSION();查看数据库版本,以下操作是在5.7版本中测试的,其他版本没有尝试然后修改数据库的字

2020-12-27 22:14:21 2741 4

原创 springboot2.4.0 集成 gateway 解决 跨域问题

问题:Springboot升级至2.4.0中出现的跨域问题。分析:Springboot2.3.5.RELEASE时,我们可以使用CorsWebFilter进行如下设置解决跨域问题。 public CorsWebFilter corsWebFilter() { UrlBasedCorsConfigurationSource configurationSource = new UrlBasedCorsConfigurationSource(new PathPatternParser

2020-12-10 21:25:46 3248 1

原创 spring boot+扫码登录微信

oauth2.0获取token流程微信登录流程微信登录代码需要在https://open.weixin.qq.com注册,并获得开发者资质认证才会给分配appid 和appsecret认证会产生费用微信登录参考文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=e54

2020-06-21 18:52:35 1819

原创 金九银十面试真题

第一部分:1.字符串操作有哪些,有什么区别1).从类的继承关系上来看的话,String和StringBuffer,StringBuilder是没有任何关系的,但是StringBuffer和StringBuilder的继承关系时一样的.2).三个类存储的本质都是一个char类型数组.不同的是String类型的数组长度是3,而另外两个数组的长度都是19且默认值为0.3).String类是不可变...

2019-09-08 20:50:51 186

原创 记一次:unknown character set ' utf8mb4'

这两两天遇到的问题:unknown character set ’ utf8mb4’网上找了好多解决办法都没用,最后实在不行,卸载了之前安装的MySQL,重新安装后就好了。安装的是官网提供的MySQL8.0版本,然后maven依赖中mysql-connector-java版本升级到8.0版本就看了(ps:安装MySQL之前,用的是6.0的测试版数据库,connector用的是5.1.6版本)...

2019-06-23 11:31:41 1264

原创 java.net.ConnectException: Connection refused: no further information

spring boot集成redis后进行测试,发现一直报如下错误:java.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_161] at sun.nio.ch.Soc...

2019-05-29 22:42:57 28125

原创 centos7 使用docker run hello-world报错,无法获取镜像

错误示例:[root@localhost /]# docker run hello-worldUnable to find image 'hello-world:latest' locallydocker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled ...

2019-04-27 14:40:34 1111

原创 集合之JDK1.8的ArrayList源码

在list集合中,ArrayList是最为常见的。通过了解底层代码来进一步了解ArrayList。一、ArrayList的继承关系与属性public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.S...

2019-04-01 23:19:36 78

原创 java面试 之 Map实现不同班级不同学科 分别计算 各班级的各学科成绩

大致思路:1.首先通过Map&lt;Integer, String&gt;迭代获取value值。2.对value值进行判定,然后把想要获取的值存放到list集合中(数组也行)3.对list遍历,获取相对应的值代码如下: public static void main(String[] args) { Map&lt;Integer, String&gt; map =...

2019-03-05 23:13:54 693

原创 Error creating bean with name 'XXXX' defined in file

严重: StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in file [E:\heima\dubbox-web\target\classes\com\itheima\de...

2019-01-24 20:59:14 8278

原创 Linux学习之安装MySQL数据库

一、环境1.CentOS 6.8下编译安装 MySQL 5.6.142.准备好mysql-5.6.14.tar.gz,并且上传至Linux的/opt/目录下二、检查是否安装有MySQL Server 执行命令 rpm -qa | grep mysql 执行结果: bash&gt;: rpm -qa | grep mysql mysql-libs-5.1.73-7.el6.x86_6...

2019-01-07 22:28:08 133

原创 This application has no explicit mapping for /error, so you are seeing this as a fallback.

ERROR 7924 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; neste...

2018-12-18 23:08:55 359

原创 springboot+Redis初次使用

springboot(2.1.1.RELEASE)+StringRedisTemplate的简单使用1.引入pom文件org.springframework.bootspring-boot-starter-data-redisorg.springframework.bootspring-boot-starter-webcommons-langcommons-lang2.0...

2018-12-18 23:01:45 149

原创 springboot整合多数据源

springboot整合多数据源1.在数据库建立两个数据库,如下所示:2.建立springboot项目,添加配置。2.1在pom.xml中,引入以下依赖(使用的是springboot 2.1.1.RELEASE版本) &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;art...

2018-12-13 23:22:21 120

原创 springboot学习:springboot+thymeleaf+gradle(续)

利用gradle来构建springboot+thymeleaf项目

2018-08-25 21:20:31 477 1

原创 springboot学习:springboot+mybatis+MySQL+thymeleaf(二)

本节主要内容是springboot集成mybatis和MySQL,然后来访问数据库,完成从数据库获取数据。1、准备工作。 (创建springboot项目可以参考:https://blog.csdn.net/weixin_42825721/article/details/81517224) 新建一个springboot项目,然后在项目的pom.xml文件中引入如下依赖: ...

2018-08-19 21:08:45 895

原创 springboot学习:springboot+mybatis+MySQL+thymeleaf(一)

一、准备工作 1、有spring基础,同时掌握或者熟悉springmvc。 2、开发准备工作 1)、开发需求:maven、JDK8(本人使用的是这个版本)、idea(eclipse也可以)、MySQL 2)、jdk以及开发工具、数据库的安装不过多讨论。springboot的基于maven进行开发的。不管是idea还是eclipse都需要配置maven环境,maven仓库最好...

2018-08-08 23:04:32 2889 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除