(二)Sping Boot学习——Sping Boot注意事项 1.springboot默认是扫描的类是在启动类的当前包或者下级包。2.运行报错ERRORAn incompatible version [1.2.33] of the Apache Tomcat Native library is installed, while Tomcat requires version [1.2.34]网上试了很多方法直接重新安装更新版本tomcat。或者下载包把tcnative-1.dll或者tcnative-2.dll复制到jdk的bin目录下。idea中设置jvm启动参数https://blog.csdn.net/only_foryou/article/details/1550032723.遇到Maven部分依赖的包不下载百分之90是仓库配置的问题一定先检查仓库配置国内一般要配置阿里云源。4.在dependencyManagement中配置dependency如配置mysql-connect-java死活不下载或者说不关联进来jar包需要现在dependencies中声明。5.springboot3有兼容支持的druid-spring-boot-3-start的包但是建议使用低版本的包使用最新的容易出问题本次就是报错故障调试好久。我的本来使用当前最新的1.2.23版本各种未知报错。改成1.2.20就好了。另外支持直接在properies中配置不需要手动class配置。6.springboot2和springboot3使用兼容版本的servlet是不一样的。springboot3报错No primary or single unique constructor found for interface javax.servlet.http.HttpServletRequest7.在 Spring Boot 3.x 中Spring Security 默认是启用的。如果添加了spring-boot-starter-security依赖则会自动应用默认的安全配置不需要在securityconfig中配置EnableGlobalMethodSecurity//注意securty6.0之后的版本是默认启用的已经淘汰该注解所有路径都需要身份验证。默认提供了一个自动生成的用户密码日志中可见。默认登录路径是/login。8.方法必须是 public才能让 Spring Security 的 PreAuthorize 正常工作并保证依赖注入正确。9.Spring Boot 4.1.0 默认带logback-core 1.5.34 Spring Boot 会自动管理logback-classic\logback-core