sofastack / sofa-ark

SOFAArk is a light-weight,java based classloader isolation framework.
https://www.sofastack.tech/projects/sofa-boot/sofa-ark-readme/
Apache License 2.0
1.57k stars 508 forks source link

官方例子 sofa-ark-dynamic-guides,动态加载biz,服务调用出错 #701

Closed lovejin52022 closed 1 year ago

lovejin52022 commented 1 year ago

Describe the bug

官方例子: sofa-ark-dynamic-guides 动态加载biz,服务调用出错,报错如下: SOFA-BOOT-01-00400: JVM Reference[interface io.sofastack.dynamic.facade.StrategyService#] can 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.

关联Issue: sofa-ark-dynamic-guides#28

18:53:37.475 ERROR o.a.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [/] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: SOFA-BOOT-01-00400: JVM Reference[interface io.sofastack.dynamic.facade.StrategyService#annotationImpl] can 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] with root cause java.lang.IllegalStateException: SOFA-BOOT-01-00400: JVM Reference[interface io.sofastack.dynamic.facade.StrategyService#annotationImpl] can 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 at com.alipay.sofa.runtime.service.binding.JvmBindingAdapter$JvmServiceInvoker.doInvoke(JvmBindingAdapter.java:241) at com.alipay.sofa.runtime.spi.service.ServiceProxy.invoke(ServiceProxy.java:40) at com.alipay.sofa.runtime.service.binding.JvmBindingAdapter$JvmServiceInvoker.invoke(JvmBindingAdapter.java:159) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy82.strategy(Unknown Source) at io.sofastack.stockmng.controller.IndexController.index(IndexController.java:27) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566)

Steps to reproduce

  1. IDE里增加-Dsofa.ark.embed.enable=true 启动参数,直接启动 StockMngApplication 类。
  2. telnet localhost 1234
  3. biz -i file:///Users/sample/sofachannel-demo/dynamic-provider/target/dynamic-provider-1.0.0-ark-biz.jar
  4. 访问 http://localhost:8080,报错

Environment

hustchaya commented 1 year ago

这个模块的动态依赖,不是指「动态模块」本身这个依赖,是指帮助 「动态安装模块」的依赖,我这边让他们调整一下文档

lvjing2 commented 1 year ago

用例有些配置问题,抱歉给你带来困惑。麻烦拉下最新 sofa-ark-dynamic-guides 试下,我更新了下样例,本地验证通过了。如果有问题可以重新打开 issues