sofastack / sofa-jarslink

Jarslink is a sofa ark plugin used to manage multi-application deployment
Apache License 2.0
3.04k stars 705 forks source link

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

Closed iteaj closed 5 years ago

iteaj commented 5 years ago

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

iteaj commented 5 years ago

There was an unexpected error (type=Internal Server Error, status=500). org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: JVM Reference[interface co demo.zip m.iteaj.service.TestService#] cant not find the corresponding JVM service. Please check if there is a SOFA deployment publish the corresponding JVM service. If this exception occurred when the application starts up, please add Require-Module to SOFA deployment's MANIFEST.MF to indicate the startup dependency of SOFA modules.

iteaj commented 5 years ago

先咨询一下,使用jvm服务时业务代码里面的服务注册以及引用是否需要在spring的同一个ApplicationContext者父子关联的ApplicationContext

QilongZhang commented 5 years ago

先咨询一下,使用jvm服务时业务代码里面的服务注册以及引用是否需要在spring的同一个ApplicationContext者父子关联的ApplicationContext

抱歉,才看到你的消息。 jvm 服务不要求引用和发布方的spring 上下文关系。

QilongZhang commented 5 years ago

@iteaj 如果有比较急的问题,也可以单独给我发邮件 qilong.zql@antfin.com

iteaj commented 5 years ago

@QilongZhang 你好, 已经找到问题但不知道是否是正确的。 每个biz包启动的时候框架都会为他们创建一个SofaRuntimeManager, 并且把他注册到SofaFramework里面, 如下代码 ` @Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public static SofaRuntimeContext sofaRuntimeContext(@Value("${"

QilongZhang commented 5 years ago

@iteaj 你的分析是正确的,SOFABoot 代码重构的时候这部分应该是没有测试,我们会尽快修复~

puzhi commented 5 years ago

@QilongZhang 快修复吧,这个demo很重要!

QilongZhang commented 5 years ago

@puzhi 好的,我今晚修复~ 多谢反馈

puzhi commented 5 years ago

@QilongZhang 为什么依然无法运行!是我什么地方没做对吗?我的环境

com.alipay.sofa sofaboot-dependencies 2.5.0 com.alipay.sofa sofa-jarslink-ark-starter ark-plugin 2.0.0-SNAPSHOT com.alipay.sofa runtime-sofa-boot-plugin 3.0.0-SNAPSHOT
   <dependency>
       <groupId>com.alipay.sofa</groupId>
       <artifactId>runtime-sofa-boot-starter</artifactId>
       <version>3.0.0-SNAPSHOT</version>
   </dependency>
QilongZhang commented 5 years ago

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