只是想用IDEA搭建一個Eureka註冊中心,別人10幾分鐘就搞定的事情,在我這就瘋狂報錯,所以特地來做下記錄。
報錯一、 No qualifying bean of type 'javax.servlet.Filter' available
出現這種情況可能是下面的<relativePath/>
沒有刪除
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
如果不是上面的情況,就可能是SpringBoot與SpringCloud的版本問題。
報錯二、NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
碰到這種錯要仔細往下看
出現了jar包衝突
解決方法:
1、如果是自己手動加的就在pom.xml將去掉,然後Maven --> Reimport
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
2、如果不是自己加的就打開項目,按住Ctrl+Alt+Shift+s
點擊左邊的Modules,在右邊找到衝突的jar包,然後刪掉(最右邊的減號就是刪除)
,同樣Maven --> Reimport。
希望對你有所幫助。。。