Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Update import-full-springboot-in-module.md #470

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ weight: 100

name = 'com.alipay.sofa.ark.springboot.listener.ArkApplicationStartListener', ClassUtils.forName 获取到的是从基座 ClassLoader 的类<br />![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/149473/1695020357927-660e3462-1bd7-4ede-9955-541b63caf650.png#clientId=ufd4bb4ce-38f3-4&from=paste&height=308&id=DwdJg&originHeight=616&originWidth=1786&originalType=binary&ratio=2&rotation=0&showTitle=false&size=132500&status=done&style=none&taskId=u870534d8-591d-4685-bdef-19aeb287535&title=&width=893)<br />而 type 是模块启动时加载的,也就是使用模块 BizClassLoader 加载。<br />![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2023/png/149473/1695020334793-d8be43cc-b791-4aef-bb75-b8c890cbe82c.png#clientId=ufd4bb4ce-38f3-4&from=paste&height=400&id=q2juJ&originHeight=800&originWidth=1612&originalType=binary&ratio=2&rotation=0&showTitle=false&size=165924&status=done&style=none&taskId=u52077367-d352-49fc-9d49-a6ac0cf539b&title=&width=806)<br />此时这里做 isAssignable 判断,则会报错。
```xml
Cannot instantiate interface org.springframework.context.ApplicationListener : com.alipay.sofa.ark.springboot.listener.ArkApplicationStartListener
com.alipay.sofa.serverless.plugin.spring.ServerlessApplicationListener is not assignable to interface org.springframework.context.ApplicationListener
```

所以模块框架这部分需要委托给基座加载。
Expand Down
Loading