Posted by
Paul van Schayck on
Jun 25, 2014; 6:13am
URL: http://imagej.273.s1.nabble.com/Headless-ImageJ2-rc2-Analyze-Particles-returns-no-result-tp5008127p5008415.html
Hey Johannes,
On Tue, Jun 24, 2014 at 3:51 PM, Johannes Schindelin
<
[hidden email]> wrote:
> On Tue, 24 Jun 2014, Paul van Schayck wrote:
>
>> On Mon, Jun 23, 2014 at 6:31 PM, Johannes Schindelin
>> It is pretty consistent behaviour in headless mode. It takes about 30s
>> to a minute for it to return to the command line after running a macro
>> or script (only js, not bsh!). It also happens after having run the
>> updater (although the cause may be completely different there I
>> realise). It does not happen in Fiji.daily.
>>
>> This one looks suspicious:
>> java.lang.Thread.State: TIMED_WAITING (parking)
>> at sun.misc.Unsafe.park(Native Method)
>> - parking to wait for <0x000000009d8b0070> (a
>> java.util.concurrent.SynchronousQueue$TransferStack)
>
> Hmm... It looks as if the Context is not correctly disposed of. Is there
> any chance that you can reduce your script to a minimal example of that
> behavior and share that script with us? At least here I cannot reproduce
> with a print("Hello"); script...
This already is a print("hello") script. Which is being run like this:
./ImageJ-linux64 --headless -macro scripts/short.js
For bsh script this only happens when being run with the -macro
options. NOT when being run like this:
./ImageJ-linux64 --headless scripts/short.bsh
I can also reproduce this on another 32 bit system, also running Ubuntu 14.04.
> Ah! That is easily explained. Javascript is included in Java 6. But in a
> different package than Mozilla's original one (this is called "shading"
> and prevents many problems when inconsistent versions of the same
> component are on the same class path).
>
> The launcher assumes the original packages, i.e. the Mozilla ones, but
> that .jar file is only present in Fiji's jars/ directory.
>
> We probably need to integrate the launcher better with the SciJava
> scripting framework (which was designed, after all, to offer a
> consistent interface to all scripting languages); that would fix your
> problem with Javascript, make the command-line support for scripting more
> easily extended (supporting e.g. running .java "scripts" from the
> command-line!), and in general The Right Thing.
>
> Having said that, I still feel that we have a little more work to do in
> the user-centric phase of the work leading to 2.0.0 final, and this change
> strikes me as a developer-centric one.
Thanks for the explanation. Regarding it being a developer-centric
issue. It did confuse the hell out of me at first.
Is it possible to clear up the --help message a bit? The --ij1 and
--ij2 options are quite confusing, and not clear to me. The ij1 -macro
and -batch options are not mentioned. The type of <files> could be
mentioned, so both image files and bsh script files.
Thanks,
Paul
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html