Error in headless mode on Windows 7 with current FIJI/ImageJ installation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in headless mode on Windows 7 with current FIJI/ImageJ installation

John Minter
I have a large number of images to process and would like to use headless
mode. I need to use Windows because that is the approved platform in the
lab. I spent most of the day today getting things working on my macbook
(easier to test code) and tried the working scripts on a Windows system I
have at home and get the same errors on Win 7 x64 with both 64 and 32 bit
installs of Fiji with all updates. I am using Jython scripts and have
pulled all the display functions out. I can't even get a simple
print("Hello World") script to run on Windows in headless mode. Of course,
all the scripts run fine from the Script Editor (and on the macbook.). I am
hoping someone who has headless working on a current install can tell me
what I am doing wrong or if I found a real bug....

This is the command I am running
ImageJ-win64.exe --java-home
"C:\Apps\Fiji.app.win64\java\win64\jdk1.6.0_24\jre" --headless --jython
--console --mem=1000m HelloWorld.py

The executable is in my path. The error is below. I get it with both 64 and
32 bit (with the appropriate JAVA_HOME) and with or without the "--jython"
switch. Nothing happens at all if I leave out "--console". Everything runs
fine on the mac.

Error while executing the main() method of class 'org.python.util.jython':
java.lang.UnsatisfiedLinkError:
C:\Users\jrminter\AppData\Local\Temp\org.scijava
.jython.shaded.jline_2_5_3.dll: The process cannot access the file because
it is
 being used by another process
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at
org.scijava.jython.shaded.jline.WindowsTerminal.loadLibrary(WindowsTerminal.java:315)
        at
org.scijava.jython.shaded.jline.WindowsTerminal.initializeTerminal(WindowsTerminal.java:240)
        at
org.scijava.jython.shaded.jline.Terminal.setupTerminal(Terminal.java:75)
        at org.python.util.JLineConsole.<init>(JLineConsole.java:74)
        at org.python.util.JLineConsole.<init>(JLineConsole.java:58)
        at org.python.util.JLineConsole.<init>(JLineConsole.java:54)
        at org.python.util.jython.newInterpreter(jython.java:347)
        at org.python.util.jython.run(jython.java:168)
        at org.python.util.jython.main(jython.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:258)
        at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
        at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)

Note: Fiji/ImageJ is creating this each time somewhere i the processing
chain.

Best regards,
John Minter

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Error in headless mode on Windows 7 with current FIJI/ImageJ installation

ctrueden
Hi John,

> Nothing happens at all if I leave out "--console".

Right, on Windows, that flag is essential.

> Error while executing the main() method of class 'org.python.util.jython':
> java.lang.UnsatisfiedLinkError:
C:\Users\jrminter\AppData\Local\Temp\org.scijava.jython.shaded.jline_2_5_3.dll:
The process cannot access the file because it is being used by another
process

I did some quick Googling, and it might be an upstream problem with
Jython's usage of JLine. Hard to be certain. You said you cannot switch
away from Windows... but maybe you could use a different scripting language
besides Jython?

Regards,
Curtis

On Sat, Nov 1, 2014 at 9:29 PM, John Minter <[hidden email]> wrote:

> I have a large number of images to process and would like to use headless
> mode. I need to use Windows because that is the approved platform in the
> lab. I spent most of the day today getting things working on my macbook
> (easier to test code) and tried the working scripts on a Windows system I
> have at home and get the same errors on Win 7 x64 with both 64 and 32 bit
> installs of Fiji with all updates. I am using Jython scripts and have
> pulled all the display functions out. I can't even get a simple
> print("Hello World") script to run on Windows in headless mode. Of course,
> all the scripts run fine from the Script Editor (and on the macbook.). I am
> hoping someone who has headless working on a current install can tell me
> what I am doing wrong or if I found a real bug....
>
> This is the command I am running
> ImageJ-win64.exe --java-home
> "C:\Apps\Fiji.app.win64\java\win64\jdk1.6.0_24\jre" --headless --jython
> --console --mem=1000m HelloWorld.py
>
> The executable is in my path. The error is below. I get it with both 64 and
> 32 bit (with the appropriate JAVA_HOME) and with or without the "--jython"
> switch. Nothing happens at all if I leave out "--console". Everything runs
> fine on the mac.
>
> Error while executing the main() method of class 'org.python.util.jython':
> java.lang.UnsatisfiedLinkError:
> C:\Users\jrminter\AppData\Local\Temp\org.scijava
> .jython.shaded.jline_2_5_3.dll: The process cannot access the file because
> it is
>  being used by another process
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>         at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
>         at java.lang.Runtime.load0(Runtime.java:770)
>         at java.lang.System.load(System.java:1003)
>         at
>
> org.scijava.jython.shaded.jline.WindowsTerminal.loadLibrary(WindowsTerminal.java:315)
>         at
>
> org.scijava.jython.shaded.jline.WindowsTerminal.initializeTerminal(WindowsTerminal.java:240)
>         at
> org.scijava.jython.shaded.jline.Terminal.setupTerminal(Terminal.java:75)
>         at org.python.util.JLineConsole.<init>(JLineConsole.java:74)
>         at org.python.util.JLineConsole.<init>(JLineConsole.java:58)
>         at org.python.util.JLineConsole.<init>(JLineConsole.java:54)
>         at org.python.util.jython.newInterpreter(jython.java:347)
>         at org.python.util.jython.run(jython.java:168)
>         at org.python.util.jython.main(jython.java:129)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:258)
>         at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
>         at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
>
> Note: Fiji/ImageJ is creating this each time somewhere i the processing
> chain.
>
> Best regards,
> John Minter
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Error in headless mode on Windows 7 with current FIJI/ImageJ installation

John Minter
Thanks, Curtis. I was afraid of that. Problem is I have a nice library of
python wrapper functions that cover most of my repetitive unit operations
and use python for other projects. Some of what I read suggests java would
be faster. I may have to just put in the time to get efficient in java...

Best regards,
John

On Mon, Nov 17, 2014 at 6:19 PM, Curtis Rueden <[hidden email]> wrote:

> Hi John,
>
> > Nothing happens at all if I leave out "--console".
>
> Right, on Windows, that flag is essential.
>
> > Error while executing the main() method of class
> 'org.python.util.jython':
> > java.lang.UnsatisfiedLinkError:
>
> C:\Users\jrminter\AppData\Local\Temp\org.scijava.jython.shaded.jline_2_5_3.dll:
> The process cannot access the file because it is being used by another
> process
>
> I did some quick Googling, and it might be an upstream problem with
> Jython's usage of JLine. Hard to be certain. You said you cannot switch
> away from Windows... but maybe you could use a different scripting language
> besides Jython?
>
> Regards,
> Curtis
>
> On Sat, Nov 1, 2014 at 9:29 PM, John Minter <[hidden email]> wrote:
>
> > I have a large number of images to process and would like to use headless
> > mode. I need to use Windows because that is the approved platform in the
> > lab. I spent most of the day today getting things working on my macbook
> > (easier to test code) and tried the working scripts on a Windows system I
> > have at home and get the same errors on Win 7 x64 with both 64 and 32 bit
> > installs of Fiji with all updates. I am using Jython scripts and have
> > pulled all the display functions out. I can't even get a simple
> > print("Hello World") script to run on Windows in headless mode. Of
> course,
> > all the scripts run fine from the Script Editor (and on the macbook.). I
> am
> > hoping someone who has headless working on a current install can tell me
> > what I am doing wrong or if I found a real bug....
> >
> > This is the command I am running
> > ImageJ-win64.exe --java-home
> > "C:\Apps\Fiji.app.win64\java\win64\jdk1.6.0_24\jre" --headless --jython
> > --console --mem=1000m HelloWorld.py
> >
> > The executable is in my path. The error is below. I get it with both 64
> and
> > 32 bit (with the appropriate JAVA_HOME) and with or without the
> "--jython"
> > switch. Nothing happens at all if I leave out "--console". Everything
> runs
> > fine on the mac.
> >
> > Error while executing the main() method of class
> 'org.python.util.jython':
> > java.lang.UnsatisfiedLinkError:
> > C:\Users\jrminter\AppData\Local\Temp\org.scijava
> > .jython.shaded.jline_2_5_3.dll: The process cannot access the file
> because
> > it is
> >  being used by another process
> >         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> >         at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
> >         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
> >         at java.lang.Runtime.load0(Runtime.java:770)
> >         at java.lang.System.load(System.java:1003)
> >         at
> >
> >
> org.scijava.jython.shaded.jline.WindowsTerminal.loadLibrary(WindowsTerminal.java:315)
> >         at
> >
> >
> org.scijava.jython.shaded.jline.WindowsTerminal.initializeTerminal(WindowsTerminal.java:240)
> >         at
> > org.scijava.jython.shaded.jline.Terminal.setupTerminal(Terminal.java:75)
> >         at org.python.util.JLineConsole.<init>(JLineConsole.java:74)
> >         at org.python.util.JLineConsole.<init>(JLineConsole.java:58)
> >         at org.python.util.JLineConsole.<init>(JLineConsole.java:54)
> >         at org.python.util.jython.newInterpreter(jython.java:347)
> >         at org.python.util.jython.run(jython.java:168)
> >         at org.python.util.jython.main(jython.java:129)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >         at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:597)
> >         at
> net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:258)
> >         at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)
> >         at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)
> >
> > Note: Fiji/ImageJ is creating this each time somewhere i the processing
> > chain.
> >
> > Best regards,
> > John Minter
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Error in headless mode on Windows 7 with current FIJI/ImageJ installation

Chri2
I ran into the same problem as John Minter-2, with the same error message (config: Windows 8.1 32 bits, Fiji up to date)

Does anybody know if there has been some progress on this issue, or a workaround of some kind, apart from the advice of Curtis ?

Thank you in advance

Christophe

Reply | Threaded
Open this post in threaded view
|

Re: Error in headless mode on Windows 7 with current FIJI/ImageJ installation

ctrueden
Hi Christophe,

> I ran into the same problem as John Minter-2, with the same error
> message (config: Windows 8.1 32 bits, Fiji up to date)
>
> Does anybody know if there has been some progress on this issue, or a
> workaround of some kind, apart from the advice of Curtis ?

Unfortunately, no one has fixed the bug yet. However, we did create an
issue on GitHub so the progress can be tracked.

https://github.com/imagej/imagej/issues/114

A motivated party could probably learn more with some dedicated web
searches, and/or a mail to the jython-users mailing list [1], since it
seems to be a general problem with Jython on Windows.

Regards,
Curtis

[1] https://lists.sourceforge.net/lists/listinfo/jython-users

On Wed, Mar 4, 2015 at 8:47 AM, Chri2 <[hidden email]>
wrote:

> I ran into the same problem as John Minter-2, with the same error message
> (config: Windows 8.1 32 bits, Fiji up to date)
>
> Does anybody know if there has been some progress on this issue, or a
> workaround of some kind, apart from the advice of Curtis ?
>
> Thank you in advance
>
> Christophe
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Error-in-headless-mode-on-Windows-7-with-current-FIJI-ImageJ-installation-tp5010280p5011873.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html