解决ApplicationEventMulticaster not initialized - call ‘refresh‘ before multicasting events异常

解决ApplicationEventMulticaster not initialized - call ‘refresh’ before multicasting events via the context: Root WebApplicationContext异常

我的个人微信公众号 “源码客栈”;分享Java源码和技术文章和Java视频资料,感兴趣可以关注下
在这里插入图片描述

引言

今天我在运行ssh项目时报了如下错误,导致我访问项目页面出现404

1.ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Sat Jul 18 22:34:04 CST 2020]; root of context hierarchy.。。。
2.LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Sat Jul 18 22:34:04 CST 2020]; root of context hierarchy
截图如下

在这里插入图片描述

原因分析

这种情况的首要原因与数据库的连接有问题,也就是我们在spring配置bean里的dataSource的url连接有问题了。我是这样写的:

  <property name="url">
   <value>jdbc:mysql://localhost:3306/db_hotel?useUnicode=true&characterEncoding=utf-8</value>
  </property>
后来改了一下
<property name="url">
   <value>jdbc:mysql://localhost:3306/db_hotel?useUnicode=true&amp;characterEncoding=utf-8</value>
  </property>

对的,加了&amp ;就不会报错了,成功运行起了项目!如下:
在这里插入图片描述

最后成功运行了项目!

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

源码客栈-逍遥游

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值