ThingsBoard本地环境搭建及相关异常处理_mail_config_templates

#查询当前镜像
npm config get registry

  1. 安装yarn
    npm安装yarn:npm install -g yarn
    #设置淘宝镜像:
    yarn config set registry https://registry.npm.taobao.org -g
    yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
    #使用yarn config list查看,发现的新版的yarn是严格检查ssl的,关闭严格检查SSL设置
    yarn config set strict-ssl false

  2. 安装PostgreSQL,使用PostgreSQL 12.X及以上版本
    #参考地址:https://www.cnblogs.com/wenhuang/p/10706931.html


## 2.获取源码,修改配置、代码



  1. 拉取源码:git clone https://gitee.com/mirrors/ThingsBoard.git

  2. 切换分支:git checkout release-3.6

  3. 注释、修改配置文件
    3.1 根目录pom.xml文件找到license-maven-plugin,并将整个plugin注释掉
    3.2 application模块中的thingsboard.yml文件修改数据库相关信息
    3.3 ui-ngx模块中的pom.xml文件修改node/yarn版本号
    3.4 msa/js-executor模块中的pom.xml文件修改node/yarn版本号

  4. 启动时异常处理:Error creating bean with name ‘defaultTbMailConfigTemplateService’: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [templates/mail_config_templates.json] cannot be resolved to absolute file path because it does not reside in the file system:
    解决方式:
    1. 修改类org.thingsboard.server.service.mail.DefaultTbMailConfigTemplateService.java文件获取模板文件方法
    原方法:mailConfigTemplates = JacksonUtil.toJsonNode(new ClassPathResource(“/templates/mail_config_templates.json”).getFile());
    调整为:

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值