Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Plug-in migration from 2.1 to 3.0.
Plug-in migration from 2.1 to 3.0. [message #259242] Wed, 07 July 2004 15:25 Go to next message
Eclipse UserFriend
Originally posted by: zaitao.li.ca.com

Hi,

I am migrating our plug-in project from 2.1 to 3.0. I have used the PDE
migration tool, after that everything seems fine. My plug-in works fine
except there are some warnings at compile time with regard to deprecated
functionalities in 3.0.

So I started to change my code to get rid off the warnings, one of them is
the plugin constructor:

It's used to be:

public class MyPlugin extends Plugin
{
....
private static MyPlugin s_plugin;
....

/**
* Constructor for MyPlugin.
*/
public CAHCorePlugin(IPluginDescriptor descriptor)
{
super(descriptor);
s_plugin = this;

}
Re: Plug-in migration from 2.1 to 3.0. [message #259260 is a reply to message #259242] Wed, 07 July 2004 15:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zaitao.li.ca.com

Richard wrote:

Hi,

I am migrating our plug-in project from 2.1 to 3.0. I have used the PDE
migration tool, after that everything seems fine. My plug-in works fine
except there are some warnings at compile time with regard to deprecated
functionalities in 3.0.

So I started to change my code to get rid off the warnings, one of them is
the plugin constructor:

It's used to be:

public class MyPlugin extends Plugin
{
....
private static MyPlugin s_plugin;
....

/**
* Constructor for MyPlugin.
*/
public MyPlugin(IPluginDescriptor descriptor)
{
super(descriptor);
s_plugin = this;

}

Since IPluginDescriptor and the constructor MyPlugin(IPluginDescriptor)
are deprecated, I changed the above to:

public class MyPlugin extends Plugin
{
....
private static MyPlugin s_plugin;
....

/**
* Constructor for MyPlugin.
*/
public MyPlugin()
{
super();
s_plugin = this;

}

After the change, the project is built fine. But at run time, eclipse is
not able to initiate my plugin, it seems eclipse is still looking for the
older constructor, I know I may missing something trivial here, but what
am I missing?

Following is the error dump in eclipse:

java.lang.NoSuchMethodException:
com.me.MyPlugin.<init>(org.eclipse.core.runtime.IPluginDescriptor)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at
org.eclipse.core.internal.plugins.PluginDescriptor.internalD oPluginActivation(PluginDescriptor.java:403)
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:359)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:328)
at
org.eclipse.core.internal.compatibility.PluginActivator.star t(PluginActivator.java:47)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:958)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:954)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:937)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:421)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:293)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:110)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:371)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.requir eClass(BundleLoader.java:336)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findRe quiredClass(BundleLoader.java:914)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:399)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:93)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at
org.eclipse.core.internal.plugins.PluginDescriptor.internalD oPluginActivation(PluginDescriptor.java:403)
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:359)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:328)
at
org.eclipse.core.internal.compatibility.PluginActivator.star t(PluginActivator.java:47)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:958)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:954)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:937)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:421)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:293)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:110)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:371)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:402)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:93)
at java.lang.ClassLoader.loadClass(Unknown Source)
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.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:196)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:51)
at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java:193)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefin ition$1.run(LightweightDecoratorDefinition.java:83)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:615)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefin ition.internalGetDecorator(LightweightDecoratorDefinition.ja va:79)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorDefin ition.decorate(LightweightDecoratorDefinition.java:153)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er$LightweightRunnable.run(LightweightDecoratorManager.java: 60)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:615)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.decorate(LightweightDecoratorManager.java:258)
at
org.eclipse.ui.internal.decorators.LightweightDecoratorManag er.getDecorations(LightweightDecoratorManager.java:241)
at
org.eclipse.ui.internal.decorators.DecorationScheduler$1.run (DecorationScheduler.java:264)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Re: Plug-in migration from 2.1 to 3.0. [message #259262 is a reply to message #259260] Wed, 07 July 2004 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Make sure you remove runtime.compatibility as a required plugin. Also
make sure that your plugin.xml starts with:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>


--
Thanks, Rich Kulp

Re: Plug-in migration from 2.1 to 3.0. [message #259275 is a reply to message #259262] Wed, 07 July 2004 16:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zaitao.li.ca.com

Rich Kulp wrote:

> Make sure you remove runtime.compatibility as a required plugin. Also
> make sure that your plugin.xml starts with:

> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>

Thanks for your help.

The plugin.xml does start with the right heading. I also manually removed
the compatibility as a required plugin, and added the following line to
the plugin.xml:

<import plugin="org.eclipse.sigi"/>
Re: Plug-in migration from 2.1 to 3.0. [message #259389 is a reply to message #259275] Wed, 07 July 2004 20:13 Go to previous messageGo to next message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
This may or may not help but the doc says to import org.eclipse.core.runtime
and not org.eclipse.osgi.* .

http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.platform.doc.isv/porting/eclipse_3_0_porting_guide.html


--
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

"Richard" <zaitao.li@ca.com> wrote in message
news:cch6pg$gtj$1@eclipse.org...
> The plugin.xml does start with the right heading. I also manually removed
> the compatibility as a required plugin, and added the following line to
> the plugin.xml:
>
> <import plugin="org.eclipse.sigi"/>
Re: Plug-in migration from 2.1 to 3.0. [message #259398 is a reply to message #259389] Wed, 07 July 2004 20:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zaitao.li.ca.com

Ed Burnette wrote:

> This may or may not help but the doc says to import org.eclipse.core.runtime
> and not org.eclipse.osgi.* .

>
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.platform.doc.isv/porting/eclipse_3_0_porting_guide.html


I have also imported org.eclipse.core.runtime in my plugin.xml.
Re: Plug-in migration from 2.1 to 3.0. [message #259456 is a reply to message #259398] Thu, 08 July 2004 03:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wassimm.ca.ibm.com

Moving off the core.runtime.compatibility dependency is not a requirement
in 3.0.

However, if you choose to do so, as you have noticed, you will have to
modify the code in your plug-in's top-level Java class.

I suggest you generate a sample Hello World plug-in project using PDE,
examine what the generated code for this sample plug-in's class looks like
and do the same for your plug-in.

Wassim.


Richard wrote:

> Ed Burnette wrote:

> > This may or may not help but the doc says to import
org.eclipse.core.runtime
> > and not org.eclipse.osgi.* .

> >
>
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.platform.doc.isv/porting/eclipse_3_0_porting_guide.html


> I have also imported org.eclipse.core.runtime in my plugin.xml.
Re: Plug-in migration from 2.1 to 3.0. [message #260263 is a reply to message #259456] Fri, 09 July 2004 20:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zaitao.li.ca.com

I have checked the source for sample helloworld plug-in and can not see
any difference between my plugin and the sample.

An even stranger thing I found out is that, my plug-in runs perfect if I
run it from my eclipse project. But if I use the eclipse export
functionality to export the plugin and copy it to the plugins directory in
eclipse, the problem will occur.







Wassim Melhem wrote:

> Moving off the core.runtime.compatibility dependency is not a requirement
> in 3.0.

> However, if you choose to do so, as you have noticed, you will have to
> modify the code in your plug-in's top-level Java class.

> I suggest you generate a sample Hello World plug-in project using PDE,
> examine what the generated code for this sample plug-in's class looks like
> and do the same for your plug-in.

> Wassim.


> Richard wrote:

> > Ed Burnette wrote:

> > > This may or may not help but the doc says to import
> org.eclipse.core.runtime
> > > and not org.eclipse.osgi.* .

> > >
> >
>
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.platform.doc.isv/porting/eclipse_3_0_porting_guide.html


> > I have also imported org.eclipse.core.runtime in my plugin.xml.
Re: Plug-in migration from 2.1 to 3.0. [message #260838 is a reply to message #260263] Mon, 12 July 2004 18:06 Go to previous message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.ok

Try launching Eclipse with -clean.

Richard wrote:

> I have checked the source for sample helloworld plug-in and can not see
> any difference between my plugin and the sample.

> An even stranger thing I found out is that, my plug-in runs perfect if I
> run it from my eclipse project. But if I use the eclipse export
> functionality to export the plugin and copy it to the plugins directory in
> eclipse, the problem will occur.







> Wassim Melhem wrote:

> > Moving off the core.runtime.compatibility dependency is not a requirement
> > in 3.0.

> > However, if you choose to do so, as you have noticed, you will have to
> > modify the code in your plug-in's top-level Java class.

> > I suggest you generate a sample Hello World plug-in project using PDE,
> > examine what the generated code for this sample plug-in's class looks like
> > and do the same for your plug-in.

> > Wassim.


> > Richard wrote:

> > > Ed Burnette wrote:

> > > > This may or may not help but the doc says to import
> > org.eclipse.core.runtime
> > > > and not org.eclipse.osgi.* .

> > > >
> > >
> >
>
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.ecli pse.platform.doc.isv/porting/eclipse_3_0_porting_guide.html


> > > I have also imported org.eclipse.core.runtime in my plugin.xml.
Previous Topic:Status of plugin.xml in Eclipse 3.0 in respect to OSGi bundle manifest
Next Topic:How can I control the location of the runtime workbench workspace?
Goto Forum:
  


Current Time: Wed Jan 15 15:37:46 GMT 2025

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

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

Back to the top