报错示例:
1.Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class。
解决方案:
1.确实不存在,加进去就好了
2.类存在,但是spring没有扫描到,注意启动类所在位置,springboot默认扫描的是启动类所在目录下的子包和类,如下图1.2所示。另外可以使用@componentScan这个注解指定扫描的包:示例@componentScan({“”,“”})
1.请参考以下博文
本文发布于:2024-01-27 19:31:54,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17063551162193.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |