IllegalStateException: class with name .. should be instance of com.intellij.openapi.actionSystem.AnAction

I created a DevKit-enabled project around the code of the
LineUpDownMover plugin (that works fine in 3089).
I can launch the 2nd instance of IDEA, but as soon as I try to use the
plugin in it, I get

apple.awt.EventQueueExceptionHandler Caught Throwable :
java.lang.IllegalStateException: class with name
"com.ravet.ideaplugins.linemover.LineDownMover" should be instance of
com.intellij.openapi.actionSystem.AnAction

This is strange, as the offending class IS an instance of AnAction, as
it extends EditorAction.
What did I do wrong/Is it a bug?

Alain
-



/Library/Java/Home/bin/java
-Xbootclasspath/p:/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/lib/boot.jar
-Didea.config.path=/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/sandbox/config
-Didea.system.path=/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/sandbox/system
-Didea.plugins.path=/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/sandbox/plugins -Didea.smooth.progress=false
-Dapple.laf.useScreenMenuBar=true -Dfile.encoding=MacRoman -classpath
/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/lib/idea.jar:/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/lib/openapi.jar:/Users/aravet/Desktop/__dev__/devCAMOUFLAGE/IntelliJ
IDEA.app/lib/log4j.jar com.intellij.idea.Main

apple.awt.EventQueueExceptionHandler Caught Throwable :
java.lang.IllegalStateException: class with name
"com.ravet.ideaplugins.linemover.LineDownMover" should be instance of
com.intellij.openapi.actionSystem.AnAction
java.lang.IllegalStateException: class with name
"com.ravet.ideaplugins.linemover.LineDownMover" should be instance of
com.intellij.openapi.actionSystem.AnAction
at
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:50)
at
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:349)
at
com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:352)
at com.intellij.openapi.d.a.e.a(e.java:64)
at com.intellij.openapi.d.a.e.b(e.java:42)
at com.intellij.openapi.d.a.e.a(e.java:180)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:104)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:133)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

6 comments
Comment actions Permalink

Here is the project:
(see the attachment)



Attachment(s):
lineMove3b.zip
0
Comment actions Permalink

Any comment? Is it my fault, or a bug?

I'd like to test DevKit, but this keeps me from doing even the simplest task.

Alain

0
Comment actions Permalink

Alain,

I guess the problem is that you have this "idea-dev 3089" library in your project.

I also guess that it contains openapi.jar which will be copied by IDEA into the
sandbox' plugin/lib dir. Since "com.intellij.openapi.actionSystem.AnAction" is
included in openapi.jar, it will be loaded by a different classloader than the one
that loads IDEA's classes which makes the classes incompatible, even though they are
named equally.

I think you should not include any idea-specific classes until the DevKit allows
selective packaging like the J2EE stuff does, even though I didn't find a way yet
to attach the sources/javadoc to the implicit plugin library.

HTH,
Sascha

Alain Ravet wrote:

Any comment? Is it my fault, or a bug?

I'd like to test DevKit, but this keeps me from doing even the simplest task.

Alain

0
Comment actions Permalink

Sascha,

I think you should not include any idea-specific classes until the
DevKit allows
selective packaging like the J2EE stuff does,



As you suggested, I removed the explicit link to the openapi.jar lib.
I compiles fine, but doesn't solve my problem: I still get the same
error (stacktrace).

Alain

0
Comment actions Permalink

You have to manually delete the openapi.jar from the sandbox. It isn't
deleted on recompilation. At least for me this solved the problem
(thanks, Sascha).

Alain Ravet wrote:

Sascha,

>> I think you should not include any idea-specific classes until the
>> DevKit allows
>> selective packaging like the J2EE stuff does,



As you suggested, I removed the explicit link to the openapi.jar lib.
I compiles fine, but doesn't solve my problem: I still get the same
error (stacktrace).

Alain

0
Comment actions Permalink

Martin Fuhrer wrote:

You have to manually delete the openapi.jar from the sandbox. It isn't
deleted on recompilation.




It works fine now. Thanks.

Alain

0

Please sign in to leave a comment.