Tomcat 10 升級注意事項


升級到Tomcat 10 的同學請注意,如果原項目中有依賴javax.servlet,需要將該依賴同步更新為jakarta.servlet

以下是原文:

Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*. This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool is under development to aid this process.

jakarta.servlet POM:https://mvnrepository.com/artifact/jakarta.servlet

升級Tomcat 10 后的常見錯誤:

Error during artifact deployment.
一個或多個listeners啟動失敗

java.lang.NoClassDefFoundError: javax/servlet/ServletContext

如果是由於升級Tomcat出現以上錯誤提示,請檢查servlet


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM