These are chat archives for fiji/fiji

22nd
Apr 2016
Jean-Yves Tinevez
@tinevez
Apr 22 2016 13:02
@thorstenwagner Any paper to cite for the thorstenwagner/TraJ project?
Curtis Rueden
@ctrueden
Apr 22 2016 13:26
Oh geez, spam on the BugZilla. Definitely time to retire that system!
Ulrik Günther
@skalarproduktraum
Apr 22 2016 17:12
@ctrueden: is there anything like a console window in scijava-commons to use the repl from, instead of stdin/out?
Curtis Rueden
@ctrueden
Apr 22 2016 17:13
Sure, as I said, the scijava-ui-swing project has a GUI.
@skalarproduktraum From a fresh Fiji, try pressing shift+[
Or press L and type "script interpreter"
Or run the ScriptInterpreterTestDrive from scijava-ui-swing.
Some of the languages currently have problems, but I am confident they can all be addressed.
Ulrik Günther
@skalarproduktraum
Apr 22 2016 17:14
awesome, that’s exactly what i was looking for, thanks curtis!
Kyle I S Harrington
@kephale
Apr 22 2016 17:16
clearly you want to be using the Clojure REPL : - D
Ulrik Günther
@skalarproduktraum
Apr 22 2016 17:16
exclusively, of course!
;)
Ulrik Günther
@skalarproduktraum
Apr 22 2016 17:41
mh, at the moment i’m getting an exception:
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at org.scijava.script.ScriptREPL.initialize(ScriptREPL.java:127)
    at org.scijava.ui.swing.script.InterpreterPane.<init>(InterpreterPane.java:88)
do i need to depend on the language plugins explicitly?
i’m basically using the code from scriptinterpretertestdrive
Jean-Yves Tinevez
@tinevez
Apr 22 2016 18:51
@ctrueden shift+[ :+1:
Curtis Rueden
@ctrueden
Apr 22 2016 18:52
@skalarproduktraum Sorry, was away from the browser. Just saw this.
Clojure is currently one of the broken languages.
The scripting-clojure JSR-223 implementation does not handle the bindings correctly, it seems.
You do want to add the scripting-<foo> language(s) of your choice to your project, for them to be available, yes.
OTOH, I'm surprised you got that error because I did implement a dummy test language, available in test scope of scijava-ui-swing (IIRC).
There is a project imagej/imagej-scripting which adds all the scripting-<foo> plugins to the dependencies list.
@tinevez FYI, the problem with the LegacyConsoleService you were receiving is very likely due to the creation of two SciJava contexts at the same time, which are both trying to create their own LegacyService. Unfortunately, this is currently not supported.
Maybe you have an old context somewhere that was never disposed via dispose()?
But you said you got this from main methods... so maybe not.
Jean-Yves Tinevez
@tinevez
Apr 22 2016 18:55
The full messages say that there is an unsupported IJ version.
Kyle I S Harrington
@kephale
Apr 22 2016 18:57
when i accidentally make 2 SciJava contexts i do end up with a LegacyConsoleService error, but the error message is different and does say that it is an attempt to make a duplicate instance
kephale @kephale had just been running into that a couple days ago
Jean-Yves Tinevez
@tinevez
Apr 22 2016 19:01
@ctrueden @kephale here is the full error with 'debug' log level:
Kyle I S Harrington
@kephale
Apr 22 2016 19:02
@skalarproduktraum @ctrueden I think the ScriptREPL thing Ulrik is running into comes from running org.scijava.script.ScriptREPL's main directly and comes from line https://github.com/scijava/scijava-common/blob/master/src/main/java/org/scijava/script/ScriptREPL.java#L127
same thing happens to me
Curtis Rueden
@ctrueden
Apr 22 2016 20:42
@tinevez The key there is:
Cannot load class: ij.ImageJ (loader: sun.misc.Launcher$AppClassLoader@73d16e93)
It appears that this class was already defined in the class loader!
Please make sure that you initialize the LegacyService before using
any ImageJ 1.x class.
This can happen for a variety of reasons.
Does the class in which your main method resides also reference ij.* classes?
Curtis Rueden
@ctrueden
Apr 22 2016 20:57
@kephale @skalarproduktraum Just for you guys: scijava/scijava-common@b430008
Curtis Rueden
@ctrueden
Apr 22 2016 21:06
I also found the dummy test language I implemented. It is part of scijava-ui-swing right now.
I guess I could move it into src/test of scijava-common instead. It's not super exciting though.