Initializing Spring root WebApplicationContext

本文记录了一次Spring项目启动过程中遇到的问题,启动过程卡在了Initializing Spring root WebApplicationContext阶段,最终发现是因为数据库连接配置错误导致。文章分享了问题排查的过程及解决思路。
 某日,再次启动项目,spring一直停在这一句: 

Java代码  收藏代码
  1. Initializing Spring root WebApplicationContext  


就这样,一直不动,随便你等多久,就是不会往下走半步,网上搜了一堆,全是些没用的东西,你抄我我抄你,突然,项目组里其他成员跟我说数据库的IP 和端口变了,我擦,是不是这里,一看,果然是因为这个。 
    在这里我真忍不住想说两句,连不上数据库,你spring的异常能不能报的人性化一点,就一个 Initializing Spring root WebApplicationContext,鬼知道你当前到底在干嘛呀,也望其他碰到我这问题百思不得其解时想想可能是数据库连接上的问题,搞了半天,浪费我时间。 
24-Jun-2025 15:56:38.232 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath 24-Jun-2025 15:56:38.353 淇℃伅 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext 24-Jun-2025 15:56:39.661 涓ラ噸 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart 寮傚父灏嗕笂涓嬫枃鍒濆鍖栦簨浠跺彂閫佸埌绫荤殑渚﹀惉鍣ㄥ疄渚�.[org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminMapper' defined in file [C:\Users\Administrator\Desktop\adopt-master\out\artifacts\adopt_war_exploded\WEB-INF\classes\club\dao\AdminMapper.class]: Cannot resolve reference to bean 'sqlSessionFactoryBean' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactoryBean' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is com.baomidou.mybatisplus.exceptions.MybatisPlusException: Error: GlobalConfigUtils setMetaData Fail ! Cause:java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.creat
06-25
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值