关于在maven项目中如何添加DB2的坐标的详细,见:https://www.cnblogs.com/zifeiy/p/7918554.html Spring Boot项目中的application.properties文件内容如下: # DB Configuration for DB2 spring.datasource.url=jdbc:db2://localhost:50000/SAMPLE spring.datasource.username=zifeiy spring.datasour…
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2018-10-31 10:42:43:043 [restartedMain] [ERROR] org.springframework.boot.SpringApplication >> Application startup failed java.l…
出现这个问题是springboot和springcloud的版本不匹配. 我此处使用了springboot 2.0.4.RELEASE,springcloud 使用了Finchley.SR2. 修改方法是将springboot 版本改为 2.1.1RELEASE.…
shiro使用redis作为缓存,出现要清除缓存时报错 java.lang.Exception: Failed to deserialize at org.crazycake.shiro.SerializeUtils.deserialize(SerializeUtils.java:41) ~[shiro-redis-2.4.2.1-RELEASE.jar:na] at org.crazycake.shiro.RedisSessionDAO.getActiveSessions(RedisSessi…
我在RestTemplate的配置类里使用了 @LoadBalanced@Componentpublic class RestTemplateConfig { @Bean @LoadBalanced public RestTemplate restTemplate(){ return new RestTemplate(); }}或者 再调用@Autowiredprivate RestTemplate restTemplate;必须使用应用名作为代替ip:端口,http://127.0.0.1:8…
问题:想调用service类中的私有方法时, Method target=clz.getMethod("say", String.class);用Class的getMethod报错Java.lang.NoSuchMethodException. 解决方案:查了下Class的文档,该类下原来有两个方法:getMethod,getDeclaredMethod.看了下说明大概的意思就是getMethod只能调用public声明的方法,而getDeclaredMethod基本可以调用任何类型声…
报错信息如下 java.lang.AbstractMethodError: org.apache.poi.xssf.usermodel.XSSFCell.setCellType(Lorg/apache/poi/ss/usermodel/CellType; 首先项目集成POI进行导入导出的pom文件 注意:最开始我使用的是3.15和3.14,但是会产生上面的报错信息,我这边一直以为是我代码存在问题, 反复修改之后还是存在问题,最后翻墙查了下stackoverflow,感觉出错的原因是poi的版本过…
问题描述 Spring Boot应用(使用默认的嵌入式Tomcat)在上传文件时,偶尔会出现上传失败的情况,后台报错日志信息如下:"The temporary upload location is not valid". 原因追踪 这个问题的根本原因是Tomcat的文件上传机制引起的! Tomcat在处理文件上传时,会将客户端上传的文件写入临时目录,这个临时目录默认在/tmp路径下,如:"/tmp/tomcat.6574404581312272268.18333/work/T…
最近事情比较多,本篇文章算是把遇到的问题杂糅到一起了. 背景:笔者最近在写一个mongo查询小程序,由于建立索引时字段名用大写,而查询的时候用小写. 代码如下: db.getCollection("xxx.aa").find({second_email:"/^mylove_foryou@qq.com/"}) 1200万的数据,第一次执行耗时:43.741秒,这在正式环境肯定是不允许的. 通过查询执行计划,发现并没有使用时索引,导致查询的时候很慢. 笔者在mongo3…
用mybaits 写一个关联查询 查询商品表关联商品规格表,并查询规格表中的数量.价格等,为了sql重用性,利用 association 节点 查询 结果并赋值报错 商品表的mapper文件为GooodsMapper.xml 规格表的mapper 文件为GoodsSpecificationsMapper.xml java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for m…