Project

General

Profile

Bug #4143

"change failed" error while copy/paste-ing an ImageJ actor

Added by Oliver Soong over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
general
Target version:
Start date:
06/09/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4143

Description

This seems to affect only Windows systems and has to do with saved values in the fileOrURL parameter in the ImageJ actor. It seems to occur when the model run folder contained within the .kepler folder is deleted. To cause this to occur under Windows, create a trivial model (1 SDF, 1 RExpression, 1 ImageJ hooked to the RExpression's graphicsFileName port), run it once, then save it. Close Kepler, clean-cache, and open the model again. The actor cannot be copy/pasted.

The workaround is simply to delete the value in the fileOrURL parameter or find a linux/OSX system.

model.xml (22.8 KB) model.xml Oliver Soong, 06/09/2009 04:22 PM

History

#1 Updated by Oliver Soong over 10 years ago

Copy/paste the ImageJ actor creates an error.

#2 Updated by Christopher Brooks over 10 years ago

I can replicate this under Mac OS X. (thanks for the sample demo, it is a bi
big help)

The stacktrace I get when I paste after clearing the cache is:

ptolemy.kernel.util.IllegalActionException: Error evaluating expression: /Users/cxh/.kepler/model_1244692997781/RExpression1.png
in .copyPaste.ImageJ2.fileOrURL
Because:
problem creating output file (in attributeChanged method)
at ptolemy.data.expr.Variable.validate(Variable.java:1450)
at ptolemy.moml.MoMLParser.endDocument(MoMLParser.java:666)
at com.microstar.xml.XmlParser.doParse(XmlParser.java:162)
at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1394)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1367)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1522)
at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:270)
at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:170)
at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:699)
at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1686)
at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1351)
at org.kepler.gui.KeplerGraphFrame.paste(KeplerGraphFrame.java:1020)
at ptolemy.vergil.basic.BasicGraphFrame$PasteAction.actionPerformed(BasicGraphFrame.java:2814)
at javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3236)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1576)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2772)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2849)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2841)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2735)
at java.awt.Component.processEvent(Component.java:5379)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1826)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:938)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
at java.awt.Component.dispatchEventImpl(Component.java:3941)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

The string "problem creating output file (in attributeChanged method)"
appears in:

./util/src/util/IJMacro.java
./util/src/util/ImageJActor.java
./util/src/util/KeplerImageReader.java

Looking at ImageJActor.java, I see:

} catch (Exception e) {
throw new IllegalActionException("problem creating output file (in attributeChanged method)");
}

There are three problems with this:
1) The thrown exception does not include "this", so the UI won't
be able to indicate which actor has the problem
2) The thrown exception does not include the causing exception.
3) The thrown exception does not include the name of the file

A better version is:

} catch (Exception ex) {
throw new IllegalActionException(this, ex,
"Problem creating the output file \"" +
_file + "\"");
}

Now the exception is:

ptolemy.kernel.util.IllegalActionException: Error evaluating expression: /Users/cxh/.kepler/model_1244692997781/RExpression1.png
in .copyPaste.ImageJ2.fileOrURL
Because:
Problem creating the output file "/Users/cxh/.kepler/model_1244692997781/RExpression1.png"
in .copyPaste.ImageJ2
Because:
No such file or directory
at ptolemy.data.expr.Variable.validate(Variable.java:1450)
at ptolemy.moml.MoMLParser.endDocument(MoMLParser.java:666)
at com.microstar.xml.XmlParser.doParse(XmlParser.java:162)
at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1394)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1367)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1522)
at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:270)
at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:170)
at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:699)
at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1686)
at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1351)
at org.kepler.gui.KeplerGraphFrame.paste(KeplerGraphFrame.java:1020)
at ptolemy.vergil.basic.BasicGraphFrame$PasteAction.actionPerformed(BasicGraphFrame.java:2814)
at javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3236)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1576)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2772)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2849)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2841)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2735)
at java.awt.Component.processEvent(Component.java:5379)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1826)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:938)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
at java.awt.Component.dispatchEventImpl(Component.java:3941)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Gotta run . . .

#3 Updated by Christopher Brooks over 10 years ago

Fixed checking to see if the parent directory exists before creating
the file. I fixed this in IJMacro, ImageJActor and KeplerImageReader.

#4 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4143

Also available in: Atom PDF