- 博客(17)
- 收藏
- 关注
原创 nginx -t 一直报错unknown directive “user“ in /usr/local/nginx/conf/nginx.conf
原因是文件编码有问题:打开文档编辑成UTF-8即可。
2025-01-16 14:39:38
224
原创 java 将一段内容写成文件形式
String certFileContent = "" + "-----BEGIN CERTIFICATE-----\n" + 地方的付付过过过过或或或或+ "-----END CERTIFICATE-----";String cerStr ="/cert/"+userName+".cer";FileUtils.write(new File(cerStr), certFileContent, StandardCharsets.UTF
2023-05-24 15:06:53
141
原创 网络文件转流
URL url = new URL(urls);HttpURLConnection conn = (HttpURLConnection) url.openConnection();conn.setRequestMethod("GET");conn.setConnectTimeout(5 * 1000);if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { InputStream inputStream = conn.getIn
2023-05-24 14:57:13
197
原创 Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded dataso
springBoot 报错“Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.”原因是缺少配置参数
2020-12-08 10:19:17
151
原创 多域名访问同一个项目
<Host name="www.xxxx.com" appBase="webapps" unpackWARs="false" autoDeploy="true"> <Alias>www.xxxx.com</Alias> <Alias>xxxx.com</Alias> <!-- 设置默认项目名称 --> <Context path="" docBase="ProjectName" reloadable="true" /> &l
2020-10-29 11:03:51
255
原创 linux 下日志分割
按照字节大小进行分割split -b 2m mgr-0815.log -d newfile_ --verbose![以每个文件2mb分割,]
2020-08-15 18:08:48
189
原创 MySQL 自连接 update
UPDATE `user` AS uINNER JOIN ( SELECT id FROM `user` ) AS u1ON u.id = u1.id SET u.parent_id = u1.id WHERE u.parent_id = 0;
2020-08-01 16:14:53
715
原创 linux下安装字体
一、我们需要先安装相关的软件包。yum install -y fontconfig mkfontscale找到window下的字体把MSYH.TTF复制到/usr/share/fonts/目录下然后建立字体索引信息,更新字体缓存,使用如下命令:cd /usr/share/fonts/mkfontscalemkfontdirfc-cache字体已经安装完毕。现在我们再来查看微软雅黑字体,是否安装成功,使用如下命令:fc-list :lang=z...
2020-07-10 16:34:57
765
原创 生成的图片黑色底
用这个会显示黑色底BufferedImage bufferedImage = new BufferedImage(x, y, BufferedImage.TYPE_INT_RGB);改成下面:BufferedImage bufferedImage = new BufferedImage(x, y, BufferedImage.TYPE_4BYTE_ABGR);
2020-07-06 16:31:30
352
原创 junit所需jar
junit所需要的jar包hamcrest-core-1.1.jarjunit-4.12.jarhttps://mvnrepository.com/artifact/org.hamcrest/hamcrest-corehttps://mvnrepository.com/artifact/junit/junit
2020-06-29 14:17:25
363
原创 java main验签成功 放在程序中验签失败
调用第三方支付 验签一直失败如果有中文并且第三方支付的加密解密程序中用到了str.getBytes() 方法 就和tomcat运行环境的编码有关了。如果用的是 str.getBytes(charsetName) 方法就与运行环境无关了。改成一下方式 直接验签通过...
2019-07-27 18:03:57
1161
1
原创 服务报错500 Internal Server Error
只要上传图片就失败 找了好久 才发现原来是nginx 所在服务器磁盘满了 ,nginx 日志太大了 占满磁盘解决方法如下:删除日志 然后重新加载配置文件./nginx -s reopen完美解决...
2019-07-23 09:36:07
575
原创 tomcat 启动 java.io.StreamCorruptedException: invalid type code: 3F
org.apache.catalina.session.StandardManager doLoadSEVERE: IOException while loading persisted sessions: java.io.StreamCorruptedException: invalid type code: 3Fjava.io.StreamCorruptedException: inva...
2018-12-24 16:03:57
1599
原创 tomcat 启动很卡
很多人肯定都用tomcat容器来启动项目,但可能有些时候启动时间特别长,甚至达到了几万毫秒至几十万毫秒,下面提供一种优化方式:1、找到jdk的这个文件22、打开文件 将 securerandom.source=file:/dev/random 替换成下面的3、重启tomcat ...
2018-09-30 15:03:37
702
原创 Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
/js/plug/ueditor/jsp/controller.jsp?action=uploadvideo&encode=utf-8 Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)本地测试没问题 放服务器上之后报错 原因:用了ngin...
2018-09-10 19:59:18
342
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人