随笔分类 - debug之旅
摘要:public class StaticTest { public static volatile Integer a=100 ; public static void main(String[] args) throws InterruptedException { new Thread(new C
阅读全文
摘要:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentService': Unsatisfied dependency expressed thr
阅读全文
摘要:resultMap ,association collection 分别根据 type javaType ofType指定的类型来创建相应的实例对象,创建实例对象是根据实体类的无参构造方法。所以说,要使用resultMap,association collection 必须要对应的实体类添加零参构造
阅读全文
摘要:今天在使用Mybatis时遇到了Cannot determine value type from string xxx 原因是数据库中的字段没有和实体类对应。 解决方法有两种: 1.加一个无参构造器。 2.有参构造器的参数的个数,类型应该和实体类一一对应。我这里的原因就是实体类少了一个id属性 我们
阅读全文
摘要:今天遇到一个问题,在Springboot 整合mybatis时,发现没有找到xml文件(mapper)。 org.apache.ibatis.binding.BindingException: Invalid bound statement 我们可以看到在build后的target文件中没有我们的x
阅读全文
摘要:Springboot版本:1.5.9 #问题背景 在一次项目中发现,js,css等静态资源被拦截了,html可以正常访问。看下目录结构: 其中 templates存放html文件,static存放js,css文件,js和css文件被SpringMVC拦截了(404)! #解决方法 ##1 首先由于我
阅读全文
摘要:解决方法: BufferedReader in = new BufferedReader(new FileReader(filename, Charset.forName("utf-8"))); 在new FileReader类对象的时候,使用 FileReader(String fileName,
阅读全文