NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #856 (closed defect: fixed)

Opened 2011-11-01T09:32:07-05:00

Last modified 2011-11-08T11:31:57-06:00

Exception when running an IJ2 plugin that has parameters with no image

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-b1-initial
Component: Plugin Framework Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Start IJ2. Have NO image open. Run Process > Math > Subtract. An exception is thrown (if the plugin has ever run before and saved preferences):

[WARN ] Cannot convert 'imagej.ui.swing.sdi.display.SwingSdiImageDisplay@7036bb0a' to imagej.data.display.ImageDisplay
java.lang.NoSuchMethodException: imagej.data.display.ImageDisplay.<init>(java.lang.String)

at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at imagej.util.ClassUtils.convert(ClassUtils.java:102)
at imagej.ext.module.AbstractModuleItem.loadValue(AbstractModuleItem.java:145)
at imagej.ext.module.ui.AbstractInputHarvester.addInput(AbstractInputHarvester.java:130)
at imagej.ext.module.ui.AbstractInputHarvester.buildPanel(AbstractInputHarvester.java:84)
at imagej.ext.module.ui.AbstractInputHarvester.harvest(AbstractInputHarvester.java:66)
at imagej.ext.plugin.AbstractInputHarvesterPlugin.process(AbstractInputHarvesterPlugin.java:75)
at imagej.ext.module.ModuleRunner.preProcess(ModuleRunner.java:88)
at imagej.ext.module.ModuleRunner.run(ModuleRunner.java:140)
at imagej.ext.module.ModuleRunner.call(ModuleRunner.java:118)
at imagej.ext.module.ModuleRunner.call(ModuleRunner.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

Change History

comment:1 Changed 2011-11-08T10:39:33-06:00 by curtis

(In [4322]) Fix up parameter attributes.

Set visibility to private when possible. For ImageDisplay parameters,
set to required=true and persist=false, to avoid runtime exceptions.
For related tickets, see #838 and #856.

comment:2 Changed 2011-11-08T11:31:53-06:00 by curtis

Fixed in b1e04b7a33e2997aa7ef98d2d1f9bf46fdb8abe1.

comment:3 Changed 2011-11-08T11:31:57-06:00 by curtis

  • Status changed from new to closed
  • Resolution set to fixed