Changes from 4.0 to EAP ??? I receive ClassCastException

Hello,

i have a plugin (scrappy) that works for 4.0 fine. Using the same plugin with 4.1 (e.g. build 2008) fails.

The code that is the drouble maker:


public IScrap createScrap(String className, String source) throws CompileFailedException {

return (IScrap)scrapLoader.loadClass(className).newInstance();

}

The class that should be loaded is the Code-Scrap. I validate if the class has the interface IScrap. Nevertheless i receive a ClassCastException at this point.

What is different from 4.0 to EAP (4.1)? I'm using the pizza compiler to compile the scrap. Is EAP using anohter JDK?

I how, its hard to help at this topic, but maybe someone have had a similar problem.

Here is the Exception:

java.lang.ClassCastException
at bytecrafters.scrappy.ExecuteIt.createScrap(ExecuteIt.java:113)
at bytecrafters.scrappy.ExecuteIt.executeIt(ExecuteIt.java:56)
at bytecrafters.scrappy.Scrappy.keyPressedEvent(Scrappy.java:226)
at bytecrafters.scrappy.Scrappy.access$600(Scrappy.java:12)
at bytecrafters.scrappy.Scrappy$11.keyPressed(Scrappy.java:167)
at java.awt.Component.processKeyEvent(Component.java:5058)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2388)
at java.awt.Component.processEvent(Component.java:4909)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:627)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:831)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:741)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:592)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at com.intellij.ide.p.b(p.java:38)
at com.intellij.ide.p.a(p.java:47)
at com.intellij.ide.p.dispatchEvent(p.java:134)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Thanks in advance, Leif

1 comment


The change you are almost certainly hitting is that classloading for plugins was completely altered. Each plugin gets its own classloader now, which means the chain of classloaders that that code was counting on has changed.

--Dave Griffith

0

Please sign in to leave a comment.