Spring Boot
We Never say die
因为热爱,所以执着!
展开
-
Java判断当前操作系统是否是Windows
【代码】Java判断当前操作系统是否是Windows。原创 2023-01-20 11:26:11 · 657 阅读 · 1 评论 -
Invalid bound statement (not found): 各种原因
这个问题出现在用xml配置mybatis的mapper时:原因可能有:你的mapper写在了java目录里面。例如下图:这样会出现一个问题,即使你在properties里面配置了 mybatis.mapper-locations= classpath:com/lihaoyu/demo/dao/*.xml,也没有用,因为编译的时候这个xml文件并没有被自动拉到target里面,毕竟编译的是.java文件而不是xml嘛,所以这时候应该在pom文件里面加上...转载 2021-09-13 09:55:02 · 569 阅读 · 0 评论 -
Spring Boot报 Action: Consider the following: If you want an embedded database (H2, HSQL or Derby)...
异常:Spring Boot项目启动不成功报Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following...原创 2021-09-13 09:34:26 · 9139 阅读 · 4 评论 -
Spring Boot单元测试
测试Service 测试API测试Service 在GirlService中添加一个方法,通过Id查询一个女生信息/** 通过Id查询一个女生信息 @Param id @return*/public Girl findOne(Integer id){ return girlRepository.findOne(id);} 在 src/test/java/com 下创建GirlServiceTest 测试类@RunWit...原创 2021-09-13 09:15:27 · 99 阅读 · 0 评论 -
异常:java.lang.IllegalArgumentException:Result Maps collection already contains value for x.ResultMap
该异常大概的展现方式如下:java.lang.IllegalArgumentException: Result Maps collection already contains value for xxx.xxx.xxx.BaseResultMap意思是已经存在这个结果集。这个问题的产生原因可能是:mapper.xml文件中是否存在两个id相同的结果集映射BaseResultMap。解决方法:删除多余的结果集映射BaseResultMap,重新运行项目。...原创 2021-09-13 08:48:39 · 5173 阅读 · 0 评论 -
2021-08-30 使用Spring Initializr快速创建Spring Boot项目
1.点击创建新的项目2.点击Next下一步,按照需求,选择项目类型(Maven或Gradle)、Spring Boot的版本,并填写项目元素据以及所需依赖。然后点击下一步,点击完成,成功创建项目。配置maven,等待jar包下载完成,运行springboot启动类,控制台显示spring即是启动成功。创建一个Controller类,编写一个Hello World运行springboot启动类,在浏览器中访问http://localhost:8080/h...原创 2021-08-30 11:59:47 · 334 阅读 · 0 评论