Apollo使用报错: Cause: [status code: 404].......

 在使用spring项目接入携程 apollo 的时候,报了一个错误:Cause: [status code: 404] Could not find config for namespace - appId: housing102, cluster: default, namespace: application, please check whether the configs are released in Apollo!

仔细看了以下源码才发现,原来是因为namesapce下没有初始化配置属性会报404。将项目中用到的配置加上去即可。

正确设置如下

 

但前提是,你的app.id、apollo.meta、namespace设置正确的情况下。上述解决方法才有效。 下图为设置正确的日志信息。

{'fail': True, 'resultCode': 'AE0316021001', 'resultDesc': '处理失败', 'resultDetail': 'StockTrkProdException[errorCode=FAIL,externalData=<null>,detailMessage=请先选择租户,cause=com.alipay.finqrmprod.common.util.exception.StockTrkProdException@26d5ca40,stackTrace={},suppressedExceptions=[]]\n\tat com.alipay.finqrmprod.core.model.context.TenantContext.safeGet(TenantContext.java:42)\n\tat com.alipay.finqrmprod.core.service.usecase.impl.CommonService.getCrSocietyInfo(CommonService.java:55)\n\tat com.alipay.finqrmprod.core.service.usecase.impl.UsecaseServiceImpl.invokeTR(UsecaseServiceImpl.java:156)\n\tat sun.reflect.GeneratedMethodAccessor724.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:501)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)\n\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)\n\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)\n\tat com.sun.proxy.$Proxy479.invokeTR(Unknown Source)\n\tat sun.reflect.GeneratedMethodAccessor724.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:501)\n\tat com
最新发布
03-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值