[Insight-users] WrapITK, Java, Windows and exception

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Dec 17 11:04:33 EST 2009


Le 16 déc. 09 à 09:22, Julien Michel a écrit :

> Dear ITK,
>
> These four does not seem to be friend. On my linux system, when  
> using a java/WrapITK program and providing it with a wrong filename,  
> I got a very informative message corresponding to the unhandled  
> exception, which allows me to understand that the input filename is  
> bad.
>
> On Windows whenever an unhandled exception is thrown, Java crashes  
> with the following message :
>
> #
> # An unexpected error has been detected by Java Runtime Environment:
> #
> #  Internal Error (0xe06d7363), pid=2244, tid=3556
> #
> # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)
> # Problematic frame:
> # C  [kernel32.dll+0x1eb33]
> #
> # An error report file with more information is saved as  
> hs_err_pid2244.log
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> #
>
> I searched for a while, beeing a non-specialist in JNI/Java, before  
> understanding that it was due to the very same exception that on  
> linux.
>
> Any clue on how to enhance exception handling of WrapITK on the  
> windows side ?


Hi Julien,

In python, we have

   %exception {
     try {
       $action
     } catch (const std::out_of_range& e) {
       SWIG_exception_fail(SWIG_IndexError, e.what());
     } catch (const std::exception& e) {
       SWIG_exception_fail(SWIG_RuntimeError, e.what());
     }
   }

in wrap_pyBase.i, to customize the exception handling.

I can't find anything similar in Java directory.

Maybe you should try to add the same kind of customization in  
wrap_javaBase.i or in java.i?
(BTW, those two files should be merged in the future.)

Gaëtan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091217/2b38b01a/attachment.pgp>


More information about the Insight-users mailing list