Plugin ClassNotFound in v2021.2

Answered

Hi there,

 

When running a plugin that worked fine in 2021.1 in 2021.2 from the idea via gradle->runIde (but also when being regularly installed to the IDE), I now get some kind of splashscreen error:

 

I'd think that the class is there and correctly compiled, because the rest of the plugin works fine (once I disabled the problematic component

```

<project-components>
<component>
<implementation-class>io.github.holgerbrandl.send2terminal.actions.CodeEvalActionRegistry
</implementation-class>
</component>
</project-components>

```

in the plugin.xml

 

Sources are located in https://github.com/holgerbrandl/send2terminal/tree/master and the problematic class (which simply extends a custom menu) is https://github.com/holgerbrandl/send2terminal/blob/master/src/main/java/io/github/holgerbrandl/send2terminal/actions/CodeEvalActionRegistry.java

Any advice about how to fix compatibility with the latest version of Intellij would be appreciated.

Thanks & best regards,

Holger

4 comments
Comment actions Permalink

Project components are deprecated for a long time now. Please upgrade your code, as described in the IntelliJ SDK documentation: https://plugins.jetbrains.com/docs/intellij/plugin-components.html

0
Comment actions Permalink

I had noticed the deprecation. However, the page you were referring to states "When writing new plugins, creating Components should be avoided.". But it seems that 2021.2 simply breaks (some) legacy plugins (such as mine).

I would not mind porting it, but I'm unsure into which direction to go. The offending class in https://github.com/holgerbrandl/send2terminal/blob/master/src/main/java/io/github/holgerbrandl/send2terminal/actions/CodeEvalActionRegistry.java is extending a custom menu with some dynamic entries. To part of the plugin structure would such logic need to be moved? Like service, some postStartupActivity, or maybe some other extension point? Could you give me some pointer in which direction to go?

 

Thanks & best regards,

Holger 

 

0
Comment actions Permalink

please remove whitespace around FQN inside the <...component> tags

https://youtrack.jetbrains.com/issue/IDEA-272393

0
Comment actions Permalink

Thanks for the workaround Yann Cebron . Works for me, but it's a bit shaky because reformatting of the plugin.xml will bring back the whitespace.

0

Please sign in to leave a comment.