解决 call ‘refresh‘ before multicasting events异常

1.引言mysql

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

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.。。。sql

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数据库

2.截图以下微信


3.缘由分析app

这种状况的首要缘由与数据库的链接有问题,也就是咱们在spring配置bean里的dataSource的url链接有问题了。我是这样写的:ssh

  <property name="url">url

   <value>jdbc:mysql://localhost:3306/db_hotel?useUnicode=true&characterEncoding=utf-8</value>spa

</property>.net

4.后来改了这样写:

<property name="url">  <value>jdbc:mysql://localhost:3306/db_hoteluseUnicode=true&amp;characterEncoding=utf-8</value>

  </property>

对的,加了&amp ;就不会报错了,成功运行起了项目!以下所示:


5.成功运行了项目



本文分享自微信公众号 - 源码客栈(liqz6609)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。

相关文章
相关标签/搜索