
spring
(.*)释然
这个作者很懒,什么都没留下…
展开
-
spring项目自动注入时提示No qualifying bean of type ‘java.lang.Integer‘
啥玩意,Integer为什么还要提前配置到ioc?,百思不得其解,最终探究其原因是被注入对象所使用的pojo中没有无参构造(好低级的错误),加上即可。原创 2020-09-28 11:04:47 · 1345 阅读 · 1 评论 -
运行spring项目出现{@org.springframework.beans.factory.annotation.Autowired(required=true)}
运行spring项目时出现org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xyz.newtouch.Xxx': Unsatisfied dependency expressed through field 'Xxx'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitio原创 2020-09-28 09:42:38 · 7647 阅读 · 0 评论 -
HttpMessageNotWritableException:No converter found for return value of type: class java.util.HashMap
请求springmvc中的接口时服务端出现24-Sep-2020 20:08:51.902 警告 [http-nio-8080-exec-18] org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.logException Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter found原创 2020-09-24 20:20:08 · 3331 阅读 · 0 评论 -
出现java.lang.IllegalStateException: Cannot create a session after the response has been committed异常
在使用@SessionAttributes注解后销毁session域中的session时出现java.lang.IllegalStateException: Cannot create a session after the response has been committed错误,相关部分代码如下:package xyz.newtouch.controller;import org.springframework.beans.factory.annotation.Autowired;import原创 2020-09-24 12:42:38 · 5698 阅读 · 0 评论 -
项目出现Caused by: java.lang.IllegalArgumentException: ‘dataSource‘ or ‘jdbcTemplate‘ is required
当你看的Caused by: java.lang.IllegalArgumentException: ‘dataSource’ or ‘jdbcTemplate’ is required错误时证明你正在使用spring提供的JdbcTemplate且以继承JdbcDaoSupport的方式进行使用,再且使用的以下方式进行注入:@AutowiredDataSource dataSource;直接使用以上方式进行注入是不合法的,JdbcDaoSupport 是需要一个DataSource 的,请看Jdb原创 2020-09-22 09:49:12 · 2861 阅读 · 0 评论 -
Spring项目出现BeanNotOfRequiredTypeException: Bean named ‘xxxImpl‘ is expected to be of type ‘xxx‘
运行spring项目时出现Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘xxxImpl’ is expected to be of type ‘xyz.newtouch.service.impl.XxxImpl’ but was actually of type ‘com.sun.proxy.$Proxy666(非真实数值)’,原因是自动注入时未正确编写注入时的变量修饰对象,例原创 2020-09-22 00:43:00 · 7220 阅读 · 4 评论