異常展示:
Description:
An attempt was made to call the method javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZLjava/lang/String;ZZLjava/lang/String;Ljava/lang/String;)V but it does not exist. Its class, javax.servlet.jsp.tagext.TagAttributeInfo, is available from the following locations:
jar:file:/Users/Macx/repository/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar!/javax/servlet/jsp/tagext/TagAttributeInfo.class
jar:file:/Users/Macx/repository/org/apache/tomcat/embed/tomcat-embed-jasper/8.5.34/tomcat-embed-jasper-8.5.34.jar!/javax/servlet/jsp/tagext/TagAttributeInfo.class
It was loaded from the following location:
file:/Users/Macx/repository/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of javax.servlet.jsp.tagext.TagAttributeInfo
從描述的異常可以猜想出,是jsp-api的jar出現了問題!
思考方向,jar不存在,在網上找了好多個都是說讓把倉庫中的jar删除,從新導入,然後再次下載下傳。
照做之後,依然解決不到問題。
再次分析問題:異常描述中出現了jsp-api,又出現了tomcat,猜想方向,是不是兩者沖突了,懷疑沒有設定provided
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
檢查之後發現,已經了scope,理論上并不應該存在沖突啊?
猜想方向,還是在沖突這裡,應該是配置有問題,各種檢查!
各種比對發現,mac的idea上的tomcat有個這個東西,provided????
為什麼會有這個,取消之後,再次運作之後,解決問題。。。。
分析一下結果:
我在我的jsp-api jar包上加上scope provided,意味着這個jar包隻能在編譯和測試時候使用,當我啟動tomcat的時候,就不會出現沖突了,可是我勾選上了Include dependencies with “Provided” scope之後,它把我的provided也打包進入了tomcat,這樣就會出現了沖突。
個人觀點,歡迎指正!