Problems with ImageJ2 tools

Hi!
I am trying to use some imaging tools and I am experiencing a problem with the ones based on imagej2. Although the analysis is running trough, the tool is creating a 0 bytes image and giving the info:

JRE not found in ‘/usr/local/tools/_conda/envs/mulled-v1-5546a3fafd89b65a927f1cc651068c6933cc2760c472e4b65d5fd69f355acdb4/share/jre’
JAVA_HOME contains a JRE: '/usr/local/tools/_conda/envs/mulled-v1-55

I tried with different ones and the outcome is always the same.

We debugged it during our hackathon and found this complete error message:

java.lang.IllegalArgumentException: Cannot handle app name in ij.gui.YesNoCancelDialog's public <init>(java.awt.Frame parent, java.lang.String title, java.lang.String msg)
	at net.imagej.patcher.CodeHacker.replaceAppNameInCall(CodeHacker.java:446)
	at net.imagej.patcher.LegacyExtensions.insertAppNameHooks(LegacyExtensions.java:419)
	at net.imagej.patcher.LegacyExtensions.injectHooks(LegacyExtensions.java:291)
	at net.imagej.patcher.LegacyInjector.inject(LegacyInjector.java:308)
	at net.imagej.patcher.LegacyInjector.injectHooks(LegacyInjector.java:109)
	at net.imagej.patcher.LegacyEnvironment.initialize(LegacyEnvironment.java:101)
	at net.imagej.patcher.LegacyEnvironment.applyPatches(LegacyEnvironment.java:495)
	at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:397)
	at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:376)
	at fiji.IJ1Patcher.run(IJ1Patcher.java:37)
	at net.imagej.launcher.ClassLauncher.patchIJ1(ClassLauncher.java:216)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:155)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
Caused by: javassist.CannotCompileException: No code replaced!
	at net.imagej.patcher.CodeHacker$EagerExprEditor.instrument(CodeHacker.java:1280)
	at net.imagej.patcher.CodeHacker.replaceAppNameInCall(CodeHacker.java:443)
	... 12 more
Launching main class org.python.util.jython with parameters [/opt/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/imagej2_make_binary/d3e8ef83f3bf/imagej2_make_binary/imagej2_make_binary_jython_script.py, output_log.txt, /data/dnb09/galaxy_db/files/2/9/5/dataset_295e5849-20e5-4dc8-ad57-079d1f83b840.dat, 1, 1, yes, yes, output.tiff, tiff]
Class loader = sun.misc.Launcher$AppClassLoader@764c12b6
java.lang.NullPointerException
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirectories(EssentialLegacyHooks.java:157)
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirectories(EssentialLegacyHooks.java:160)
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirs(EssentialLegacyHooks.java:129)
	at ij.IJ.getClassLoader(IJ.java)
	at ij.io.Opener.<clinit>(Opener.java:50)
	at ij.IJ.openImage(IJ.java:1664)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:461)
	at org.python.core.PyObject.__call__(PyObject.java:465)
	at org.python.pycode._pyx0.f$0(/opt/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/imagej2_make_binary/d3e8ef83f3bf/imagej2_make_binary/imagej2_make_binary_jython_script.py:36)
	at org.python.pycode._pyx0.call_function(/opt/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/imagej2_make_binary/d3e8ef83f3bf/imagej2_make_binary/imagej2_make_binary_jython_script.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1386)
	at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:296)
	at org.python.util.jython.run(jython.java:362)
	at org.python.util.jython.main(jython.java:142)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
java.lang.NullPointerException
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirectories(EssentialLegacyHooks.java:157)
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirectories(EssentialLegacyHooks.java:160)
	at net.imagej.patcher.EssentialLegacyHooks.missingSubdirs(EssentialLegacyHooks.java:129)
	at ij.IJ.init(IJ.java:363)
	at ij.IJ.run(IJ.java:349)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:496)
	at org.python.core.PyObject.__call__(PyObject.java:500)
	at org.python.pycode._pyx0.f$0(/opt/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/imagej2_make_binary/d3e8ef83f3bf/imagej2_make_binary/imagej2_make_binary_jython_script.py:36)
	at org.python.pycode._pyx0.call_function(/opt/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/imagej2_make_binary/d3e8ef83f3bf/imagej2_make_binary/imagej2_make_binary_jython_script.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1386)
	at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:296)
	at org.python.util.jython.run(jython.java:362)
	at org.python.util.jython.main(jython.java:142)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)

It looks like it is dependent on the input data. With the tool test data this seems to work.

1 Like