6月18
一、问题原因
2、原因:后台传过去的json数据用了阿里的fastjson转换,但是解析list中引用的数据时,jvm会自动将其处理为“循环引用”,因此,也就出现了问题{" r e f " : " ref":" ref":".data[0].children[0]"},数据以引用的方式传给前台,前台却无法解析到那段引用的数据。

循环引用就是:当一个对象包含另一个对象时,fastjson就会把该对象解析成引用。

二、解决方案
JSON.toJSONString(list,SerializerFeature.DisableCircularReferenceDetect)

用这种转换方式,把list替换成你要转换的数据就可以了。
6月16
公司windows服务器上部署了很多个内部的java应用,有几个应用做成了服务,发现服务停止了,但是应用还在跑的,可能失控了,不受服务管控了,但是又不能杀掉所有java进程,因为有其他应用在用的,于是想知道正在运行的Java进程属于那个服务 详细信息是什么?

点击在新窗口中浏览此图片
我们可以使用以下windows命令查看java进程信息,可以显示出java命令行参数,查看tomcat等应用的位置

wmic process where caption="java.exe" get processid,caption,commandline /value

点击在新窗口中浏览此图片

3.关于如何查看端口是否被占用,可以根据以下步骤来操作:

3.1开始---->运行---->cmd,或者是window+R组合键,调出命令窗口;

点击在新窗口中浏览此图片
3.2输入命令:netstat -ano,列出所有端口的情况。在列表中观察被占用的端口,比如是49157,首先找到它。

点击在新窗口中浏览此图片

3.3查看被占用端口对应的PID,输入命令:netstat -aon|findstr "49157",回车,记下最后一位数字,即PID,这里是2720。

点击在新窗口中浏览此图片

3.4继续输入tasklist|findstr "2720",回车,查看是哪个进程或者程序占用了2720端口,结果是:svchost.exe
点击在新窗口中浏览此图片
6月16
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python39\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python39\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python39-32\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python38\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python38\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python38-32\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python37\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python37\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python37-32\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python36\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python36\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Users\Heck\AppData\Local\Programs\Python\Python36-32\python.exe
gyp ERR! find Python - "C:\Users\Heck\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
gyp ERR! find Python checking if the py launcher can be used to find Python 3
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (D:\ITL\source\wechat\node_modules\node-gyp\lib\find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (D:\ITL\source\wechat\node_modules\node-gyp\lib\find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\ITL\source\wechat\node_modules\node-gyp\lib\find-python.js:228:18)
gyp ERR! stack     at PythonFinder.execFileCallback (D:\ITL\source\wechat\node_modules\node-gyp\lib\find-python.js:294:16)
gyp ERR! stack     at exithandler (child_process.js:296:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:308:5)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:407:16)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.10586

解决方案:
1. 管理员权限打开cmd,在项目目录下执行:npm install --global --production windows-build-tools

安装成功会在C:\Users\**(电脑用户名)  目录下创建.windows-build-tools文件夹

2. 必须配置环境变量,将C:\Users\**\.windows-build-tools\python27地址添加到path中

3. 重启VSCode或者cmd窗口,我当时打开了2个VSCode窗口,只重启了一个,结果环境变量地址没有生效,又折腾了好久,一定要把所有VSCode窗口关闭重启。

也可以在python官网下载安装,还是要配置环境变量

在npm install安装期间,电脑又提示了安装.net framework4.8
6月16
最近这段时间接手一个旧项目,拉下代码来,点运行Run和调试Debug都没有任何反应,点击之后状态栏没有进度,反而启动和调试按钮变成灰色不可点击的状态,并且console输出控制台没有任何输出。

启动没有状态,无法启动。


Bug描述:

在idea中启动不了springboot启动类,点击运行之后也按钮就变成了灰色的,debug也不行,什么反应都没有,也不提示也不报错,网上查了好多,都不管用。(控制台都不会弹出来,点了和没有点一样)

解决bug:

打开idea,然后点击菜单File->settings->plugins,最后搜索插件找到Groovy这个然后把这个插件后面框中的对勾去掉就可有了,也不知道为啥。

点击在新窗口中浏览此图片

然后重启IDEA

问题解决!!!

6月15
问题现象一:
下载文件达到1min时,报连504 Gateway Time-out接超时。

解决方法:
nginx反向代理默认是60s超时,大文件下载超过了阀值,可以指定超时时间:      

        location /api {
                        proxy_pass http://127.0.0.1:8081;
                        # nginx跟后端服务器连接超时时间
                        proxy_connect_timeout 300;

                        # 后端服务器数据回传超时时间
                        proxy_send_timeout 300;

                        # 连接成功后,后端服务器响应超时时间
                        proxy_read_timeout 300;
                        proxy_set_header Host $host:$server_port;
                }

问题现象二:
通过nginx反向代理下载失败,但是直接通过端口下载正常。

解决方法:
可能是nginx缓存区限制问题,禁用缓存即可。
proxy_pass http://127.0.0.1:5002;
proxy_redirect default;
proxy_buffering off;
6月14
1.在gitlab上找到你要回滚的那个版本 ,复制那次提交的id

点击在新窗口中浏览此图片

2.输入指令,回滚到指定的版本

git reset --hard 复制的id


3.推送到远端(强推)

git push -f origin master
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]