自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(59)
  • 资源 (6)
  • 收藏
  • 关注

原创 记录一下springboot(2.2.3.RELEASE)+elasticsearch6.2.2遇到的问题

解决方法:新建一个ElasticSearchConfig类初始化elasticsearchTemplate。* 防止netty的bug。

2024-03-30 09:23:23 949

原创 logstash-6.2.2安装logstash-filter-convert失败

在网上找了很多方法都没有用:如在install 后面加--no-verify 然后执行命令:问题依然存在。

2024-03-28 11:08:31 267

原创 获取客户端请求IP及IP所属城市

return "局域网";// 处理多级代理情况。// 解决中文乱码问题。

2023-10-27 11:35:08 527

原创 nodejs 使用winston记录日志(打印文件名和行号)

winston记录日志打印文件名和行号

2022-09-17 14:13:13 1553 2

原创 mysql 启动 报socket ‘/tmp/mysql.sock‘错误

socket '/tmp/mysql.sock'错误

2022-08-26 16:13:43 4680

转载 nginx 配置nodejs服务wss 出现错误wss handshake: Unexpected response code: 400

nginx配置nodejs服务 出现错误wss handshake: Unexpected response code: 400

2022-07-28 23:57:07 520

原创 springmvc-websocket 403 错误

springmvc整合websocket 403 错误

2022-07-27 10:45:18 854

转载 arthas常用命令

【arthas】 arthas命令记录_mb5fdb1365b75a0的技术博客_51CTO博客

2022-05-23 11:06:47 96

转载 【JVM】线上应用故障排查

一个应用占用CPU很高,除了确实是计算密集型应用之外,通常原因都是出现了死循环。根据top命令,发现PID为28555的Java进程占用CPU高达200%,出现故障。通过ps aux | grep PID命令,可以进一步确定是tomcat进程出现了问题。但是,怎么定位到具体线程或者代码呢?首先显示线程列表:ps -mp pid -o THREAD,tid,time找到了耗时最高的线程28802,占用CPU时间快两个小时了!其次将需要的线程ID转换为16进制格式:.

2022-05-20 11:23:19 221

原创 Unable to open socket file: target process not responding or HotSpot VM not loaded

[root@zdev195 ~]# top -Hp 26177top - 09:20:10 up 19 days, 15:29, 3 users, load average: 0.00, 0.01, 0.05Threads: 87 total, 0 running, 87 sleeping, 0 stopped, 0 zombie%Cpu(s): 4.5 us, 0.0 sy, 0.0 ni, 95.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 s...

2022-05-20 10:25:48 14518 1

原创 ParseException line 8:13 mismatched input ‘(‘ expecting ) near ‘int‘ in create table statement

第一次使用hive命令 执行hql脚本建表:hive -f test.hql use odl; drop table if exists odl.T_TEST; CREATE TABLE odl.T_TEST ( id char(24) , store_score decimal(3,1) , store_lable varchar(100) , range_id varchar(50) , sales_num int(1) , ...

2022-04-27 15:33:07 5129

原创 com.alibaba.datax.common.exception.DataXException: Code:[ESWriter-03]

记录一下学习datax把mysql数据存入es遇到的问题 2022-04-18 10:15:53.417 [job-0] ERROR JobContainer - Exception when job run com.alibaba.datax.common.exception.DataXException: Code:[ESWriter-03], Description:[mappings错误.]. - org.apache.http.client.ClientProtocolE...

2022-04-18 12:05:28 5461

原创 读取GZ包的内容代码

public static void main(String[] args) { String uri = "https://download.tim.qq.com/msg_history/4/bb2a91f4097a0747ab4a11ec8724b8cef6d20907.gz"; StringBuffer sb = null; try { URL url = new URL(uri); ...

2022-03-24 17:17:27 224

转载 springboot 启动报错

Description:An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration.reactorNettyWebSocketClient(GatewayAutoConfi..

2022-01-13 14:33:35 1120

原创 字符串加/解密

@Slf4jpublic class DesUtil { private static final String DES="DES"; private static final String CHARSET_NAME="UTF8"; private static final String KEY = "6666666699999999"; private static final sun.misc.BASE64Encoder BASE64ENCODER = new BAS.

2021-11-04 10:38:52 187

转载 SpringMVC重定向隐藏url参数

1. 传参: 以字符串的形式构建目标url, 可以使用 query variable的格式拼url. 取参: @RequestParam()来fetch2. 传参: redirectAttributes.addAttribute() 加的attr. 取参: @RequestParam()来fetch3. 传参: redirectAttributes.addFlashAttribute() 加的attr. 取参: @ModelAttribute()来fetchSpring MVC 3.1版本.

2021-11-02 18:03:23 757

原创 替换xxx.jar的class文件命令

1、在xxx.jar包的同级目录创建需要替换class文件的存放目录 (注:目录要和jar里面的目录一致)mkdir -p BOOT-INF/classes/com/sb/ws/et/access/aopBOOT-INF/classes/com/sb/ws/et/access/common/2、替换jar -uvf springboot-websocket-access-0.0.1-SNAPSHOT.jar BOOT-INF/classes/com/sb/ws/et/access/ao...

2021-10-27 10:51:57 121

原创 在SpringBoot中的使用RabbitMQ

1、pom文件引入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId></dependency> 2、在application.properties定义队列名和交换机名 spring.rabbitmq.host=192.168.

2021-09-27 18:09:13 172

转载 BlockingQueue详细介绍

https://www.iteye.com/blog/wsmajunfeng-1629354主线程暂停,子线程先执行:https://www.cnblogs.com/lixin-link/p/10998058.html

2021-09-02 16:25:47 63

原创 Caused by: org.elasticsearch.index.query.QueryShardException

org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:274) ~[elasticsearch-6.4.3.jar!/:6.4.3] at org...

2021-08-05 09:51:02 1279 1

转载 org.elasticsearch.cluster.block.ClusterBlockException: blocked by

org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state处理方法:https://blog.csdn.net/wyz0516071128/article/details/109131844

2021-08-04 09:34:29 878

转载 springBoot +Elasticsearch (Caused by: java.lang.IllegalStateException: availableProcessors is alrea)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availabl

2021-07-08 11:37:39 267

转载 elasticsearch 启动失败(javax.management.MBeanTrustPermission“ “register“)

Exception in thread "main" 2021-06-24 10:20:37,882 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.2021-06-24

2021-06-24 12:02:39 508

原创 SpringBoot+webSocket+echarts K线图(自动更新)

1、前端代码

2021-06-05 17:24:56 1147

转载 2021-05-26

springboot+websocket+redis搭建一、在pom.xml文件中添加<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> <version>2.2.10.RELEASE</version></dep

2021-05-26 18:27:40 471

转载 com/fasterxml/jackson/databind/ObjectMapper

项目引用<dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>2.10.4</version> </dependency>报错误信息:nested exception is java.lang.NoClass...

2021-03-06 17:11:41 6221 1

原创 2021-03-06

Spring+Redisson实现分布式锁1、在pom文件引入相关依赖 <spring.version>4.1.5.RELEASE</spring.version> <!--redisson--> <dependency> <groupId>org.redisson</groupId> <artifactId>rediss...

2021-03-06 15:03:59 65

原创 2020-10-23

springboot 整合mongoDB遇到的问题The dependencies of some of the beans in the application context form a cycle出现此问题的原因是多个类有初始化MongoTemplate导致 : @Autowired private MongoTemplate mongoTemplate;解决办法:加上延迟加载@Lazy处理方法: 在 @Autowired @Lazy...

2020-10-23 08:58:05 146 1

原创 JAVA post请求

String params = "userId=XXX&name=NNNNN";String responseString = "";try{ //打开连接 URL url = new URL(apiUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRe...

2020-07-04 14:55:10 3261

原创 springboot 启动失败 :Failed to configure a DataSource: 'url' attribute is not specified and no embedded

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2020-03-24 14:02:56.147 ERROR 11364 --- [ main] o.s.b.d.LoggingFailureAnalys...

2020-03-24 14:08:16 118

原创 Could not initialize class com.alibaba.dubbo.config.spring.ReferenceBean

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'carManagementService': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could n...

2020-03-24 11:39:50 4885 1

转载 Dubbo Failed to save registry store file, cause: Can not lock the registry cache file

java.io.IOException: Can not lock the registry cache file C:\Users\prgma42\.dubbo\dubbo-registry-192.168.28.75.cache, ignore and retry later, maybe multi java process use the file, please config: dubb...

2019-11-27 12:00:44 465

原创 linux关闭防火墙命令

1:查看防火状态systemctl status firewalldservice iptablesstatus2:暂时关闭防火墙systemctl stop firewalldservice iptablesstop3:永久关闭防火墙systemctl disable firewalldchkconfig iptables off4:重启防火墙...

2019-10-15 11:15:26 286

转载 java敏感词过滤

package cn.swfilter.util; import java.util.*; /** * 敏感词处理工具 - DFA算法实现 * * @author sam * @since 2017/9/4 */ public class SensitiveWordUtil { /** * 敏感词匹配规则 */ public static final int MinMatchTYpe = 1; /...

2019-08-02 19:52:35 168

原创 输入框只能输入正整数

<input type='text' onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" onKeyPress="if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnV...

2019-06-13 14:19:39 497

原创 mongodb 批量更新内嵌数组里面的内容

Criteria criteria = Criteria.where("comments.is_read").is(2).and("_id").is(new ObjectId("5cf642b95843667a86c8a6b5")); Aggregation cAggregation = Aggregation.newAggregation( ...

2019-06-05 10:56:02 1605

原创 mongodb 内嵌数组分组查询

mongodb 内嵌数组分组查询(数据结构)java 代码:Aggregation aggregation1 = Aggregation.newAggregation( Aggregation.unwind("fnLikes"), Aggregation.match(Criteria.where("user_id...

2019-06-04 19:48:12 2060

转载 mongoTemplate 批量更新数组里面的值

try{ Criteria fnLikesCriteria = Criteria.where("fnLikes.isRead").is(0); Criteria commentsCriteria = Criteria.where("comments.isRead").is(0); ...

2019-06-04 12:23:35 5109 1

原创 前端js通过nginx访问WS服务

nginx.conf 配置文件#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { work...

2019-05-09 16:49:07 746

原创 ws 通过nginx代理访问报'Connection' header value must contain 'Upgrade'

socket.io.js:8 WebSocket connection to 'ws://192.168.*.*:8080/socket.io/?EIO=3&transport=websocket&sid=1Zpa4PHegBd3VH1-AAAt' failed: Error during WebSocket handshake: 'Connection' header value...

2019-05-06 11:39:15 1147

java获取客户端IP及IP归属地

java获取客户端IP及IP归属地

2023-10-27

用IDEA工具实现springmvc+websocket长链接

springmvc+websocket实现简单的聊天功能 spring版本:4.2.5.RELEASE tomcat版本:8.5.8 IDEA:2017

2022-08-01

mybatis-generator-class-tools.zip

mybatis自动生成数据库表字段对应的实体类

2021-02-04

school-parent.zip

初学springboot+mybatis+mysql+dubbo+zk整合,便于后期深入学习用IDE整理一个demo,主要学习springboot的注解和配置

2019-12-27

nodejs-log4j demo

本人是初次使用nodejs开发,在开发中用到日志log4j,整理一个demo对以后在开发时可以参考,也希望对刚学nodejs使用日志的初学者有帮助。

2018-07-27

bootstrap日期控件

bootstrap日期控件demo

2017-07-24

springaop拦截controller日志

springaop拦截controller日志

2017-06-07

空空如也

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

TA关注的人

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