再遇-Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dbRealm’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userService’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userRepository’ defined in file [D:\oneisalls\windbell\bussiness\admin\target\classes\cn\afterturn\boot\admin\repository\UserRepository.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property ‘sqlSessionFactory’ or ‘sqlSessionTemplate’ are required


前端时间就遇到过这个问题,花费了很长时间解决了,许久又见到这个问题了竟然忘记了怎么解决的了
这里记录下防止下次再找不到

最终结果是nacos没有获取到配置文件
错误原因是
https://github.com/alibaba/nacos/issues/271

错误日志

01 2019-04-25 21:56:52.588 INFO [main :c.a.n.c.c.u.ParamUtils] [settings] [] [] [req-serv] nacos-server port:8848
01 2019-04-25 21:56:52.591 INFO [main :c.a.n.c.c.u.ParamUtils] [settings] [] [] [http-client] connect timeout:1000
01 2019-04-25 21:56:52.593 INFO [main :c.a.n.c.c.u.ParamUtils] [NACOS_CLIENT_VERSION:{}] [] [] ${project.version}
01 2019-04-25 21:56:52.593 WARN [main :c.a.n.c.c.u.ParamUtils] [] [] [] PER_TASK_CONFIG_SIZE:
01 2019-04-25 21:56:52.612 WARN [main :c.a.n.c.c.i.LocalConfigInfoProcessor] [LOCAL_SNAPSHOT_PATH:{}] [] [] C:\Users\jueyue\nacos\config
01 2019-04-25 21:56:52.658 INFO [main :c.a.n.c.c.i.Limiter] [] [] [] limitTime:5.0
01 2019-04-25 21:56:53.153 ERROR [main :c.a.n.c.c.i.LocalConfigInfoProcessor] [fixed-dev.cloud.afterturn.cn:8848-ef2b4237-03f0-4974-853e-a821dec0c7e3] [] [NACOS-XXXX] save snapshot error
01 2019-04-25 21:56:53.156 INFO [main :c.a.n.c.c.u.JVMUtil] [] [] [] isMultiInstance:false
01 2019-04-25 21:56:53.158 ERROR [main :c.a.n.c.c.i.LocalConfigInfoProcessor] [fixed-dev.cloud.afterturn.cn:8848-ef2b4237-03f0-4974-853e-a821dec0c7e3] [] [NACOS-XXXX] save snapshot error, C:\Users\jueyue\nacos\config\fixed-dev.cloud.afterturn.cn:8848-ef2b4237-03f0-4974-853e-a821dec0c7e3_nacos\snapshot-tenant\ef2b4237-03f0-4974-853e-a821dec0c7e3\DEFAULT_GROUP\lemur-admin-dev.yaml, java.io.FileNotFoundException: C:\Users\jueyue\nacos\config\fixed-dev.cloud.afterturn.cn:8848-ef2b4237-03f0-4974-853e-a821dec0c7e3_nacos\snapshot-tenant\ef2b4237-03f0-4974-853e-a821dec0c7e3\DEFAULT_GROUP\lemur-admin-dev.yaml (文件名、目录名或卷标语法不正确。)

window 目录文件不支持** : ** 所以无法创建本地目录

nacos-client 代码
ServerListManager 的方法

String getFixedNameSuffix(String... serverIps) {
        StringBuilder sb = new StringBuilder();
        String split = "";
        for (String serverIp : serverIps) {
            sb.append(split);
            sb.append(serverIp.replaceAll(":", "_"));
            split = "-";
        }
        return sb.toString();
    }
    ```
    我的版本是0.3 没有replaceAll,0.6之后的版本有了所以报错了 最新版本是0.9.0


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值