IDEA 2021.1 MyURLStreamHandler bug for jar path
Answered
I found one of idea's bug, there was no this bug in the previous version 2020.3.
In my developed IDEA plugin, to init my spring beans, I used @ComponentScan, I set basePackages is "com.xxx.aaa.idea.gui", but I debug found the path is not "com.xxx.aaa.idea.gui", it is ""com.xxx.aaa.idea", it remove "gui".
Deep debug I found 2021.1 used com.intellij.util.lang.ZipResourceFile$MyURLStreamHandler, but 2020.3 used sun.net.www.protocol.jar.Handler, the reason is this.
How can I solve this problem now?
Please sign in to leave a comment.
I temporarily bypassed it in another way.
I listed all the classes to be registered and registered them one by one, but this way is very troublesome. I hope to solve this problem as soon as possible.
Do I understand correctly that you establish a Spring context inside your plugin? Please see https://youtrack.jetbrains.com/issue/IDEA-264777 which seems related.
So, can't I use Spring context with @ComponentScan init beans in the new version of IDEA plug-in?
Could you please share you code where you initialize Spring Context? (Why do you need Spring at all?)
We need to generate a spring container for each idea project to manage.
@Yicheng Wp
i have the same problem. the @ComponentScan can't found any bean in plugin, which works well in test method. could you show me how to solve it?