一些常见的java错误归类,推荐ctrl+F搜索查询
一. java.lang.IllegalStateException
1.Exception in thread “main” java.lang.IllegalStateException:
Failed to read Class-Path attribute from manifest of jar file:/C:/Users/wo/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.125/aws-java-sdk-core-1.11.125.jar
在路径中读取不到架包,应该是架包没有下载完整。
#解决办法:
删除对应路径下的架包重新导入并下载。
或者删除maven仓库中lastupdate文件
2.严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@614c5515] to prepare test instance [test.MapperTest@35d28b42]
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.context.annotation.internalAsyncAnnotationProcessor’ defined in org.springframework.scheduling.annotation.ProxyAsyncConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor]: Factory method ‘asyncAdvisor’ threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor]: Factory method ‘asyncAdvisor’ threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
#解决办法:
mabatis逆向工程运行两次会导致生成的mapper文件叠加,
而且xml中配置包的扫描最好不要用*,如图而是用列举。