- 博客(60)
- 资源 (6)
- 收藏
- 关注
原创 单元测试,启动报错:java.lang.NoClassDefFoundError: Could not initialize class org.springframework.beans.facto
处理方法1:设置VM option 大小:-XX:PermSize=256m -XX:MaxPermSize=512m -Xss2m。处理方法2:修改ideaIU-2017.1.4.win\bin\idea64.exe.vmoptions 配置的内存大小。出现此问题原因是内存分配过小导致。
2024-05-23 09:28:26
685
原创 记录一下springboot(2.2.3.RELEASE)+elasticsearch6.2.2遇到的问题
解决方法:新建一个ElasticSearchConfig类初始化elasticsearchTemplate。* 防止netty的bug。
2024-03-30 09:23:23
981
原创 logstash-6.2.2安装logstash-filter-convert失败
在网上找了很多方法都没有用:如在install 后面加--no-verify 然后执行命令:问题依然存在。
2024-03-28 11:08:31
316
转载 nginx 配置nodejs服务wss 出现错误wss handshake: Unexpected response code: 400
nginx配置nodejs服务 出现错误wss handshake: Unexpected response code: 400
2022-07-28 23:57:07
549
转载 【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
237
原创 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
14815
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
5391
原创 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
6253
原创 读取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
240
转载 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
1259
原创 字符串加/解密
@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
209
转载 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
795
原创 替换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
148
原创 在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
183
转载 BlockingQueue详细介绍
https://www.iteye.com/blog/wsmajunfeng-1629354主线程暂停,子线程先执行:https://www.cnblogs.com/lixin-link/p/10998058.html
2021-09-02 16:25:47
70
原创 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
1346
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
920
转载 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
290
转载 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
529
转载 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
488
转载 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
6350
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
77
原创 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
167
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
3285
原创 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
133
原创 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
5058
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
478
原创 linux关闭防火墙命令
1:查看防火状态systemctl status firewalldservice iptablesstatus2:暂时关闭防火墙systemctl stop firewalldservice iptablesstop3:永久关闭防火墙systemctl disable firewalldchkconfig iptables off4:重启防火墙...
2019-10-15 11:15:26
303
转载 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
180
原创 输入框只能输入正整数
<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
508
原创 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
1621
原创 mongodb 内嵌数组分组查询
mongodb 内嵌数组分组查询(数据结构)java 代码:Aggregation aggregation1 = Aggregation.newAggregation( Aggregation.unwind("fnLikes"), Aggregation.match(Criteria.where("user_id...
2019-06-04 19:48:12
2096
转载 mongoTemplate 批量更新数组里面的值
try{ Criteria fnLikesCriteria = Criteria.where("fnLikes.isRead").is(0); Criteria commentsCriteria = Criteria.where("comments.isRead").is(0); ...
2019-06-04 12:23:35
5188
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
762
用IDEA工具实现springmvc+websocket长链接
2022-08-01
school-parent.zip
2019-12-27
nodejs-log4j demo
2018-07-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人