jarslink throw exception [cant not find the corresponding JVM service]
See original GitHub issueYour question
再ark容器里面创建两个web的biz包, 其中一个发布服务, 一个引用服务, 然后再调用的时候提示 《cant not find the corresponding JVM service. Please check if there is a SOFA deployment publish the corresponding JVM service》
Your scenes
describe your use scenes (why need this feature)
Your advice
describe the advice or solution you’d like
Environment
- Jarslink version:
- JVM version (e.g.
java -version
): - OS version (e.g.
uname -a
): - Maven version:
- IDE version:
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
jarslink throw exception [cant not find the corresponding JVM ...
m.iteaj.service.TestService#] cant not find the corresponding JVM service. Please check if there is a SOFA deployment publish the corresponding ...
Read more >Fix list for IBM App Connect Enterprise Version 11.0
CALLABLE FLOWS AND FLOW EXERCISER CAN CAUSE A PARSE ERROR. IT28664, MQSILIST SHOWS WEBUI URL AS HTTP PROTOCOL INSTEAD OF HTTPS WHEN WEBADMIN...
Read more >Release Notes - Deeplearning4j - Konduit
Fixed an issue where SameDiff layers in DL4J could throw an exception when used with transfer learning Link. Weight initialization for EmbeddingLayer and ......
Read more >Diff - gerrit - Google Git
The Gerrit Project doesn't provide binaries for these plugins, but -there are some public services, like the -link:https://ci.gerritforge.com/[CI Server ...
Read more >May 2019 – Page 2 - IIBTOOLKIT
EXTERNAL variable value cannot be changed by ESQL. Scope: for all messages passing through the flow. Lifetime: Till the message flow stops.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@QilongZhang 你好, 已经找到问题但不知道是否是正确的。 每个biz包启动的时候框架都会为他们创建一个SofaRuntimeManager, 并且把他注册到SofaFramework里面, 如下代码 ` @Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public static SofaRuntimeContext sofaRuntimeContext(@Value(“${” + SofaBootInfraConstants.APP_NAME_KEY + “}”) String appName, BindingConverterFactory bindingConverterFactory, BindingAdapterFactory bindingAdapterFactory) { ClientFactoryInternal clientFactoryInternal = new ClientFactoryImpl(); SofaRuntimeManager sofaRuntimeManager = new StandardSofaRuntimeManager(appName, SofaRuntimeAutoConfiguration.class.getClassLoader(), clientFactoryInternal); sofaRuntimeManager.getComponentManager().registerComponentClient( ReferenceClient.class, new ReferenceClientImpl(sofaRuntimeManager.getSofaRuntimeContext(), bindingConverterFactory, bindingAdapterFactory)); sofaRuntimeManager.getComponentManager().registerComponentClient( ServiceClient.class, new ServiceClientImpl(sofaRuntimeManager.getSofaRuntimeContext(), bindingConverterFactory, bindingAdapterFactory)); SofaFramework.registerSofaRuntimeManager(sofaRuntimeManager); return sofaRuntimeManager.getSofaRuntimeContext();
在获取服务引用的时候去获取对应注册的服务c:如下
public ServiceProxy findServiceProxy(ClassLoader clientClassloader, Contract contract) { String interfaceType = contract.getInterfaceType().getCanonicalName(); String uniqueId = contract.getUniqueId(); for (SofaRuntimeManager sofaRuntimeManager : SofaFramework.getRuntimeSet()) { if (sofaRuntimeManager.getAppClassLoader().equals(clientClassloader)) { continue; } Biz biz = getBiz(sofaRuntimeManager); if (biz != null && biz.getBizState() == BizState.ACTIVATED) { ServiceComponent serviceComponent = findServiceComponent(uniqueId, interfaceType, sofaRuntimeManager.getComponentManager()); if (serviceComponent != null) { return new DynamicJvmServiceInvoker(clientClassloader, sofaRuntimeManager.getAppClassLoader(), serviceComponent.getService() .getTarget(), contract, biz.getIdentity()); } } } return null; }
但由于runtime-sofa-boot-starter-plugin插件没有导出SofaFramework类, 所以每个biz应用再加载这个类的时候不会委托给插件加载, 而是每个biz包自己加载SofaFramework类, 从而导致类SofaFramework并不是全局的, 这样多个biz包注册的服务项目引用不到。 解决方法:再插件里面导出SofaFramework类@puzhi 上面有链接的修复PR https://github.com/alipay/sofa-boot/pull/267 ,因为还没有合并,你可以把分支代码拉取下来本地安装。更新本地 jarslink 代码,运行 biz-jvm-invocation-sample 即可。