问题1
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context
解决方法:
pom.xml文件中引入一下依赖:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjrt -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.9</version>
</dependency>
非maven的话自行引入以上artifactid标签内对应的jar包
原始解决来源:
问题2:
spring mvc请求出现400错误,语法格式有误
原因是实体类中存在不能直接赋值的字段,比如说Date类型的
解决方法:
在实体字段的date类型前加上
@DateTimeFormat
(pattern=
"yyyy-MM-dd HH:mm:ss"
)
decimal类型前加上@NumberFormat(style = Style.NUMBER)
原文出处: