开发框架
Charlie_Peng
这个作者很懒,什么都没留下…
展开
-
JDBC未设置connectTimeout和socketTimeout导致线程挂起
现象:应用服务器到数据库的网络不通;启动应用后应用程序卡在数据库操作的地方;但是一般来京数据库操作都会有超时,如果连不上数据库或者慢查询耗时太久都应该报超时异常才对,为什么hang住不报异常呢?我使用的spring mybatis框架,druid datasource,查看druid 配置并没数据库连接超时或者网络通信超时的配置。排查过程:使用jps -lvm 查看正在运行的java进程ID 找到自己的应用程序id;然后jstack -l 进程ID查看发现工作线程阻塞在了socketRead原创 2020-06-09 10:06:00 · 2285 阅读 · 2 评论 -
spring mybatis整合过程中 mybatis报BindingException Invalid bound statement (not found) : xxx.xxx.xxx.方法名
出现这个问题的原因很明显:mybatis没有在配置文件中找到 接口定义的的方法。一般先检查以下 mapper.xml的namespace要写所映射接口的全称类名。 mapper.xml中的每个statement的id要和接口方法的方法名相同 mapper.xml中定义的每个sql的parameterType要和接口方法的形参类型相同 mapper.xml中定...原创 2018-12-10 11:16:22 · 224 阅读 · 1 评论 -
spring schedule定时任务配置
按照网上的教程 以anotation的方式配置schedule定时任务搞了几天老是报如下错误java.lang.IllegalStateException: Failed to load ApplicationContextat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.lo...原创 2018-12-17 14:06:16 · 1570 阅读 · 1 评论 -
springboot Junit测试 启动报错Could not open ServletContext resource [/xxxxxxx.xml]
找到对应的Configer类发现配置文件的location配置如下:@Configuration@ImportResource(locations = {"magpiebeans.xml"})修改为@Configuration@ImportResource(locations = {"classpath*:magpiebeans.xml"})就ok了问题是...原创 2019-08-06 19:50:37 · 1781 阅读 · 0 评论