日常犯蠢
一盏红烛,一杯烧酒
慢慢摸索,逐步变强。
展开
-
springboot 项目正常启动但是无法访问页面
问题描述使用 idea 启动一个 springboot项目,项目正常运行没有报错,但是访问页面报错404,如下项目介绍项目使用了 jetty,存在web界面,启动类如下public static void main(String[] args) { new SpringApplicationBuilder(App.class).web(true).run(args); SystemService.printKeyLoadMessage();} ```## 解决办法方原创 2021-07-22 18:03:31 · 6895 阅读 · 0 评论 -
2021-06-21无法访问@controller中路径、@Component没有注入bean容器
描述如题。在使用springboot开发时,使用了@Controller注解,结果无法访问对应的url,使用了@Component结果发现bean容器中没有对应的bean实例。解决springboot的启动类和controller类的文件夹应该在同一个文件夹下。碰到这问题一般都是没符合这个要求。检查一下。下面是解决办法1、修改目录结构2、设置扫描路径...原创 2021-06-21 15:49:39 · 2649 阅读 · 0 评论 -
window 子系统 unbutu 无法运行mysql解决方案
问题描述一般在window上都是用虚拟机跑unbutu,后来发现原来window有自带的子系统unbutu。之后便开始使用该子系统了。通过 sudo apt install mysql-server 安装了mysql 服务sudo service mysql start 命令启动服务,一直报错如下也没有其他的错误提示,百度了好久都没发现有用的。解决方法下楼吃饭的时候,脑子突然清醒了,突然想起来这是子系统,会不会是端口占用问题。因为我window上也开了两个mysql,分别用了3306、330原创 2021-03-04 12:37:37 · 106 阅读 · 1 评论 -
linux 报错 参数列表过长
问题描述在修改 /etc/profile 后执行 source /etc/profile 出现错误,截图如下解决方法参考了解决方法 错误原因:是我在 profile中 也 写了 /etc/profile ,都是复制粘贴的错!!! 不过我是通过 notepad++ 解决的通过它连接虚拟机,然后就能选择 /etc/profile 并进行修改了 但是这里有一个问题,因为我之前直接执行了 source /etc/profile 导致我之后执行命令基本都是 参数列表过长,感觉好像是后台进程原创 2020-12-28 14:03:56 · 1638 阅读 · 1 评论 -
shardingsphere 报错 Missing the data source name: ‘null‘
问题描述使用shardingsphere 尝试进行分库时,报错 Missing the data source name: ‘null’详细错误内容org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.lang.IllegalStateExce原创 2020-11-25 15:24:33 · 8734 阅读 · 2 评论 -
springboot 使用@configurationproperties注解后 值为null
添加get和set方法。原创 2020-08-18 22:05:31 · 2201 阅读 · 0 评论 -
java split
今天用到split,然后突然犯蠢了测试代码String s="##2";String f[]=s.split("#");System.out.println(f[1]=="");for(int i=0;i<f.length;i++) System.out.print(f[i]+"-");结果然后我就死机了,明明是空为什么不等呢。试了null," "等等,都是false。百度了半天,没人犯这么低级的错误。。之后好像才想起来,要用equals()理由:两个等号比较的是地址Strin原创 2020-06-16 22:21:56 · 123 阅读 · 0 评论