-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trpc启动时RpcClientFactory未注册导致client调用时报错com.tencent.trpc.core.exception.TRpcExtensionException: Cannot get extension of type <com.tencent.trpc.core.rpc.spi.RpcClientFactory> with name <trpc> #46
Comments
本地启动服务是正常的,打包部署到容器里有问题;刚远程debug试了一下ExtensionLoader.cachedExtensionClasses是空的,重新调用loadExtensionClasses()后是有值的 |
多核情况下子线程的classloader和主线程的classloader同时加载资源,出现资源竞争,主子线程公用同一个资源的引用,主线程消费后,子线程就不消费了。导致子线程没有加载成功;clazz.getClassLoader()可以保证多线程并发时返回的classloader是相同的;
} |
建议去掉使用线程级的classloader,使用类的classloader;可解决资源加载异常的问题 |
你的springboot是怎么接入trpc,方便发一下配置或者代码吗,我们看下具体的问题。怎么样可以方便的复现
|
这是客户端的配置,也同时对外提供服务
|
@sdwdgx4018 配置看起来没啥,可以加一下我企微,我们具体看下, |
fix in #52 |
springboot接入trpc,使用北极星路由,在调用client时报错;
Caused by: com.tencent.trpc.core.exception.TRpcExtensionException: Cannot get extension of type <com.tencent.trpc.core.rpc.spi.RpcClientFactory> with name
at com.tencent.trpc.core.extension.ExtensionLoader.lambda$getExtension$5(ExtensionLoader.java:241) ~[trpc-core-1.1.1.jar!/:na]
at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
at com.tencent.trpc.core.extension.ExtensionLoader.getExtension(ExtensionLoader.java:240) ~[trpc-core-1.1.1.jar!/:na]
at com.tencent.trpc.core.common.config.ProtocolConfig.createClient(ProtocolConfig.java:97) ~[trpc-core-1.1.1.jar!/:na]
at com.tencent.trpc.core.cluster.RpcClusterClientManager.createRpcClientProxy(RpcClusterClientManager.java:159) ~[trpc-core-1.1.1.jar!/:na]
at com.tencent.trpc.core.cluster.RpcClusterClientManager.lambda$getOrCreateClient$11(RpcClusterClientManager.java:152) ~[trpc-core-1.1.1.jar!/:na]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
at com.tencent.trpc.core.cluster.RpcClusterClientManager.getOrCreateClient(RpcClusterClientManager.java:151) ~[trpc-core-1.1.1.jar!/:na]
at com.tencent.trpc.core.cluster.def.DefClusterInvoker.createInvoker(DefClusterInvoker.java:96) ~[trpc-core-1.1.1.jar!/:na]
打开debug日志发现服务启动时warmupClient的日志到Warm up client create&open 后就不执行了,也没有异常Warm up client create&open exception
The text was updated successfully, but these errors were encountered: