eclipselabs / passerelle

Passerelle, an actor-based process engine based on Ptolemy II
5 stars 3 forks source link

Adding an EDNA actor to a composite triggers an exception #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new composite
2. Add an EDNA actor like "Thumbnail Image" to the composite
3. Click on the actor

What is the expected output? What do you see instead?

The expected behavior is to have no stack trace.
The observed behavior is that the following stack trace can be found in the 
console:

11:07:37.552 [main] ERROR o.d.p.c.a.AbstractPassModeTransformer - Cannot get 
the project for actor Thumbnail Image
java.lang.ClassCastException: org.eclipse.core.internal.resources.WorkspaceRoot 
cannot be cast to org.eclipse.core.resources.IProject
    at com.isencia.passerelle.workbench.model.utils.ModelUtils.getProject(ModelUtils.java:431) [com.isencia.passerelle.workbench.model/:na]
    at org.dawb.passerelle.common.actors.AbstractPassModeTransformer.getProject(AbstractPassModeTransformer.java:378) [org.dawb.passerelle.common/:na]
    at org.dawb.passerelle.actors.edna.AbstractEdnaPlugin.getEdnaXmlFolder(AbstractEdnaPlugin.java:610) [org.dawb.passerelle.actors/:na]
    at org.dawb.passerelle.actors.edna.AbstractEdnaPlugin.getLinkerFile(AbstractEdnaPlugin.java:492) [org.dawb.passerelle.actors/:na]
    at org.dawb.passerelle.actors.edna.AbstractEdnaPlugin.getResource(AbstractEdnaPlugin.java:440) [org.dawb.passerelle.actors/:na]
    at com.isencia.passerelle.workbench.model.editor.ui.editor.actions.OpenFileAction.getResourceObject(OpenFileAction.java:129) [com.isencia.passerelle.workbench.model.editor.ui/:na]
    at com.isencia.passerelle.workbench.model.editor.ui.editor.actions.OpenFileAction.calculateEnabled(OpenFileAction.java:59) [com.isencia.passerelle.workbench.model.editor.ui/:na]
    at org.eclipse.gef.ui.actions.WorkbenchPartAction.refresh(WorkbenchPartAction.java:131) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.actions.SelectionAction.handleSelectionChanged(SelectionAction.java:89) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.actions.SelectionAction.setSelection(SelectionAction.java:101) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at com.isencia.passerelle.workbench.model.editor.ui.editor.actions.OpenFileAction.setSelection(OpenFileAction.java:48) [com.isencia.passerelle.workbench.model.editor.ui/:na]
    at org.eclipse.gef.ui.actions.SelectionAction.update(SelectionAction.java:124) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.parts.GraphicalEditor.updateActions(GraphicalEditor.java:458) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at com.isencia.passerelle.workbench.model.editor.ui.editor.PasserelleModelEditor.selectionChanged(PasserelleModelEditor.java:177) [com.isencia.passerelle.workbench.model.editor.ui/:na]
    at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.part.MultiPageSelectionProvider$1.run(MultiPageSelectionProvider.java:110) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) [org.eclipse.equinox.common_3.6.0.v20110523.jar:na]
    at org.eclipse.ui.part.MultiPageSelectionProvider.fireEventChange(MultiPageSelectionProvider.java:108) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.part.MultiPageSelectionProvider.fireSelectionChanged(MultiPageSelectionProvider.java:90) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.part.MultiPageEditorSite.handleSelectionChanged(MultiPageEditorSite.java:452) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.part.MultiPageEditorSite$4.selectionChanged(MultiPageEditorSite.java:368) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:144) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:83) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.tools.SelectEditPartTracker.performSelection(SelectEditPartTracker.java:221) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348) [org.eclipse.gef_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523) [org.eclipse.draw2d_3.7.1.v20110830-1143.jar:na]
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:191) [org.eclipse.swt.gtk.linux.x86_64_3.7.1.v3738a.jar:na]
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) [org.eclipse.swt.gtk.linux.x86_64_3.7.1.v3738a.jar:na]
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) [org.eclipse.swt.gtk.linux.x86_64_3.7.1.v3738a.jar:na]
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588) [org.eclipse.swt.gtk.linux.x86_64_3.7.1.v3738a.jar:na]
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209) [org.eclipse.swt.gtk.linux.x86_64_3.7.1.v3738a.jar:na]
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) [org.eclipse.core.databinding.observable_1.4.0.I20110222-0800.jar:na]
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) [org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar:na]
    at org.edna.workbench.application.Application.start(Application.java:80) [org.dawb.workbench.application/:na]
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) [org.eclipse.equinox.app_1.3.100.v20110321.jar:na]
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) [org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar:na]
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) [org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar:na]
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) [org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar:na]
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) [org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_26]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_26]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_26]
    at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_26]
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) [org.eclipse.equinox.launcher_1.2.0.v20110502.jar:na]
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) [org.eclipse.equinox.launcher_1.2.0.v20110502.jar:na]
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410) [org.eclipse.equinox.launcher_1.2.0.v20110502.jar:na]
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386) [org.eclipse.equinox.launcher_1.2.0.v20110502.jar:na]

What version of the product are you using? On what operating system?

Latest SVN trunk of Passerelle and DAWB. Observed on both Linux and Windows.

Please provide any additional information below.

This works in the DAWB forks of the passerelle plugins. Thanks in advance for 
help!

Original issue reported on code.google.com by s.olof.svensson@gmail.com on 21 Nov 2011 at 10:10

GoogleCodeExporter commented 9 years ago
Just two small comments:

- The same problem happens with the Python actor

- Of course the stack trace is not the real problem but just the symptom: the 
real problem is that neither the EDNA nor the Python actors behave as they 
should: they don't create the default files needed for their execution.

Original comment by s.olof.svensson@gmail.com on 21 Nov 2011 at 10:23

GoogleCodeExporter commented 9 years ago
At first sight it seems that the Python & EDNA actors seem to need to be aware 
of which project the model is defined in? 

Such a concept is not compatible with a generic model execution support.
The concept of "project", especially the convention that this maps to a 
directory, is specific for eclipse and is unknown in other Passerelle design 
UIs or execution environments.

Magical paths are better made configurable or defined in a more standard way...
We can discuss about a more open and generic mechanism to store "resources" 
like scripts etc?

We'll check out how to avoid the ClassCastException.

Original comment by erwin...@gmail.com on 22 Nov 2011 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by erwin...@gmail.com on 22 Nov 2011 at 8:49

GoogleCodeExporter commented 9 years ago
I found a solution to this problem, see the attached patch. With this patch at 
least the EDNA actors works fine in composites! I still have a problem with 
Python actors but there the problem is in DAWB code.

Original comment by s.olof.svensson@gmail.com on 22 Nov 2011 at 9:14

Attachments:

GoogleCodeExporter commented 9 years ago
Patch has been committed and tested in the base Passerelle Workbench.

Can you verify it in DAWB?

(change in project com.isencia.passerelle.workbench.model)

tx
erwin

Original comment by erwin...@gmail.com on 23 Nov 2011 at 11:55

GoogleCodeExporter commented 9 years ago
Yes, the changes to com.isencia.passerelle.workbench.model has fixed the 
problem. Thanks a lot for the help!

Original comment by s.olof.svensson@gmail.com on 23 Nov 2011 at 1:47

GoogleCodeExporter commented 9 years ago

Original comment by erwin...@gmail.com on 23 Nov 2011 at 2:21