Getting started with plugins, get ClassCastException

I'm getting a ClassCastException when the project starts and the container is creating my ProjectComponent plugin:


My plugin class implements ProjectComponent:


and it's configured like this:

  Ivy Classpath Plugin
  Reads the Ivy configuration files and sets the classpath of each module
  0.1
  OpenSymphony
  

       
      
          com.opensymphony.ivyclasspath.IvyProjectComponent
          com.opensymphony.ivyclasspath.IvyProjectComponent
      
   

    
       
           com.opensymphony.ivyclasspath.IvyModuleComponent
           com.opensymphony.ivyclasspath.IvyModuleComponent
       
    
]]>


Anyone have any pointers for me?

2 comments
Comment actions Permalink

Please make sure that you DON'T distribute any IDEA libraries together
with your plugin. If you have openapi.jar in your plugin's library
folder then the ProjectComponent interface is loaded from there and
clashes with the one loaded by IDEA.

By the way:
You don't have to specify a interface-class in plugin.xml if it's
identical to the implementation-class.

Jason Carreira wrote:

I'm getting a ClassCastException when the project starts and the container is creating my ProjectComponent plugin:

 	at com.intellij.openapi.components.impl.ComponentManagerImpl.instantiateComponent(ComponentManagerImpl.java:22)
> 	at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:168)
> 	at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:13)]]>


My plugin class implements ProjectComponent:



and it's configured like this:

> 
>   Ivy Classpath Plugin
>   Reads the Ivy configuration files and sets the classpath of each module
>   0.1
>   OpenSymphony
>   
> 
>     >    
>       
>           com.opensymphony.ivyclasspath.IvyProjectComponent
>           com.opensymphony.ivyclasspath.IvyProjectComponent
>       
>    
> 
>     
>        
>            com.opensymphony.ivyclasspath.IvyModuleComponent
>            com.opensymphony.ivyclasspath.IvyModuleComponent
>        
>     
> ]]>


Anyone have any pointers for me?


--
Martin Fuhrer
Fuhrer Engineering AG
http://www.fuhrer.com

0
Comment actions Permalink

Jason Carreira wrote:

java.lang.ClassCastException: com.opensymphony.ivyclasspath.IvyProjectComponent


Oooo an Ivy plugin - I was just about to post to see if anyone was
looking into such a beast...

0

Please sign in to leave a comment.