Changes from 4.0 to EAP ??? I receive ClassCastException


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:

at bytecrafters.scrappy.ExecuteIt.createScrap(
at bytecrafters.scrappy.ExecuteIt.executeIt(
at bytecrafters.scrappy.Scrappy.keyPressedEvent(
at bytecrafters.scrappy.Scrappy.access$600(
at bytecrafters.scrappy.Scrappy$11.keyPressed(
at java.awt.Component.processKeyEvent(
at javax.swing.JComponent.processKeyEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.KeyboardFocusManager.redispatchEvent(
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at com.intellij.ide.p.b(
at com.intellij.ide.p.a(
at com.intellij.ide.p.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

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


Please sign in to leave a comment.