解决IDEA编译报错:无法访问javax.interceptor.InterceptorBinding 找不到javax.interceptor.InterceptorBinding的类文件
介绍了IDEA编译报错:“无法访问javax.interceptor.InterceptorBinding 找不到javax.interceptor.InterceptorBinding的类文件”的原因和解决办法
·
报错详情:
Error:java: 无法访问javax.interceptor.InterceptorBinding 找不到javax.interceptor.InterceptorBinding的类文件有关详细信息, 请参阅以下堆栈跟踪。com.sun.tools.javac.code.Symbol$CompletionFailure: 找不到javax.interceptor.InterceptorBinding的类文件
报错原因:
在类上使用了@Transactional
注解,使用到了InterceptorBinding
,而该类所在的包未被引入
解决办法:
- 将
@Transactional
注解从类上移到方法上 - 引入
InterceptorBinding
相关依赖(推荐)
<!-- 1.2是使用最广泛的版本 -->
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>1.2</version>
</dependency>
更多推荐
所有评论(0)