![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot干货
YaXinShi
相逢即天涯,相伴自心间
展开
-
SpringDateJpa — findOne()方法报错问题以及getOne()
问题描述: 首先用的SpringDataJPA的1.51版本,可以使用findOne()方法根据id查询然后我使用了2.0.1版本,发现findOne()方法报错了,不能用来当作根据id查询了。当使用findById(ID)进行查询的时候,页面使用Thymeleaf接收Controller出过来的数据的时候,页面接收失败。解决办法:使用findById(id).get()来进...原创 2019-07-08 12:20:56 · 386 阅读 · 0 评论 -
缓存注解出错 nested exception is java.lang.ArithmeticException: / by zero] with root cause java.lang.Arit
/*@CacheEvict:缓存清除key:指定清除的数据allEntries=true:指定清除这个缓存中所有的数据beforeInvocation=flase:缓存的数据是否在方法之前执行 默认代表是在方法之后执行 */@CacheEvict(value = "emp" /*,key = "#id",allEntries=true*/)public void de...原创 2019-07-17 18:55:53 · 1325 阅读 · 0 评论 -
关于SpringBoot里的缓存注解@Cacheable没有缓存上方法数据,执行方法还要从数据库中查询的问题
关于缓存注解没有缓存上方法数据,执行方法还要从数据库中查询的问题解决办法之一:@EnableCaching很多时候大家看视频学习的时候比较粗心,记得在主类入口里面加上这个注解...原创 2019-07-17 18:30:05 · 2020 阅读 · 0 评论 -
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corres
解决办法这个标准的语句错误,检查sql语句原创 2019-07-17 17:57:32 · 714 阅读 · 0 评论 -
receive接收消息方法.lang.NullPointerException at com.amqp.Springboot02AmqpApplicationTests.receive(Spring
在使用Rabbitmq的时候,写的一个接收消息的方法报这个错原因为:消息接收一次就完了,再执行当然错啦,为空原创 2019-07-23 13:19:10 · 328 阅读 · 0 评论 -
数据库错误 Table 'highmysql.myemp' doesn't exist
这个错误大家翻译过来,意思为当前表不存在,这样,就要去检查自己sql语句是不是表名写错了,多看几遍!原创 2019-07-16 10:56:33 · 663 阅读 · 0 评论 -
There was an unexpected error (type=Internal Server Error, status=500). ### Error updating database.
There was an unexpected error (type=Internal Server Error, status=500). ### Error updating database. Cause: java.sql.SQLException: No value specified for parameter 5 ### The error may exist in com/shi...原创 2019-07-15 15:11:57 · 4802 阅读 · 0 评论 -
我写的一个SpringBoot自定义的Starter(启动器)的依赖,欢迎有需要的伙伴坐标拿去使用
<!--引入自定义的starter--> <dependency> <groupId>com.shiyaxin.starter</groupId> <artifactId>spring-boot-starter</artifactId> ...原创 2019-07-10 18:34:59 · 515 阅读 · 0 评论 -
ava.lang.IllegalArgumentException: At least one base package must be specified at org.springframewo
错误原因是这样的:没有在主函数的类中对Mapper层进行扫描解决:在主函数上加上对mapper层的扫描MapperScan注解原创 2019-07-14 21:52:28 · 716 阅读 · 0 评论 -
SpringBoot整合JPA错误 No default constructor for entity解决方法
错误信息:No default constructor for entity: org.tongda.busonline.schedule.domain.DhMdispatchcommandExt【原因】The no-argument constructor, which is also a JavaBean convention, is a requirement for all per...原创 2019-07-08 15:42:18 · 1272 阅读 · 0 评论 -
java.lang.Exception: No tests found matching Method receive(com.shiyaxin.amqp.Springboot02AmqpApplic
**解决方案:**我是在我测试类写的一个方法上面忘了加@Test这个注解,加上就ok原创 2019-07-23 11:31:34 · 366 阅读 · 0 评论