PluginManager calls

When I try to call PluginManager (to get at the classpath for my plugin), I always get the exception below. Nowhere in my project so I have 'com.intellij.component' so I'm rather baffled as to how to debug this!

java.lang.RuntimeException: Duplicate registration for EP: com.intellij.component
at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.registerExtensionPoint(ExtensionsAreaImpl.java:271)
at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.registerExtensionPoint(ExtensionsAreaImpl.java:263)
at com.intellij.ide.plugins.PluginManager.c(PluginManager.java:128)
at com.intellij.ide.plugins.PluginManager.b(PluginManager.java:264)
at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:29)
at com.intellij.ide.plugins.PluginManager.getPlugin(PluginManager.java:274)

6 comments
Comment actions Permalink

On Fri, 22 Jul 2005 00:41:12 +0400, Hani Suleiman wrote:

When I try to call PluginManager (to get at the classpath for my
plugin), I always get the exception below. Nowhere in my project so I
have 'com.intellij.component' so I'm rather baffled as to how to debug
this!

java.lang.RuntimeException: Duplicate registration for EP: com.intellij.component
at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.registerExtensionPoint(ExtensionsAreaImpl.java:271)
at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.registerExtensionPoint(ExtensionsAreaImpl.java:263)
at com.intellij.ide.plugins.PluginManager.c(PluginManager.java:128)
at com.intellij.ide.plugins.PluginManager.b(PluginManager.java:264)
at com.intellij.ide.plugins.PluginManager.getPlugins(PluginManager.java:29)
at com.intellij.ide.plugins.PluginManager.getPlugin(PluginManager.java:274)


Just a guess, but perhaps your plugin.xml is to blame? Maybe multiple
component ]]> elements naming the same class? (Disclaimer:
I've never used the component extension point.)

--
Mark Scott
mark@codebrewer.com

0
Comment actions Permalink

Plugin manager is closed API. You should not use that.
In this particular case it seems you're requesting that too early and plugins
are loaded twice.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

I'd love to not be using it! In my situation (the testng plugin) I need to be able to add the plugin classes and the bundled testng jar to the newly started process, how can I go about that without using PluginManager?

I managed to do some accidental refactoring and the error has gone away now, but it still would be nice not to have to resort to PluginManager.

0
Comment actions Permalink

Maxim, any idea on how I can avoid calling the plugin 'too early' or ensure that it does whatever it needs to do before I call it? I'm having the same problem again with no idea of why it's popped up, and is a showstopper right now for further work on my plugin!

0
Comment actions Permalink

Maxim Shafirov (JetBrains) wrote:

Plugin manager is closed API. You should not use that.
In this particular case it seems you're requesting that too early and
plugins are loaded twice.


The exception looks a lot like the one you get when starting IDEA when a plugin-dependency
isn't present: http://www.intellij.net/tracker/idea/viewSCR?publicId=50948

Hani, at which particular point do you call the method? During application startup/plugin
initialization? Maybe you could use lazy-initialization when you /really/ need the
classpath, or you could try using com.intellij.openapi.startup.StartupManager to run your
code after project-loading.

Sascha

0
Comment actions Permalink

Another reason I think was that I might have had idea.jar in the plugin's dir, so the PluginManager in there was being called for some reason. Anyway, after making sure that that file is never there, things are back to working. Although I still don't know for sure if that was the reason or not.

My code runs when the run dialog is brought up, so well into the app's lifecycle.

0

Please sign in to leave a comment.