1. 程式人生 > >解決The hierarchy of the type is inconsistent錯誤

解決The hierarchy of the type is inconsistent錯誤

 

問題:複用java類時報錯:The hierarchy of the type is inconsistent

 

原因:該類或其父類所在的jar包沒有被引入

建議解決方案:從該類的父類開始跟蹤原始碼,找到其所在的jar包並引入專案中

一般是因為 缺少依賴新增上依賴即可

 <dependency>
	<groupId>javax.servlet</groupId>
	<artifactId>servlet-api</artifactId>
	<version>${servlet-api.version}</version>
	<scope>provided</scope>
</dependency>