[Insight-users] Linking SimpleITK.dll on 64-bit Windows XP

Ben Horstman bhorstman at mimsoftware.com
Mon Nov 19 12:47:58 EST 2012


Hi Brad,

I'm using 6u32.  I'm not trying to run it from a development environment at all; rather from our runtime application.  I'll admit I've been avoiding setting up a dev environment under windows :P  I did use eclipse to develop the jar which links against ITK (it's an extension to our application, so there's basically two levels of wrapping between our application and the .dll).  Hopefully we can rule out that configuration as the source of the problems, since it works on every other OS except XP64.

Hmm, I was able to run the 32-bit windows version under java 6, but only after I used the jar from the 64-bit version.  I guess maybe it's possible the 64-bit windows version was compiled with a .dll which depends on java 7 but a .jar which has the lesser dependency of java 6?

You said you tried the Windows x86 jdk, but did you try the x64 one?  I am able to run the 32-bit SimpleITK after I swapped in a java 6 compatible jar.  I presume it would also work if I used it as-is and ran my application under java 7.

At any rate, I tried the 64-bit SimpleITK while running our application in the newer java 7u9 64-bit (without any tricky jar swapping).  Still got the same UnsatisfiedLinkError as before, so I guess it's not a java version problem?

~benjamin

************************
Benjamin Philip Horstman
Software Lead - Rho Team
MIM Software Inc.

----- Original Message -----
From: "Bradley Lowekamp" <blowekamp at mail.nih.gov>
To: "Ben Horstman" <bhorstman at mimsoftware.com>
Cc: "Bradley Lowekamp (NIH/NLM/LHC) [C]" <blowekamp at mail.nih.gov>, insight-users at itk.org
Sent: Monday, November 19, 2012 11:34:24 AM
Subject: Re: [Insight-users] Linking SimpleITK.dll on 64-bit Windows XP

Hello,

What Java version are you running on XP? What development environment are you using?

I created a Window XP 64-bit virtual machine. Applied SP2 and patch. Then downloaded the Windows x86 jdk-7u9 from Sun and eclipse. Then I followed instruction here to set up an example:

http://www.itk.org/Wiki/A_visual_guide_to_SimpleITK_in_Java

This seemed to work fine for me.

Brad


On Nov 16, 2012, at 4:33 PM, Ben Horstman <bhorstman at mimsoftware.com> wrote:

> Hi Brad,
> 
> I was able to run the algorithm on Mac OS 10.8 and Windows 7 using the shipped binaries.  I was also able to build the project on ubuntu and run it there.  So my code runs and I get a nice smoothed image as I would expect.  Windows XP is the only place I've had an issue.
> 
> I tried the 32-bit SimpleITK download, and it also failed (with what I believe is a java version mismatch [1]).  So I tried the obvious thing: I used the jars from the 64-bit distribution and the .dll from the 32-bit, and I was actually able to get this chimera to run for the 32-bit version of our application =P
> 
> So, for now, I've asked my user if he can use the 32-bit version as a workaround.  Otherwise I guess I'll have to look into visual studio.
> 
> Thanks for the response,
> ~benjamin
> 
> ************************
> Benjamin Philip Horstman
> Software Lead - Rho Team
> MIM Software Inc.
> 
> [1] Error invoking extension:
>  -- Exception : java.lang.reflect.InvocationTargetException
> 
>  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 com.mimvista.extensions.d.run(d.java:7)
>  at java.lang.Thread.run(Thread.java:662)
>  at com.mimvista.extensions.j.run(j.java:2)
>   caused by:
>  -- Exception : java.lang.UnsupportedClassVersionError
> org/itk/simple/Image : Unsupported major.minor version 51.0
>  at java.lang.ClassLoader.defineClass1(Native Method)
>  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>  at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>  at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>  at com.mimvista.extensions.k.findClass(k.java:6)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>  at com.mimvista.extensions.k.loadClass(k.java:1)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>  at com.mimvista.extensions.k.loadClass(k.java:21)
>  at sample.control.Launcher.applyFilter(Launcher.java:104)
>  at sample.control.Launcher.process(Launcher.java:86)
>  at sample.control.Launcher.runOnSession(Launcher.java:56)
>  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 com.mimvista.extensions.d.run(d.java:7)
>  at java.lang.Thread.run(Thread.java:662)
>  at com.mimvista.extensions.j.run(j.java:2)
> 
> 
> ----- Original Message -----
>> From: "Bradley Lowekamp" <blowekamp at mail.nih.gov>
>> To: "Ben Horstman" <bhorstman at mimsoftware.com>
>> Cc: insight-users at itk.org
>> Sent: Friday, November 16, 2012 2:35:23 PM
>> Subject: Re: [Insight-users] Linking SimpleITK.dll on 64-bit Windows XP
>> 
>> Hello,
>> 
>> Thanks for the information, and let us know where you were successful
>> in addition to your failure. It sounds like there is some other
>> dependent DLL that SimpleITKJava.dll needs that is not on your
>> system.
>> 
>> Have you tried compiling SimpleITK from the source on XP?
>> 
>> http://www.itk.org/Wiki/ITK_Release_4/SimpleITK/GettingStarted#Build_It_Yourself
>> 
>> The Java binaries have been compiled and tested on Windows 7. I would
>> expect SimpleITK to compile just fine with VS9 or VS10 on XP, but I
>> have never tried.
>> 
>> Brad
>> 
>> On Nov 16, 2012, at 12:03 PM, Ben Horstman
>> <bhorstman at mimsoftware.com> wrote:
>> 
>>> Hello all,
>>> 
>>> I have been using the SimpleITK Java bindings to do ansiotropic
>>> diffusion.  I have gotten things to work on Windows 7 64-bit and
>>> Mac OS 10.8 64-bit by using the binaries from the sourceforge
>>> page.  I was also able to compile the linux binaries and run
>>> things under Ubuntu 64-bit.
>>> 
>>> Here is the page I used for the binaries and java files:
>>> http://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/Java/
>>> 
>>> However, I cannot get the 64-bit Windows binaries to work under
>>> Windows XP 64-bit.  Is there anything I can do to work around it?
>>> Is 64-bit XP even supported?
>>> 
>>> Here is the exception I get:
>>> 
>>> CB16-01 Nov-16-2012 10:50:41.843 ERROR
>>> Denoise__Ansiotropic_Diffusion_ failed to link simpleITK
>>> manually...
>>> -- Exception : java.lang.UnsatisfiedLinkError
>>> C:\Documents and Settings\MIM\Local
>>> Settings\Temp\mim3368\extTemp1353081039750\lib\SimpleITKJava.dll:
>>> This application has failed to start because the application
>>> configuration is incorrect. Reinstalling the application may fix
>>> this problem
>>> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>>> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>>> at java.lang.ClassLoader.loadLibrary(Unknown Source)
>>> at java.lang.Runtime.load0(Unknown Source)
>>> at java.lang.System.load(Unknown Source)
>>> at sample.control.Launcher.runOnSession(Launcher.java:51)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>> at com.mimvista.extensions.d.run(d.java:7)
>>> at java.lang.Thread.run(Unknown Source)
>>> at com.mimvista.extensions.j.run(j.java:2)
>>> 
>>> The call I am trying to do is basically "System.load(path)", where
>>> path is the absolute path to the SimpleITKJava dll.  Loading it
>>> explicitly like this doesn't change anything; the error I get from
>>> the Java JNI wrapper trying to link the library is the same.  I'm
>>> reasonably certain it is finding the file, since the error changes
>>> if I make the path wrong.  So my guess is that the .dll is
>>> incompatible somehow...
>>> 
>>> Thanks for reading,
>>> ~benjamin
>>> 
>>> ************************
>>> Benjamin Philip Horstman
>>> Software Lead - Rho Team
>>> MIM Software Inc.
>>> 
>>> _____________________________________
>>> Powered by www.kitware.com
>>> 
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>> 
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>> 
>> 



More information about the Insight-users mailing list