0
点赞
收藏
分享

微信扫一扫

若依微服务版在Windows上通过jar包运行业务模块时提示:Failed to determine s suitable driver class


场景


在上面讲若依微服务版的服务部署到Windows服务器上的时候提示:

Description:

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

 

若依微服务版在Windows上通过jar包运行业务模块时提示:Failed to determine s suitable driver class_jar

注: 

实现

在确保系统中Mysql、Redis、Nacos以及各项配置文件没有问题的情况下。

如果不打jar包,直接将项目在IDEA中进行运行的话是不会报此错误的。

但是在将业务模块的吓得比如system打成jar后运行就会提示。

因为连接数据库的yml的配置文件的内容是从Nacos的配置信息的数据库读取出来的,在使用cmd直接运行时使用

java -jar ***.jar

时会因为编码问题导致配置信息读取不正确,所以在运行jar包时指定编码格式。

java -Dfile.encoding=utf-8 -jar xxx.jar

 

举报

相关推荐

0 条评论