question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jarslink throw exception [cant not find the corresponding JVM service]

See original GitHub issue

Your 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:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iteajcommented, Nov 7, 2018

@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类

0reactions
QilongZhangcommented, Nov 8, 2018

@puzhi 上面有链接的修复PR https://github.com/alipay/sofa-boot/pull/267 ,因为还没有合并,你可以把分支代码拉取下来本地安装。更新本地 jarslink 代码,运行 biz-jvm-invocation-sample 即可。

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found