
疑难杂症特效处方
文章平均质量分 52
记录一些在开发过程中容易出现的错误以及解决方法,避免下次再继续跳坑。
KevinBrain
热爱编程!热爱生活!代码改变世界!一枚喜欢研究各种代码技术,对计算机技术充满好奇心的技术宅。
展开
-
Mybatis-plus| You have an error in your SQL syntax the right syntax to use near ‘LIMIT 0,10‘
一、问题在使用Mybatis-plus自定义SQL语句进行查询时,需要用到分页插件进行分页,Mapper层的方法如下:@Select("select id, title, type_id,user_id, description,update_time,first_picture,views,comment_count from t_blog where update_time BETWEEN #{start_date} and #{end_date} ORDER BY update_time原创 2021-03-25 23:26:07 · 1572 阅读 · 1 评论 -
nginx| centos7.6中使用yum安装nginx1.6(亲测有效)
1.安装依赖使用nginx源码安装时会使用到gcc等编译工具,系统默认的可能缺少或者版本不对应,因此需要安装或升级一下:yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel2.下载Nginx1.6并解压cd /opt/software# 下载Nginx的压缩包wget http://nginx.org/download/nginx-1.16.0.tar.gz# 解压tar -xzf ngin...原创 2021-03-19 22:31:29 · 581 阅读 · 0 评论 -
centos7 | All matches were filtered out by modular filtering for argument: mysql-community-server
问题场景:在尝试使用docker安装自定义centos环境时,使用dockfile文件创建镜像容器,在centos7镜像中使用yum安装mysql5.7。在安装过程中报错:All matches were filtered out by modular filtering for argument: mysql-community-server随后通过查看信息,并且在网上查阅资料最终解决问题。解决方案!!!:先执行:yum module disable mysql再执行:yum in原创 2020-12-10 21:22:02 · 6632 阅读 · 1 评论 -
IDEA| java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context
问题:java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]场景:在搭建springcloud项目时,创建eureka服务提供方时,启动时项目报错:org.spri原创 2020-11-20 16:08:56 · 10744 阅读 · 2 评论 -
springboot| 一种方便移植部署和访问的文件上传方式
引言:在springboot文件上传应用中,用的最多的就是将文件保存到系统的绝对路径中,这种方式对于系统的移植部署很不友好,而且需要更改大量的路径。这里本人总结出一种相对好移植部署的动态文件夹保存上传文件的方式。一、配置springboot文件上传临时文件夹说是临时文件夹,只要我们自定义该文件夹不在系统的临时文件夹如Tmp文件夹就可以永久保存。这里本人将该文件夹定义在和项目同级别的文件夹中uploadTmp中。具体配置如下:@Configurationpublic class Uploa原创 2020-08-17 23:46:52 · 297 阅读 · 0 评论 -
springboot| springboot和redis集群的快速集成
今天在搭建项目时,要使用到redis做相关缓存,本项目用到了6个redis节点组成的redis集群,本文总结了springboot集成redis集群以及配置使用redisTemplate API的步骤。一、添加依赖<!--redis连接池 start--><dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</art原创 2020-07-05 17:30:20 · 250 阅读 · 0 评论 -
centos7| 添加开启自启动服务
在centos7系统中添加自定义开机自启动程序。解决方案:打开/etc/rc.d/rc.local文件,在文件末尾追加要执行的程序即可,例如:#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using th原创 2020-06-28 23:43:43 · 320 阅读 · 1 评论 -
docker| Error response from daemon: Get https://index.docker.io/v1/search?q=win7&n=25: net/http: TLS
Docker镜像报错:Error response from daemon: Get https://index.docker.io/v1/search?q=win7&n=25: net/http: TLS handshake timeout解决方案:1.打开终端,su root 输入密码2.打开 vim /etc/docker/daemon.json(若没有自行创建)3.写入:{ "registry-mirrors":["https://docker.mirrors..转载 2020-06-18 22:24:45 · 2195 阅读 · 2 评论 -
IDEA| Error resolving template [index], template might not exist or might not be accessible by any
报错:Error resolving template [index], template might not exist or might not be accessible by any of the configured.使用环境:使用shpringboot搭建项目时候,后台COntroller返回页面地址报错提示找不到index.html。原因:在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错原创 2020-06-16 10:55:25 · 1353 阅读 · 0 评论 -
代码实现| springboot+mybatis+PageHelper实现Mysql数据分页
第一步:在pom.xml引入PageHelper的依赖 <!--分页插件--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1原创 2020-06-13 16:32:04 · 314 阅读 · 0 评论 -
IDEA| centos Unable to open debugger port(127.0.0.1:60157) socket closed
今天进行项目移植部署,用另一台机器打开IDEA然后通过tomcat启动,结果启动时一直报错:Unable to open debugger port(127.0.0.1:62405):java.net.SocketException"socket closed。网上很多文章介绍出现这个报错的原因是因为端口被占用导致的。不过试着更改了端口以及JMX的端口数依旧无法解决问题,后来查看log日志发现,竟然是linux系统导致tomcat没有运行权限。解决方案:通过linux系统给tomcat文件夹附加权限原创 2020-06-10 14:40:31 · 419 阅读 · 0 评论 -
前端| js动态修改video标签视频不刷新的问题
问题描述:在网页上用<video>标签放一个视频播放器,点击视频目录来自动播放不同的视频。通过js动态生成li,点击li之后更改<video>标签<source>中的src,。代码中的src确实有变化,但是网页中的视频并没有加载新的视频。前端代码如下:<video id="video_player" style="margin: 5px 5%" width="90%" height="400" align="center" controls>原创 2020-06-08 23:37:20 · 4560 阅读 · 1 评论 -
代码实现| springboot+Mybatis注解版轻松集成
springboot集成Mybatis有两种方式,一种是配置xml方式,另一种是使用注解方式,本文主要讲解一下如何轻松快速的实现注解版的springboot+mybatis继承,开发本不易,绕过xml配置文件更健康啊! 关于两个框架的理论部分本文暂时不讲,默认都会,否则也不会搜到这个破文章(嘿嘿!)轻松集成:1、添加pom依赖 <dependency> <groupId>mysql</grou...原创 2020-06-07 15:48:37 · 226 阅读 · 0 评论 -
IDEA| Spring Boot项目中@SpringBootTest测试的时候卡住,一直Resolving Juint-platform-engine/1.6.2........
今天在springboot项目中做单元测试时候用到@Test时,总是卡在加载Resolving Juint-platform-engine/1.6.2........中,然后一直加载不出来,着实让人上火。关键是:还取消不掉!!!!无奈只能强制关闭IDEA软件。查看了网上多种解决方法,我也是挨个都试了遍,就一种方法成功了,因此,在这里写个文为大家总结一下这个坑的各种解决方案,方案千万种,总有一种适合你,愿下辈子没有bug(巴拉巴拉)。解决方案1:(本人服用后效果甚佳)引入以下依...原创 2020-06-07 15:11:09 · 4090 阅读 · 5 评论 -
Centos7| 远程连接vncserver时输入账户密码后闪退
如果系统中安装了anaconda软件的话很有可能是环境变量冲突了。在anaconda中中有个dbus-daemon和/usr/bin中的dbus-daemon重名,因此,很容易造成环境变量的覆盖。解决方法:调整环境变量让anaconda的环境变量在/usr/bin之后即可。命令行显示环境变量: echo /etc/profile修改环境变量:vi /etc/profile刷新环境变量:source/etc/profile...原创 2020-06-01 10:25:32 · 1839 阅读 · 1 评论