Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Load dynamic plugin
Load dynamic plugin [message #324735] Thu, 31 January 2008 14:21 Go to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Hello,

I would like to load plugins dynamiclly when I launch my application, and
unload them when I quit it. These plugins are not .jar but directories. I
use jaas to know if I load or not them.
How can I load and unload these plugins?

Regards,
David.
Re: Load dynamic plugin [message #324745 is a reply to message #324735] Thu, 31 January 2008 15:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Normally you use OSGi and your BundleContext ... see
org.eclipse.ui.tests.dynamicplugins.DynamicUtils in the
org.eclipse.ui.tests plugin for an example. OSGi doesn't distinguish
between a directory plugin and a jar plugin.

See http://dev.eclipse.org/viewcvs/index.cgi/ to view the eclipse source
on the web.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Load dynamic plugin [message #324785 is a reply to message #324745] Fri, 01 February 2008 08:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.chautard.gmail.com

Hi,
thanks for your help Paul.

Regards,
David.
Re: Load dynamic plugin [message #324819 is a reply to message #324785] Fri, 01 February 2008 15:53 Go to previous messageGo to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Hi,
now I can load my plugin, as it appears in the "Plug-in details".
Nevertheless, I have a ClassNotFoundException for the class which open my
editor, and my editor doesn't open.

What can be the problem?

Thanks,
David.
Re: Load dynamic plugin [message #324857 is a reply to message #324819] Sat, 02 February 2008 20:29 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
David 写道:
> Hi,
> now I can load my plugin, as it appears in the "Plug-in details".
> Nevertheless, I have a ClassNotFoundException for the class which open
> my editor, and my editor doesn't open.
>
> What can be the problem?
>
> Thanks,
> David.
>
Normally, maybe not specified some depend-plugins, if so, add it from
pde depends page.

Regards,
xiangya
Re: Load dynamic plugin [message #324893 is a reply to message #324857] Mon, 04 February 2008 10:11 Go to previous messageGo to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
I think the problem is that I don't start my installed plugin. But when I
try to start it, I have : "The activator AAA for bundle BBB is invalid"
error message.

Can anyone give me suggestions about this?

Thanks,
David.
Re: Load dynamic plugin [message #324946 is a reply to message #324893] Mon, 04 February 2008 18:08 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In theory installing the plugin should make its plugin.xml available so
editor descriptors and other registry elements show up.

Eclipse will start the plugin (assuming you have auto-start or lazy
start set to try and singleton:=true in your MANIFEST.MF) automatically
for you.

if you specify your activator in you MANIFEST.MF, then your plugin has
to have access to the .class file from the root. Also, is the stack
trace for your invalid error? Usually it has a "Caused by" in it, for
example having your start(BundleContext) method throw an exception would
kill your plugin.

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Load dynamic plugin [message #324978 is a reply to message #324946] Tue, 05 February 2008 08:47 Go to previous messageGo to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Hi Paul,

My plugin is "Eclipse-LazyStart: true", but it doesn't start. I can see it
in my RCP, but I can use it. When I try start method on my bundle I get a
BundleException. Moreover the used class for Activator is a internal
class, and I acces it with : Bundle-Activator:
package.MyClass$InternalClass.

What can be the problem for a BundleException?

Thanks,
David.
Re: Load dynamic plugin [message #324989 is a reply to message #324978] Tue, 05 February 2008 13:54 Go to previous messageGo to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Paul,

When I export my plugin as a "Deployable plugs-in and fragments", I get a
jar file. And I can load this plugin and use it without problem.
Nevertheless, lots of my plugins are directories and I'm not allowed to
export all my plugins. I use the example of "org.eclipse.ui.tests", but I
can't load a "directory" plugin.

Have I forgotten something?

Thanks.
Re: Load dynamic plugin [message #324992 is a reply to message #324989] Tue, 05 February 2008 14:27 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can load a directory plugin or a jar plugin ... you won't be able to
use this method to load a workspace plugin project, however. Is that
what you are trying to do?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Load dynamic plugin [message #325025 is a reply to message #324992] Wed, 06 February 2008 09:19 Go to previous message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Hi Paul,
Thanks for your help, I am trying to load a plugin from my workspace. Now
I can load directory (exported from my workspace) and jar plugins.

Thanks,
David.
Previous Topic:Create a non focus viewPart on start
Next Topic:Windows Vista: User Access Control (UAC)
Goto Forum:
  


Current Time: Sat Jul 13 19:23:33 GMT 2024

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

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

Back to the top