Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to force plugin startup
how to force plugin startup [message #264507] Thu, 29 July 2004 15:21 Go to next message
Eclipse UserFriend
Originally posted by: rhill2_._free.fr

hi-

all is in the question : id like to know if theres some way to force
plugin startup when the platform starts (start() method called) - i have
no manifest yet.

thanks,

-- gd
Re: how to force plugin startup [message #264534 is a reply to message #264507] Thu, 29 July 2004 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

That is a very expensive thing to do. Do you really absolutely need to
do this? Why do you need it?


--
Thanks, Rich Kulp

Re: how to force plugin startup [message #264539 is a reply to message #264534] Thu, 29 July 2004 17:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.eclipsefaq.org

Rich Kulp wrote:

> That is a very expensive thing to do. Do you really absolutely need to
> do this? Why do you need it?


See also the discussion at
http://eclipsefaq.org, Chapter 9, Generic Workbench
FAQ 182 – Can I activate my plug−in when the workbench starts?

Chris
Re: how to force plugin startup [message #264546 is a reply to message #264539] Thu, 29 July 2004 17:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhill2_._free.fr

Chris Laffra wrote:
> Rich Kulp wrote:
>
>
>>That is a very expensive thing to do. Do you really absolutely need to
>>do this? Why do you need it?
>
>
>
> See also the discussion at
> http://eclipsefaq.org, Chapter 9, Generic Workbench
> FAQ 182 � Can I activate my plug−in when the workbench starts?
>
> Chris
>


i just look for a way to solve two problems ive posted there :

1. i have dynamic preference pages that are statically declared through
my own extension point. if plugin is not started before opening the pref
dialog, then the dynamic preference pages wont show up.

2. i declare a launchconfiguration but when hitting the run button just
after startup throws intermittently a ClassNotFoundException ; this wont
occur after a ui element is shown (view, preferences pages,
configuration dialog, etc.). actually bringing up an ui element starts
the plugin whereas the run button doesnot. however i guess that the
problem here may be deeper.

id much prefer avoid early startup but i dont see any way to solve those
two issues (especially the first one). ive posted some messages about
them some days ago without reply.

thanks for your help.

-- gd
Re: how to force plugin startup [message #264760 is a reply to message #264546] Fri, 30 July 2004 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

How do your dynamic preference pages hook into the Eclipse preference
pages? There may be another way to kick them off thru Eclipse when needed.

Is your launchConfiguration just a standard configuration, or did you
supply code that is needed for it. What Class is not found, the stack
trace might be helpful here.

In both cases it is a user action that causes the need for your plugin
so there shouldn't be a need to force it to start at startup.

> i just look for a way to solve two problems ive posted there :
>
> 1. i have dynamic preference pages that are statically declared through
> my own extension point. if plugin is not started before opening the pref
> dialog, then the dynamic preference pages wont show up.
>
> 2. i declare a launchconfiguration but when hitting the run button just
> after startup throws intermittently a ClassNotFoundException ; this wont
> occur after a ui element is shown (view, preferences pages,
> configuration dialog, etc.). actually bringing up an ui element starts
> the plugin whereas the run button doesnot. however i guess that the
> problem here may be deeper.
>
> id much prefer avoid early startup but i dont see any way to solve those
> two issues (especially the first one). ive posted some messages about
> them some days ago without reply.
>
> thanks for your help.
>
> -- gd

--
Thanks, Rich Kulp

Re: how to force plugin startup [message #264791 is a reply to message #264760] Fri, 30 July 2004 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Rich Kulp wrote:
> How do your dynamic preference pages hook into the Eclipse preference
> pages? There may be another way to kick them off thru Eclipse when needed.
>
> Is your launchConfiguration just a standard configuration, or did you
> supply code that is needed for it. What Class is not found, the stack
> trace might be helpful here.
>
> In both cases it is a user action that causes the need for your plugin
> so there shouldn't be a need to force it to start at startup.

I had a similiar problem - Eclipse does not call callback until plugin
containing callback is activated. Startup-code was the only solution.

Do we have anything new for this in 3.X except old good *startup is our
enemy*? :)

--
Sam Mesh - http://openrules.com
Re: how to force plugin startup [message #264803 is a reply to message #264760] Fri, 30 July 2004 15:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhill2_._free.fr

Rich,

thanks for your reply. comments inlined.

Rich Kulp wrote:
> How do your dynamic preference pages hook into the Eclipse preference
> pages? There may be another way to kick them off thru Eclipse when needed.

When the plugin starts, i create IPreferenceNodes from the
IConfigurationElements and attach them to the preference dialog through
Workbench#getPreferenceManager().add(String, IPreferenceNode)

Id much prefer attaching them when the dialog is opened, but i dont know
if there is an extension point that let me declare some kind of
"PreferenceDialogListener".


> Is your launchConfiguration just a standard configuration, or did you
> supply code that is needed for it. What Class is not found, the stack
> trace might be helpful here.

this is indeed just a standard configuration. the class being not found
is the delegate :

public class MavenLaunchDelegate extends AbstractRunner
implements ILaunchConfigurationDelegate

i attach the stack trace at the end of the message. The exception wont
occur as soon a provided ui element is displayed.


> In both cases it is a user action that causes the need for your plugin
> so there shouldn't be a need to force it to start at startup.
>

id be happy to know of a better way to attach the preference pages to
the dialog and if you could give me a hint about the
ClassNotFoundException.

thanks for your help !

-- gd

heres the trace :

java.lang.ClassNotFoundException:
org.mevenide.ui.eclipse.launch.configuration.MavenLaunchDele gate
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:404)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:307)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:336)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1313)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:131)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:124)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:113)
at
org.eclipse.debug.internal.core.LaunchConfigurationType.getD elegate(LaunchConfigurationType.java:231)
at
org.eclipse.debug.internal.core.LaunchConfiguration.getDeleg ate(LaunchConfiguration.java:360)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:514)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:788)
at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:955)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)




>> i just look for a way to solve two problems ive posted there :
>>
>> 1. i have dynamic preference pages that are statically declared through
>> my own extension point. if plugin is not started before opening the
>> pref dialog, then the dynamic preference pages wont show up.
>>
>> 2. i declare a launchconfiguration but when hitting the run button
>> just after startup throws intermittently a ClassNotFoundException ;
>> this wont occur after a ui element is shown (view, preferences pages,
>> configuration dialog, etc.). actually bringing up an ui element starts
>> the plugin whereas the run button doesnot. however i guess that the
>> problem here may be deeper.
>>
>> id much prefer avoid early startup but i dont see any way to solve
>> those two issues (especially the first one). ive posted some messages
>> about them some days ago without reply.
>>
>> thanks for your help.
>>
>> -- gd
>
>
Re: how to force plugin startup [message #264872 is a reply to message #264803] Sat, 31 July 2004 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

About preferences, since you are using an extension point in your
plugin, why don't you instead use the extension point supplied by
eclipse. then you don't need to worry about starting your plugin,
eclipse will do it when necessary.

See org.eclipse.ui.preferencePages

It creates IPreferenceNodes for you.

As for the launch config:

1) Is the class
org.mevenide.ui.eclipse.launch.configuration.MavenLaunchDele gate
declared in the same plugin as where you have the plugin.xml extension
referring to it? Is AbstractRunner available too?

2) In the plugin that the class is in, did you put export="*" on the
library statement for the jar that the launch delegate is in?

--
Thanks, Rich Kulp

Re: how to force plugin startup [message #264873 is a reply to message #264872] Sat, 31 July 2004 14:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhill2_._free.fr

Rich,

Rich Kulp wrote:
> About preferences, since you are using an extension point in your
> plugin, why don't you instead use the extension point supplied by
> eclipse. then you don't need to worry about starting your plugin,
> eclipse will do it when necessary.
>
> See org.eclipse.ui.preferencePages
>

i already use it for static pages, however thats not possible in that
case since the pages are to be provided by other plugins and the main is
that those plugins donot have to actually provide classes because the
page content is declared through my extension point.

> It creates IPreferenceNodes for you.
>
> As for the launch config:
>
> 1) Is the class
> org.mevenide.ui.eclipse.launch.configuration.MavenLaunchDele gate
> declared in the same plugin as where you have the plugin.xml extension
> referring to it? Is AbstractRunner available too?
>

the delegate is in the same plugin ; but AbstractRunner is provided by
another plugin. however the class not found *is* the delegate class. btw
i dont know if this occured with older milestones, i only began to see
this behaviour with rc4+. I will try with older milestones and let you
if this reproductible with them.


> 2) In the plugin that the class is in, did you put export="*" on the
> library statement for the jar that the launch delegate is in?

yup, both the plugin providing AbstractRunner and the current plugin
(providing the delegate) export all classes.

thanks for your help !

-- gd
Re: how to force plugin startup [message #264888 is a reply to message #264507] Sat, 31 July 2004 21:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chris.eclipsefaq.org

Gilles Dodinet wrote:

> hi-

> all is in the question : id like to know if theres some way to force
> plugin startup when the platform starts (start() method called) - i have
> no manifest yet.

Just remember, the user can always override your need for attention
by doing Window > Preferences > Workbench > Startup and Shutdown.
You need to ask yourself how you are going to react to them overriding
early startup of your plugin.

Chris
Re: how to force plugin startup [message #264909 is a reply to message #264873] Sun, 01 August 2004 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Maybe you can provide the preference class itself in your plugin and the
other plugins can use your class instead of providing their own. I
really don't recommend trying to duplicate what is already there. (note
if you provide the class, the others need to make sure that your plugin
is a required plugin of theirs or it won't be found).

As for the other problem, that doesn't make sense. If that class is in
the same plugin as where you define the launch configuration delegate in
the plugin.xml then it must find it. However I've had cases before where
it said it couldn't find a class where what it really couldn't find was
some super class or interface somewhere up the hierarchy.
Re: how to force plugin startup [message #264911 is a reply to message #264909] Sun, 01 August 2004 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

To be more specific about the class not found:

1) What plugin actually contains the delegate jar code itself?
2) What plugin.xml is

<extension
point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType...

actually declared in?

3) Are they two the same plugin?

--
Thanks, Rich Kulp

Re: how to force plugin startup [message #264913 is a reply to message #264911] Sun, 01 August 2004 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhill2_._free.fr

Rich,

thanks a lot for your time.

The plugin declaring the extension point was the one providing the class
and the super class was indeed in another plugin. But i just found out
that the problem was due to a badly initialized registry
(Display.getCurrent() was null) and that caused the plugin to not start,
altho when later activating an ui part the registry was initialized
correctly (thus the plugin started) and then the delegate was launched.
im sorry that i missed it.

about the preferences, i suppose i could reuse the eclipse preference
page, and make the custom extension reference the dynamic page. i havent
thought about it that way. ill try it and post the result to the group.

thanks for your help.

-- gd


Rich Kulp wrote:
> To be more specific about the class not found:
>
> 1) What plugin actually contains the delegate jar code itself?
> 2) What plugin.xml is
>
> <extension
> point="org.eclipse.debug.core.launchConfigurationTypes">
> <launchConfigurationType...
>
> actually declared in?
>
> 3) Are they two the same plugin?
>
Re: how to force plugin startup [message #265045 is a reply to message #264913] Mon, 02 August 2004 10:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Display.getCurrent() is only valid when running in the display thread.
If for some reason you weren't in the display thread this will return
null. So it may not be a registry problem but simply that some other
thread was initializing you plugin.

> that the problem was due to a badly initialized registry
> (Display.getCurrent() was null) and that caused the plugin to not start,
> altho when later activating an ui part the registry was initialized
> correctly (thus the plugin started) and then the delegate was launched.
> im sorry that i missed it.
>
--
Thanks, Rich Kulp

Re: how to force plugin startup [message #265068 is a reply to message #265045] Mon, 02 August 2004 11:34 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

I should actually say "Display.getCurrent() only returns a display when
called from the UI thread," not that "It is only valid in the display
thread."



--
Thanks, Rich Kulp

Previous Topic:How can I use the eclipse java compile outside eclipse or tell it to use javac?
Next Topic:getWorkspace() gives a "Unhandled event loop exception" ?
Goto Forum:
  


Current Time: Sun Jul 27 03:24:02 EDT 2025

Powered by FUDForum. Page generated in 0.25960 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top