Bootstrap

SpringBoot 异常:Target object must not be null

 使用JSON格式请求时,添加@RequestBody注解映射实体类

.16:59:02.449 [http-nio-8081-exec-2] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Target object must not be null; nested exception is java.lang.IllegalArgumentException: Target object must not be null] with root cause 
java.lang.IllegalArgumentException: Target object must not be null
	at org.springframework.util.Assert.notNull(Assert.java:193)
	at org.springframework.beans.AbstractNestablePropertyAccessor.setWrappedInstance(AbstractNestablePropertyAccessor.java:195)
	at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:153)
	at org.springframework.beans.AbstractNestablePropertyAccessor.setWrappedInstance(AbstractNestablePropertyAccessor.java:183)
	at org.springframework.beans.AbstractNestablePropertyAccessor.<init>(AbstractNestablePropertyAccessor.java:122)
	at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:103)

 

转载于:https://my.oschina.net/pipimao/blog/1863848

;