
java
文章平均质量分 57
Kolde
这个作者很懒,什么都没留下…
展开
-
Line:858 - Application run failed ... nested exception is org.hibernate.service.spi....
ERROR o.s.boot.SpringApplication - Line:858 - Application run failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jp原创 2023-02-26 18:04:15 · 761 阅读 · 0 评论 -
HttpClient connectionRequestTimeout、connectTimeout、socketTimeout
HttpClient connectionRequestTimeout、connectTimeout、socketTimeout 三个参数对比:原创 2022-10-10 17:22:01 · 1373 阅读 · 0 评论 -
java 读文件,写文件,复制文件(使用文件输入输出流)
勿使用:读文件:BufferedReader bf=new BufferedReader(new FileReader(File))因为只能将数据读取到字符数组中public int read(char cbuf[]) throws IOException { return read(cbuf, 0, cbuf.length);}写文件:PrintWriter pw=new PrintWriter(fileName);因为只能写字符数组public vo原创 2021-07-05 19:38:02 · 449 阅读 · 0 评论 -
springboot org.apache.catalina.connector.ClientAbortException: java.net.SocketTimeoutException:null
问题:httpclient 向sringboot写的服务端上传文件,上传xiao原因:解决:参考:原创 2021-06-17 20:57:14 · 7546 阅读 · 1 评论 -
java计算md5 文件(File)、字符串(String)、输入流(InputStream)、资源(Resource)
1.Filepublic String getFileMD5(File file){ //Create checksum for this file //File file = new File("c:/temp/testOut.txt"); //Use MD5 algorithm MessageDigest md5Digest = null; try { md5Digest = MessageDigest.getInstanc...原创 2021-06-16 19:29:57 · 4061 阅读 · 0 评论 -
Request processing failed;nested exception is java.lang.*
问题:2021-05-21 20:05:06.548 default [http-nio-0.0.0.0-18005-exec-6] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Line:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; ne原创 2021-05-28 21:58:48 · 4052 阅读 · 0 评论 -
spring boot 获取 http 请求的数据出错,获取RequestBody数据出错
问题:在用户有大量http请求的时候,springboot 通过 Controller 获取 http 上传的数据,获取 http body 中 的数据,发现http body 中的数据与用户上传的http body中的数据不一致,通过分析发现,使用tcpdump 在网卡捕获的数据包还原出来的http body中的数据与用户上传的数据一致,与springboot获取的 http body 中 的数据不一样。说明数据在从网卡传输到springboot 过程出错。原因:spring b...原创 2020-11-19 22:44:19 · 1261 阅读 · 0 评论 -
用户接入次数、成功请求、业务量等统计方案
1.每次接收到用户请求,在处理完业务逻辑后,将用户业务量记录数据库问题:每次请求过来都会操作一次数据库,频繁操作数据库,造成数据库压力过大; 每次请求过来都会操作一次数据库,会影响业务逻辑接口的性能,造成响应时间过长; 业务逻辑程序和业务量统计程序不解耦。2.每次接收到用户请求,在处理完业务逻辑后,将用户业务量记录redis问题:每次请求过来都会操作redis,频繁操作redis,会造成redis压力过大; 每次请求过来都会操作一次redis,会影响业务逻辑接口的性能,造成响应时间过原创 2020-11-05 10:50:18 · 1096 阅读 · 0 评论 -
HttpClient 请求出错 java.net.SocketException: Unexpected end of file from server
1.错误内容:2020-08-07 14:44:31.563 default [http-nio-0.0.0.0-8005-exec-1] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Line:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing fail原创 2020-08-07 18:03:26 · 21500 阅读 · 0 评论 -
nested exception is java.net.SocketException: Software caused connection abort: recv failed
问题:使用httpClient连续请求Server服务时候,第一次成功,第二次失败,第三次成功,依次交替成功失败。报错:ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exceptio.原创 2020-06-12 19:55:03 · 3111 阅读 · 0 评论 -
Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/LocalTime at **.main
问题:运行程序: java hello/HelloWorld出现错误:Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/LocalTime at hello.HelloWorld.main(HelloWorld.java:7)Caused by: java.lang.Class...原创 2019-02-13 17:35:15 · 1345 阅读 · 0 评论 -
Centos 7 安装与使用 mysql && mysql 基本命令
转自:https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7IntroductionMySQL is an open-source database management system, commonly installed as part of the popular LEMP(L...转载 2019-02-15 19:28:56 · 447 阅读 · 0 评论 -
Error: Could not find or load main class ***
问题:javac 编译完源码 ,执行 java Mainclassname 报 “Error: Could not find or load main class ***”错误原因:运行程序无法找到主类,可能是没有写完整的主类名字(需要完整包名)或者主类名字写错(不是写的主类的名字而是写的文件名),也可能是没有指定类路径的目录。解决方法1:java -classpath...原创 2019-01-29 18:48:47 · 91423 阅读 · 1 评论 -
Java从控制台获取数据的方法
java控制台读取数据转载 2017-06-13 22:01:53 · 2077 阅读 · 0 评论