sofastack / sofa-boot

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.
https://www.sofastack.tech/sofa-boot/docs/Home
Apache License 2.0
4.95k stars 1.26k forks source link

biz启动报错,WrapperAnnotation is not visible from class loader #293

Closed victorzhangchn closed 5 years ago

victorzhangchn commented 5 years ago

现在启动biz会报错:Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: interface com.alipay.sofa.runtime.annotation.WrapperAnnotation is not visible from class loader 也就是说在BIZ中没有加载到WrapperAnnotation这个接口 WrapperAnnotation 是不是应该在plugin pom里导出?

QilongZhang commented 5 years ago

感谢反馈,这个包是新增的。需要在runtime ark plugin 增加导出类:

<package>com.alipay.sofa.runtime.annotation.*</package>
victorzhangchn commented 5 years ago

嗯嗯注意到新增的了,所以反馈一下,你提供的这种方式我试了还是有些问题,会找不到Spring 中的Assert等类,我试了仅导出WrapperAnnotation是可行的

victorzhangchn commented 5 years ago

另外org.springframework.boot.test.util.EnvironmentTestUtils 这个类在springboot 2.1.0.RELEASE中已经去掉了,现在测试类中还有用到,编译会报错

QilongZhang commented 5 years ago

另外org.springframework.boot.test.util.EnvironmentTestUtils 这个类在springboot 2.1.0.RELEASE中已经去掉了,现在测试类中还有用到,编译会报错

https://github.com/alipay/sofa-boot/pull/291 这里已经改了哈。

QilongZhang commented 5 years ago

@Mr-onion 抱歉,上面回答错误。不需要将这些类导出,报错是因为Proxy 的classloader 设置不合理导致的,使用 3.1.0 版本没有问题。