PleaseHelp:Could not create action delegate for id... [message #294287] |
Tue, 08 November 2005 21:15 |
Frank Parrott Messages: 52 Registered: July 2009 |
Member |
|
|
Hi,
All I'm trying to do is put a button on the toolbar, when pushed, will
bring up a wizard page.
I'm trying to use the Eclipse Hello world project as a pattern to start
with, but in the plugin.xml file, I remove the menu references. Here's
my plugin.xml :
============
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Sample Action Set"
visible="true"
id="com.cisco.cde.support.actionSet">
<action
label="&Sample Action"
icon="icons/sample.gif"
class="com.cisco.cde.support.actions.SampleAction"
tooltip="Hello, support world"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
id="com.cisco.cde.support.actions.SampleAction1">
</action>
</actionSet>
</extension>
</plugin>
manifest.mf:
============
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CDE Support Plug-in
Bundle-SymbolicName: com.cisco.cde.support; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.cisco.cde.support.SupportPlugin
Bundle-Vendor: CISCO
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources
Eclipse-AutoStart: true
Here's my SampleAction Class which is located under package
com.cisco.cde.support.actions:
=============================
package com.cisco.cde.support.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.jface.dialogs.MessageDialog;
public class SampleAction implements IWorkbenchWindowActionDelegate {
// I have all the required methods defined....
}
When I run my project, and get this:
Could not create action delegate for id:
com.cisco.cde.support.actions.SampleAction1
Reason:
Plug-in com.cisco.cde.support was unable to load class
com.cisco.cde.support.actions.SampleAction.
I don't see anything else reported in the metadat .log file. I don't see
any compileor build errors.
I just don't understand what can be wrong.... The eclipse hello world
plug.xml info seems to work fine. However as soon as I try to replace
the actionSet to point to my class, then I get the above error. I've
even gone back to the run method, and added the "helloworld" code, and
it still can load my class! My project name is com.cisco.cde.support,
containing packages:
com.cisco.cde.support
com.cisco.cde.support.actions
com.cisco.cde.support.wizards
I can't figure out what is wrong. I'm using Eclipse 3.1.1, with JDK1.5_05.
Any help would be greatly appreciated.
frank
|
|
|
Re: PleaseHelp:Could not create action delegate for id... [message #294301 is a reply to message #294287] |
Wed, 09 November 2005 12:29 |
|
Frank Parrott wrote:
> Hi,
>
> All I'm trying to do is put a button on the toolbar, when pushed, will
> bring up a wizard page.
>
> I'm trying to use the Eclipse Hello world project as a pattern to start
> with, but in the plugin.xml file, I remove the menu references. Here's
> my plugin.xml :
You said you remove the menu references, but there's still a reference
in yoru plugin.xml:
> menubarPath="sampleMenu/sampleGroup"
> When I run my project, and get this:
>
> Could not create action delegate for id:
> com.cisco.cde.support.actions.SampleAction1
> Reason:
> Plug-in com.cisco.cde.support was unable to load class
> com.cisco.cde.support.actions.SampleAction.
>
What are the other parts of the of the plugin error. It says it's
unable to load the class because: ClassNotFoundException? NotDefinedError?
Something you can try is to go to your plugin.xml and add a section
actionSet extension ... and when it offers you the HelloWorld template,
select it. Then you'll create a second action set along side your first
one.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: PleaseHelp:Could not create action delegate for id... [message #294308 is a reply to message #294301] |
Wed, 09 November 2005 14:44 |
Frank Parrott Messages: 52 Registered: July 2009 |
Member |
|
|
Hi Paul,
Thanks very much for responding. Please see my comments inline.
Paul Webster wrote:
> Frank Parrott wrote:
>
>> Hi,
>>
>> All I'm trying to do is put a button on the toolbar, when pushed, will
>> bring up a wizard page.
>>
>> I'm trying to use the Eclipse Hello world project as a pattern to
>> start with, but in the plugin.xml file, I remove the menu references.
>> Here's my plugin.xml :
>
>
> You said you remove the menu references, but there's still a reference
> in yoru plugin.xml:
>
> > menubarPath="sampleMenu/sampleGroup"
Sorry, I ment to remove this line. Since I had removed the <menu/> part,
leaving the "menubarPath" causes the error upon runtime launch:
Invalid Menu Extension (Path is invalid):
com.cisco.cde.support.actions.SampleAction1
>
>
>> When I run my project, and get this:
>>
>> Could not create action delegate for id:
>> com.cisco.cde.support.actions.SampleAction1
>> Reason:
>> Plug-in com.cisco.cde.support was unable to load class
>> com.cisco.cde.support.actions.SampleAction.
>>
>
> What are the other parts of the of the plugin error. It says it's
> unable to load the class because: ClassNotFoundException? NotDefinedError?
>
Ok. I was looking in the wrong Error log main Eclipse instance, instead
of the workbench-runtime. So I couple of things going when I click on
the toolbar button.
Here's the first error that occurs:
===================================
org.osgi.framework.BundleException: The activator
com.cisco.cde.support.SupportPlugin for bundle com.cisco.cde.support is
invalid
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:149)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:313)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:264)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:116)
Ok... looks like I was doing something dumb. I wanted to get the plugin
name early and have it global. So I did this in the plugin constructor:
public SupportPlugin() {
plugin = this;
--------> PLUGIN_ID = plugin.getBundle().getSymbolicName();
}
This cause the bundle invalid trace. Once I commented out that line,
everything started to work!
I was confused when I saw "Could not create action delegate for id:"
displaying on the main Eclipse console. So I look in the error log
there, and didn't see any errors. I don't knw why I didn't think to look
at the error log in the workbench-runtime...
Paul, thanks again for help and time!
Regards,
frank
> Something you can try is to go to your plugin.xml and add a section
> actionSet extension ... and when it offers you the HelloWorld template,
> select it. Then you'll create a second action set along side your first
> one.
>
> Later,
> PW
|
|
|
|
Powered by
FUDForum. Page generated in 0.03543 seconds