自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

youshang520i

脑子不好使。。时间来凑

  • 博客(110)
  • 资源 (5)
  • 收藏
  • 关注

原创 【 -bash: /usr/bin/id: 参数列表过长】

/etc/profile.d/colorgrep.sh:行3: /usr/libexec/grepconf.sh: 参数列表过长/etc/profile.d/vim.sh:行3: /usr/bin/id: 参数列表过长/etc/profile.d/vim.sh: 第 4 行:[: : 期待整数表达式/etc/profile:行31: /usr/bin/id: 参数列表过长

2023-07-12 10:44:58 1646

原创 连接nacos异常[NA] failed to update serviceName: UAT_GROUP@@**-** NacosException: Request Exception

nacos服务连接异常:Server check fail, please check server 10.8.7.152 ,port 9848 is available , error ={}java.util.concurrent.TimeoutException: Waited 3000 milliseconds

2023-04-06 14:38:05 13474 2

原创 下载微信公众号音频

微信公众号获取音频

2022-12-16 16:36:30 866

原创 Spring通过一个注解实现接口幂等

Spring通过一个注解实现接口幂等

2022-11-16 18:05:34 220

原创 Mybatis中数值类型条件语句使用 != ““ 的失效的场景

Mybatis if条件语句中 "" 和 0 对等

2022-08-05 11:12:58 1699

原创 Mac m1 pro启动 UTM 提示异常:qemu-x86_64-softmmu: -netdev vmnet-bridged,id=net0,ifname=3: unsupported ifnam

Mac m1 pro启动 UTM 异常

2022-07-27 16:47:34 671

原创 重温win 10安装(这么久没安装了,TMD连安装一个window都安装了我这么久。。)

需要一个8G+的优盘需要一台正常的电脑(用于制作微PE辅助)我首先参考了一下B站 UP主 的视频采用的是微PE辅助安装在MSDN上面下载了win10的ISO镜像(比较推荐去这下载window系统)我这次安装的是联想笔记本电脑(其他的也类似)上面的准备条件都充足的情况下可以进行下面的操作流程:6. 先确定电脑的BIOS有开启USB作为启动盘启动,在BIOS界面中选择BOOT,将下面的USB设置为enable(联想 Fn+F2)7. 重启电脑,在图标刚刚显示出来的时候 按Fn+F12,进入.

2022-01-22 03:01:01 168

原创 在Spring boot 项目中想要在项目启动完成进行一些操作(CommandLineRunner)

推荐实现CommandLineRunner使用方法:自定义Class 通过@Component标识,如果有多个CommandLineRunner 的实现类,可以通过@Order 去区分优先级比较 @PostConstruct VS 实现CommandLineRunner1. @PostConstruct 在服务器加载Servlet的时候运行,init()之后执行,PreDestroy()之前执行2. 实现CommandLineRunner 在Spring Boot服务启动完成之后执行/**

2021-09-15 17:28:10 117

原创 dubbo升级(com.alibaba.dubbo 2..6.6 升级为org.apache.dobbu 2.7.12) 遇到的问题

dubbo升级(com.alibaba.dubbo 2…6.6 升级为org.apache.dobbu 2.7.12)异常:APPLICATION FAILED TO STARTDescription:An attempt was made to call the method org.apache.curator.framework.api.CreateBuilder.creatingParentsIfNeeded()Lorg/apache/curator/framework/api/Prot

2021-09-13 12:28:51 1965

原创 在Spring-boot使用easy-rules规则执行引擎

在Spring- boot使用easy- rules规则执行引擎使用规则引擎的背景:pom依赖提供测试方法使用规则引擎的背景:在项目中需要使用到用户自定义策略,比如:(订单金额 > 50) && ((用户姓名 contains '张') || ( 用户姓名 contains '王'))对于上面这种格式使用规则引擎在合适不过,自己工作量太大。。并且还会有一些列未知的bug下面开始贴代码pom依赖<properties> <easy.rules.

2021-06-27 17:38:37 3510

原创 服务器日志报错:java.io.IOException: Broken pipe

[ INFO ] [2020-12-14 14:56:49] [b5e9df5d7c052385] [http-nio-8080-exec-6] com.bunnymaicai.operate.common.APILogAspect [55] - SPEND TIME: 602msorg.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipeat org.apache.catalina.conne.

2021-06-27 17:12:39 676

转载 docker-compose 安装mysql报错 chown: changing ownership of ‘/var/lib/mysql/‘: Permi

解决方法连接1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态SELinux status: enabled2、getenforce ##也可以用这个命令检查关闭SELinux:1、临时关闭(不用重启机器):setenforce 0 ##设置SELinux 成为permissive模式 ...

2021-05-05 15:13:36 1665

原创 Java线程(Thread)的生命周期

线程的生命周期 新建(new) 新创建了一个线程对象,但还没有调用start()方法 运行(runnable) java线程中将就绪(ready)和运行中(running),两种状态笼统称为“运行”。线程对象创建后,其他线程调用了该对象的start()方法。该状态的线程位于可运行线程池中。等待被线程调度选中,获取cpu的使用权,此时处于就绪状态(ready)。就绪(ready)状态获取cpu时间片后变成运行中(running)状态 就绪状态(run.

2021-03-29 10:37:47 391

原创 Spring 项目中将resources目录下的.xml文件导入项目中

使用背景:在特殊的业务场景下需要配合.xml文件进行对象操作使用方式:@ImportResource(value = "classpath:/springBean.xml")使用@ImportResource注解将.xml文件导入项目中@ComponentScan(value = {"com.bunnymaicai.boot.kafka"})@SpringBootApplication@ImportResource(value = "classpath:/springBean.xml

2021-02-28 22:56:23 839 1

原创 Spring boot读取自定义的配置文件

比如我在项目中的resources目录下新建了一个mysql.properties文件此时需要读取当前文件怎么办???可以使用@PropertySource(value="classpath:/mysql.properties")配合@Configuration 进行配置,通过Environment读取/** * * @author youshang * @date 2021/02/26 16:29 **/@PropertySource(value = "classpath:/mysql

2021-02-26 19:00:28 389

原创 @Configuration和@Conditional同时存在的时候导致@Configuration下的Bean失效

本文涉及到的关注点1. 项目中存在MyConfig和MyConfig2这两个本文中是实验对象2. 自定义OnBeanCondition 实现Condition ,通过特定条件执行特定的需求3.Mybean和Mybean2 充当本文中的路人甲,乙4.ConfigurationCondition充当本文中的幕后 King5.项目结构目录,扫描的也是启动文件的当前目录1. 咋们先来看看两个实验对象import com.youshang520i.demo.LocalCond..

2021-02-26 18:08:18 1105 1

原创 关于Spring @Configuration注解的full和lite模式导致事务没办法回滚

1.先说说在使用这个注解的时候遇到的问题吧!!!在学习Spring transaction的时候想要实现遇到报错然后回滚,结果总是回滚失败!!最后请求大佬支援看到了我的傻逼问题我先说说我的傻逼问题,我把@Configuration写成了@Configurable 然后在代码中使用的是:@Configurable//这是错误的 应该改成@Configuration@ComponentScan("com.youshang520i")@EnableTransactionManagement@M

2021-02-25 18:10:57 286

原创 Spring 源码中的重点注解(日后会经常更新)

@EventListener注解使用的底层实现类:EventListenerMethodProcessor

2021-02-20 18:14:14 111

原创 Mac构建Spring Boot 源码

报错信息:1.[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project spring-boot-test-support: Compilation failure[ERROR] No compiler is provided in this environment. Perhaps you are runnin

2021-02-03 15:41:27 261

原创 Spring 使用 AopConfigUtils.registerAutoProxyCreatorIfNecessary(registry); 注册代理

原先有问题的代码自定义注解@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.TYPE)@Documented@Import(RateLimiterImportBeanDefinitionRegistrar.class)public @interface EnableRateLimiter { /** * 扫描路径 * @return */ boolean proxyTargetClass

2020-12-21 18:58:08 495

原创 Spring源码工具收集

根据你传进来的basePackage路径获取当前路径下面的所有classString basePackage = "com.youshang520i";//拼接成指定的表达式:classpath*:com/youshang520i/**/*.classString packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + resolveBasePackage(basePackage) + '/' + t

2020-11-25 16:18:51 177

原创 Spring 使用自定义注解 + Cglib + RateLimiter进行限流操作

当前项目的作用,可以生成一个对应的Jar包丢进项目中,然后引用对应的注解@EnableRateLimiter 表示全局开启 限流,在接口上面使用@RateLimiter 添加对应的参数实现限流操作有什么问题欢迎讨论[email protected]:liaojuhui/spring-cglib-ratelimiter.git...

2020-11-11 17:26:19 266

原创 apache-sqoop 1.4.6 搭建总结

准备工作:1.linux 系统,Java 使用的是 jdk8.02. 下载apache-sqoop包准备解压下载地址:http://archive.apache.org/dist/sqoop/1.4.6/我下载的是:sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz3. 下载apache-hadoop包准备解压下载地址:http://archive.apache.org/dist/hadoop/core/hadoop-2.7.5/我下载的...

2020-11-10 18:20:34 206

转载 压测测试

压测wrk -t1 -c10 -d2s http://127.0.0.1:8080/access使⽤⽅法: wrk <选项> <被测HTTP服务的URL> Options: -c, --connections <N> 跟服务器建⽴并保持的TCP连接数量 -d, --duration <T> 压测时间 -t, --threads <N> 使⽤多少个线程进⾏压测 -s, --script <S> 指定Lua脚本路径.

2020-10-28 09:19:26 164

原创 git常见提交问题

管理员账号提交 已经存在的项目提示下面的内容(没有权限)[email protected]: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.解决方案:1.https://www.jianshu.com/p/cf41412c4d2d2. .

2020-10-12 11:20:35 155

原创 Spring 项目中报错提示:Invalid bound statement (not found): com.youshang520i.**.**] with root cause

报错信息:2020-09-25 10:23:13.834 ERROR 1539 --- [nio-8008-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache

2020-09-25 11:21:24 6696 3

原创 Linux总结:分析服务器Java程序运行内存异常

测试环境:在服务器上面部署一个Java程序,比如一个项目调用一个接口达到死循环皆可输入top 可以得到下面的界面https://blog.csdn.net/qq_31860135/article/details/83620093上面这篇博客有详细讲解top中的每个参数以及字段找到异常的进程 执行 ps -mp 3303 -o THREAD,tid,time 得到下面的结果接着执行: printf '%x' 3398 jstack 3303 |

2020-09-22 17:51:24 263

原创 Spring cloud 集成 seata 报错信息

2020-09-02 11:30:36.253 INFO 4237 --- [ main] io.seata.core.rpc.netty.RmRpcClient : RM will register :jdbc:mysql://192.168.3.123:3306/seata2020-09-02 11:30:36.254 INFO 4237 --- [ main] i.s.core.rpc.netty.NettyPoolableFactory :.

2020-09-02 11:40:15 5160

原创 Spring boot 通过 @ConfigurationProperties获取属性

假设配置文件的属性是这样的。。spring: cloud: consul: config: enabled: true #enabled 设置config是否启用,默认为true format: yaml #format 设置配置的值的格式,可以yaml和properties prefix: config

2020-07-27 14:56:41 457

原创 电脑有网却打不开网页(能ping通)

报错前我的操作内容1. 使用了vpn然后我断开vpn导致电脑能连网但是访问不了浏览器解决方案:1. 修改网络连接 -> 属性 -> integer 协议版本4的DNS 但是你改了之后你要是换了wifi或者网线怎么办???而且我也没实现2. 看浏览器的报错信息中间有一条检查代理服务器和防火墙 然后跟着步骤走最后发现是我启用VPN的时候默认开启了我的代理服务所以访问不到浏览器。。...

2020-07-26 11:00:42 2868 1

原创 eureka-config-client @Value找不到注册中心的配置信息

报错信息:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eurekaConfigClientApplication': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholde

2020-07-07 18:58:10 460 2

原创 Spring初始化Bean的三种形式

大致使用这三种方式BeanPostProcessor@PostConstruct @PreDestroyinitMenthod DestroyBeanPostProcessor 两个方法 postProcessBeforeInitialization postProcessAfterInitialization@PostConstruct 和 postProcessBeforeInitializationpostProcessBeforeInitialization 在 @PostCons.

2020-06-29 09:21:54 2596

原创 什么是动态代理?Spring中有哪几种实现?有什么区别?

什么是动态代理?Spring中有哪几种实现?有什么区别?答: 1.可以任意的控制任意对象的执行过程,这个对象的执行过程可以由客户端灵活的指定 2. 两种 3.jdk和CGLibJDK 1. JDK version <= 1.6 的时候实现InvocationHandler,重写invoke,自定义初始化对象(method.invoke(Object,args)) 2.利用拦截器(必须要实现InvocationHandler接口)加上反射机制生成一个代理接口的匿名类,在..

2020-06-29 09:02:03 1187

原创 harbor有部分容器启动失败 harbor Error response from daemon: Get https://192.168.0.106/v2/: dial tcp **.***.0.

执行:docker login 192.168.**.***:8888报错提示:harbor Error response from daemon: Get https://192.168.**.***/v2/: dial tcp **.***.0.***:443: connect: connection refused有可能的报错原因:vim/etc/docker/daemon.json没有配置http访问 "insecure-registries"报错提示:Error re.

2020-06-23 16:45:52 4917 4

原创 docker-compose install

curl -L https://get.daocloud.io/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-composechmod +x /usr/local/bin/docker-composedocker-compose --version# 默认会选择docker-compose.yaml|docker-compose.ym.

2020-06-19 09:06:55 226

原创 本地构建Spring源码步骤

1. 通过gitee(码云去拉取代码)

2020-06-19 09:04:38 476

原创 docker + gitlab + harbor + jenkins 搭建自动化部署

1. 安装gitlabdocker-compose.yaml(docker-compose自行了解)version: "3"services: gitlab: image: 'gitlab/gitlab-ce:12.9.0-ce.0' restart: always privileged: true hostname: 'gitlab.com' environment: TZ: 'Asia/Shanghai' GITLAB_.

2020-06-18 11:17:34 1584

原创 java reflection(反射)总结(通过反射获取当前方法的注解以及调用构造方法,方法,属性)

实体package com.youshang.demo.model;import com.youshang.demo.annotation.PersonAnnotation;/** * @author youshang */public class PersonModel { private Integer a; public PersonModel(String name) { System.out.println(name); }

2020-05-22 17:31:26 1251

原创 docker 报错See "systemctl status docker.service" and "journalctl -xe" for details

执行systemctl restart docker报错:Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"网上的解释大部分都是叫你重装docker 还有一部分是说当前docker版本和linux的内核版本不兼容的问题,但是重装docker一定要谨慎啊。。。妈的没多大屁事就是重装重装,要是生产环境那不得害死人?

2020-05-11 18:58:35 4968

转载 docker 拉取镜像报错x509: certificate has expired or is not yet valid

报错截图:报错原因:根据网上的说法是因为虚拟机的时间问题导致的,现在更新虚拟机的时间解决办法:拉取镜像:yum install -y ntpdate ntp修改配置文件vim /etc/ntp.conf配置如下:# For more information about this file, see the man pages# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_

2020-05-08 18:33:18 678

测试demo123.xlsx

将Excel中的内容添加双引号和逗号,方便在数据库或者程序中处理

2019-08-02

里面有mysql基本操作,自定义jsp标签,XML的解析

可以选择查看我的博客,我把文档的内容分了好几次发博客

2018-11-13

JS三级联动网页版的

省市区三级联动。。。。json版的。。修改起来也挺方便的

2018-03-30

JS三级联动

要是要更新省市区的内容,修改city.JS就好了。。。个人感觉挺好用的

2018-03-30

java缩略图

引用包后调用包就好了 package image; import java.io.File; import java.io.IOException; public class Test { public static void main(String[] args) { long start = System.currentTimeMillis(); try { ImageUtil.resizeFix(new File&#40;"D:\\qqͼƬ\\1111.jpg"&#41;, new File&#40;"D:\\qqͼƬ\\99999.jpg"&#41;, 100, 100); long end = System.currentTimeMillis(); System.out.println("success:" + (end - start)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } jar包的源码 package image; /** * 图片缩小算法,方形区域抽样 */ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import org.apache.commons.io.FileUtils; public class ImageUtil { private int width; private int height; private int zoomWidth; private int zoomHeight; private File destFile; private BufferedImage srcBufferImage; public static void resizeFix(File srcFile, File destFile, int width, int height) throws IOException { new ImageUtil(srcFile, destFile, width, height); } public static void resizeFix(BufferedImage bufImg, File destFile, int width, int height) throws IOException { new ImageUtil(bufImg, destFile, width, height); } protected ImageUtil(File srcFile, File destFile, int zoomWidth, int zoomHeight) throws IOException { this.destFile = destFile; this.zoomWidth = zoomWidth; this.zoomHeight = zoomHeight; this.srcBufferImage = javax.imageio.ImageIO.read(srcFile); this.width = this.srcBufferImage.getWidth(); this.height = this.srcBufferImage.getHeight(); if (width <= zoomWidth && height <= zoomHeight) { FileUtils.copyFile&#40;srcFile, destFile&#41;; } else { resizeFix(); } } protected ImageUtil(BufferedImage srcBufferImage, File destFile, int zoomWidth, int zoomHeight) throws IOException { this.destFile = destFile; this.zoomWidth = zoomWidth; this.zoomHeight = zoomHeight; this.srcBufferImage = srcBufferImage; this.width = this.srcBufferImage.getWidth(); this.height = this.srcBufferImage.getHeight(); resizeFix(); } /** * 压缩图片 * * @throws IOException */ protected void resizeFix() throws IOException { if (width <= zoomWidth && height <= zoomHeight) { resize(width, height); } else if ((float) width / height > (float) zoomWidth / zoomHeight) { resize(zoomWidth, Math.round((float) zoomWidth * height / width)); } else { resize(Math.round((float) zoomHeight * width / height), zoomHeight); } } private void resize(int w, int h) throws IOException { BufferedImage imgBuf = scaleImage(w, h); File parent = destFile.getParentFile&#40;&#41;; if (!parent.exists()) { parent.mkdirs(); } ImageIO.write(imgBuf, "jpeg", destFile); } private BufferedImage scaleImage(int outWidth, int outHeight) { int[] rgbArray = srcBufferImage.getRGB(0, 0, width, height, null, 0, width); BufferedImage pbFinalOut = new BufferedImage(outWidth, outHeight, BufferedImage.TYPE_INT_RGB); double hScale = ((double) width) / ((double) outWidth);// 宽缩小的倍数 double vScale = ((double) height) / ((double) outHeight);// 高缩小的倍数 int winX0, winY0, winX1, winY1; int valueRGB = 0; long R, G, B; int x, y, i, j; int n; for (y = 0; y < outHeight; y++) { winY0 = (int) (y * vScale + 0.5);// 得到原图高的Y坐标 if (winY0 < 0) { winY0 = 0; } winY1 = (int) (winY0 + vScale + 0.5); if (winY1 > height) { winY1 = height; } for (x = 0; x < outWidth; x++) { winX0 = (int) (x * hScale + 0.5); if (winX0 < 0) { winX0 = 0; } winX1 = (int) (winX0 + hScale + 0.5); if (winX1 > width) { winX1 = width; } R = 0; G = 0; B = 0; for (i = winX0; i < winX1; i++) { for (j = winY0; j < winY1; j++) { valueRGB = rgbArray[width * j + i]; R += getRedValue(valueRGB); G += getGreenValue(valueRGB); B += getBlueValue(valueRGB); } } n = (winX1 - winX0) * (winY1 - winY0); R = (int) (((double) R) / n + 0.5); G = (int) (((double) G) / n + 0.5); B = (int) (((double) B) / n + 0.5); valueRGB = comRGB(clip((int) R), clip((int) G), clip((int) B)); pbFinalOut.setRGB(x, y, valueRGB); } } return pbFinalOut; } private int clip(int x) { if (x < 0) return 0; if (x > 255) return 255; return x; } private int getRedValue(int rgbValue) { int temp = rgbValue & 0x00ff0000; return temp >> 16; } private int getGreenValue(int rgbValue) { int temp = rgbValue & 0x0000ff00; return temp >> 8; } private int getBlueValue(int rgbValue) { return rgbValue & 0x000000ff; } private int comRGB(int redValue, int greenValue, int blueValue) { return (redValue << 16) + (greenValue << 8) + blueValue; } } 所需要的驱动包 commons-io-1.3.2.jar commons-io-1.3.2.jar + 上面的代码 = 你下载的jar

2018-03-30

空空如也

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

TA关注的人

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