r35696 - in /packages/scilab/trunk/debian: changelog control modelicac.1 patches/exitincode.diff patches/missingaddchapter.diff patches/typo.diff rules scilab.1 scilab.desktop

sylvestre-guest at users.alioth.debian.org sylvestre-guest at users.alioth.debian.org
Tue Apr 28 08:46:51 UTC 2009


Author: sylvestre-guest
Date: Tue Apr 28 08:46:50 2009
New Revision: 35696

URL: http://svn.debian.org/wsvn/debian-science/?sc=1&rev=35696
Log:
  * Fix warnings in the manpages (modelicac.1 & scilab.1)
  * Fix a few typo in the code (typo.diff)
  * Remove some exit() in some libs of Scilab (exitincode.diff)
  * Encoding removed from scilab.desktop (it is now the default encoding)
  * call_scilab documentation was not correctly loaded (missingaddchapter.diff)
  * change of the order of the dependencies of the numerical deps (didn't work buildd)
  * Build-dep atlas3-base-dev renamed to libatlas-base-dev


Added:
    packages/scilab/trunk/debian/patches/exitincode.diff
    packages/scilab/trunk/debian/patches/missingaddchapter.diff
    packages/scilab/trunk/debian/patches/typo.diff
Modified:
    packages/scilab/trunk/debian/changelog
    packages/scilab/trunk/debian/control
    packages/scilab/trunk/debian/modelicac.1
    packages/scilab/trunk/debian/rules
    packages/scilab/trunk/debian/scilab.1
    packages/scilab/trunk/debian/scilab.desktop

Modified: packages/scilab/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/changelog?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/changelog (original)
+++ packages/scilab/trunk/debian/changelog Tue Apr 28 08:46:50 2009
@@ -1,3 +1,15 @@
+scilab (5.1.1-3) unstable; urgency=low
+
+  * Fix warnings in the manpages (modelicac.1 & scilab.1)
+  * Fix a few typo in the code (typo.diff)
+  * Remove some exit() in some libs of Scilab (exitincode.diff)
+  * Encoding removed from scilab.desktop (it is now the default encoding)
+  * call_scilab documentation was not correctly loaded (missingaddchapter.diff)
+  * change of the order of the dependencies of the numerical deps (didn't work buildd)
+  * Build-dep atlas3-base-dev renamed to libatlas-base-dev
+
+ -- Sylvestre Ledru <sylvestre.ledru at inria.fr>  Mon, 27 Apr 2009 14:51:57 +0200
+
 scilab (5.1.1-2) unstable; urgency=low
 
   * More windows-devel-file-in-package lintian ignored 

Modified: packages/scilab/trunk/debian/control
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/control?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/control (original)
+++ packages/scilab/trunk/debian/control Tue Apr 28 08:46:50 2009
@@ -8,7 +8,7 @@
  tcl8.5-dev, tk8.5-dev, libxml2-dev, libpcre3-dev, 
  gettext, libreadline-dev, pkg-config,
 # numerical libraries
- librefblas3-dev | libblas-dev | atlas3-base-dev, liblapack-dev, 
+ libblas-dev | librefblas3-dev | libatlas-base-dev, liblapack-dev, 
 # Java deps
  libflexdock-java (>= 0.5.1), libjogl-java (>= 1.1.1), 
  libjrosetta-java (>= 1.0.1), ant,

Modified: packages/scilab/trunk/debian/modelicac.1
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/modelicac.1?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/modelicac.1 (original)
+++ packages/scilab/trunk/debian/modelicac.1 Tue Apr 28 08:46:50 2009
@@ -15,12 +15,12 @@
 .TP
 .B \-o outputfile
 Set output file name to <outputfile> (this option also works
-with -c option but is somewhat useless because of the class
+with \-c option but is somewhat useless because of the class
 name restrictions given above).
 .TP
 .B \-L directory
 Add <directory> to the list of directories to be searched when
-producing a C file (no effect when used with -c).
+producing a C file (no effect when used with \-c).
 .TP
 .B \-hpath directory
 Specify a path to be added to #include directives in the
@@ -36,7 +36,7 @@
 Do not remove any parameter
 .TP
 .B \-no-simplifs
-Same as -keep-all-variables -no-parameter-removal
+Same as \-keep\-all\-variables \-no\-parameter\-removal
 .TP
 .B \-trace filename
 Generate tracing information for external function calls

Added: packages/scilab/trunk/debian/patches/exitincode.diff
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/patches/exitincode.diff?rev=35696&op=file
==============================================================================
--- packages/scilab/trunk/debian/patches/exitincode.diff (added)
+++ packages/scilab/trunk/debian/patches/exitincode.diff Tue Apr 28 08:46:50 2009
@@ -1,0 +1,8528 @@
+commit ada3c2971060f5b9e9b663e1d1ce47be56df2302
+Author: Sylvestre Ledru <sylvestre.ledru at scilab.org>
+Date:   Mon Apr 27 14:21:20 2009 +0200
+
+    Generation of the C++ => Java code with GIWS 1.0.2
+
+diff --git a/scilab/CHANGES_5.1.X b/scilab/CHANGES_5.1.X
+index 7426809..633b0cc 100644
+--- a/scilab/CHANGES_5.1.X
++++ b/scilab/CHANGES_5.1.X
+@@ -9,6 +9,9 @@ Compilation:
+   -Xcheck:jni) in order to provide more feedbacks on debug
+   Note that this should be used into a binary since it is expensive
+ 
++* C++ => Java connector updated (using GIWS - 
++  http://www.scilab.org/giws/ version 1.0.2)
++
+ Source reorganisation:
+ ======================
+ 
+diff --git a/scilab/modules/console/src/jni/CallScilabBridge.cpp b/scilab/modules/console/src/jni/CallScilabBridge.cpp
+index 426f482..b972a1e 100644
+--- a/scilab/modules/console/src/jni/CallScilabBridge.cpp
++++ b/scilab/modules/console/src/jni/CallScilabBridge.cpp
+@@ -1,5 +1,5 @@
+ #include "CallScilabBridge.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ jbooleanisWaitingForInputID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void CallScilabBridge::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CallScilabBridge");
+ }
+ }
+ 
+-
+ void CallScilabBridge::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CallScilabBridge");
+ }
+ }
+-
+ // Method(s)
+ 
+ void CallScilabBridge::display (JavaVM * jvm_, char * dataToDisplay){
+diff --git a/scilab/modules/console/src/jni/CallScilabBridge.hxx b/scilab/modules/console/src/jni/CallScilabBridge.hxx
+index 018c09e..060ccfb 100644
+--- a/scilab/modules/console/src/jni/CallScilabBridge.hxx
++++ b/scilab/modules/console/src/jni/CallScilabBridge.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/console/src/jni/GiwsException.cpp b/scilab/modules/console/src/jni/GiwsException.cpp
+index fc4d53c..234e52b 100644
+--- a/scilab/modules/console/src/jni/GiwsException.cpp
++++ b/scilab/modules/console/src/jni/GiwsException.cpp
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -47,7 +47,7 @@ namespace GiwsException {
+ */
+ JniException::JniException(JNIEnv * curEnv) throw() : exception()
+ {
+-// retrieve informations about the exception
++// retrieve information about the exception
+ javaException = curEnv->ExceptionOccurred();
+ /* Clear the Java Exception to avoid calling it again & again */
+ curEnv->ExceptionClear();
+@@ -122,7 +122,7 @@ std::string JniException::retrieveExceptionMessage(JNIEnv * curEnv)
+ {
+ // return the result of the getLocalizedMessage method
+ 
+-// retrieve informations from the exception.
++// retrieve information from the exception.
+ // get method id
+ jmethodID getLocalizedMessageId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+                                                "getLocalizedMessage",
+@@ -153,7 +153,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+ 
+     // return the result of the getStackTrace method
+ 
+-    // retrieve informations from the exception.
++    // retrieve information from the exception.
+     // get method id
+     // getStackTrace returns an array of StackTraceElement
+     jmethodID getStackTraceId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+@@ -242,9 +242,9 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   }
+ 
+   /**
+-   * To be called when all the informations about the exceptions have been
++   * To be called when all the information about the exceptions have been
+    * retrived.
+-   * Remove the exception from the environement.
++   * Remove the exception from the environment.
+    */
+   void JniException::closeException(JNIEnv * curEnv)
+   {
+@@ -293,7 +293,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   */
+   
+   /**
+-  * @pram curEnv java environment where the exception occured.
++  * @param curEnv java environment where the exception occured.
+   */
+   JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv)
+   {
+@@ -305,7 +305,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   
+   JniCallMethodException::~JniCallMethodException(void) throw() {}
+   /**
+-  * @pram className name of the class which haven't been found
++  * @param className name of the class which haven't been found
+   */
+   JniClassNotFoundException::JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -316,7 +316,7 @@ setErrorMessage(errorMessage);
+   JniClassNotFoundException::~JniClassNotFoundException(void) throw() {}
+ 
+   /**
+-   * @pram className name of the method which haven't been found
++   * @param className name of the method which haven't been found
+    */
+   JniMethodNotFoundException::JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw() : JniException(curEnv)
+   {
+@@ -325,8 +325,9 @@ setErrorMessage(errorMessage);
+   }
+ 
+   JniMethodNotFoundException::~JniMethodNotFoundException(void) throw() {}
++  
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniObjectCreationException::JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -336,6 +337,17 @@ setErrorMessage(errorMessage);
+ 
+   JniObjectCreationException::~JniObjectCreationException(void) throw() {}
+ 
++  /**
++   * @param curEnv java envirnonment where the exception occured.
++   */
++  JniMonitorException::JniMonitorException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
++  {
++std::string errorMessage = "Error in the access (Enter or exit) or a Java env monitor of class " + className + ".";
++setErrorMessage(errorMessage);
++  }
++
++  JniMonitorException::~JniMonitorException(void) throw() {}
++
+ 
+ 
+ }
+diff --git a/scilab/modules/console/src/jni/GiwsException.hxx b/scilab/modules/console/src/jni/GiwsException.hxx
+index a2be211..73f8175 100644
+--- a/scilab/modules/console/src/jni/GiwsException.hxx
++++ b/scilab/modules/console/src/jni/GiwsException.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,9 +129,9 @@ std::string retrieveStackTrace(JNIEnv * curEnv);
+ */
+ std::string retrieveExceptionName(JNIEnv * curEnv);
+ /**
+-* To be called when all the informations about the exceptions have been
++* To be called when all the information about the exceptions have been
+ * retrived.
+-* Remove the exception from the environement.
++* Remove the exception from the environment.
+ */
+ void closeException(JNIEnv * curEnv);
+ 
+@@ -164,7 +164,7 @@ class JniCallMethodException : public JniException
+ public:
+ 
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniCallMethodException(JNIEnv * curEnv) throw();
+ 
+@@ -179,7 +179,7 @@ class JniClassNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the class which haven't been found
++* @param className name of the class which haven't been found
+ */
+ JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw();
+ 
+@@ -195,7 +195,7 @@ class JniMethodNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the method which haven't been found
++* @param className name of the method which haven't been found
+ */
+ JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw();
+ virtual ~JniMethodNotFoundException(void) throw();
+@@ -213,7 +213,7 @@ class JniObjectCreationException : public JniException
+ public:
+ 
+ /**
+-* @pram curEnv java envirnonment where the exception occured.
++* @param curEnv java envirnonment where the exception occured.
+ */
+ JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw();
+ virtual ~JniObjectCreationException(void) throw();
+@@ -221,6 +221,23 @@ virtual ~JniObjectCreationException(void) throw();
+ };
+ 
+ 
++/**
++* Exception that should be thrown when a call to the Java monitor
++* failed
++*/
++class JniMonitorException : public JniException
++{
++public:
++
++/**
++* @param curEnv java envirnonment where the exception occured.
++*/
++JniMonitorException(JNIEnv * curEnv, const std::string & className) throw();
++virtual ~JniMonitorException(void) throw();
++
++};
++
++
+ }
+ #endif
+ 
+diff --git a/scilab/modules/graphic_export/src/jni/FileExporter.cpp b/scilab/modules/graphic_export/src/jni/FileExporter.cpp
+index 52953ac..ef846f3 100644
+--- a/scilab/modules/graphic_export/src/jni/FileExporter.cpp
++++ b/scilab/modules/graphic_export/src/jni/FileExporter.cpp
+@@ -1,5 +1,5 @@
+ #include "FileExporter.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,22 +129,17 @@ throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ 
+ // Generic methods
+ 
+-
+ void FileExporter::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FileExporter");
+ }
+ }
+ 
+-
+ void FileExporter::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FileExporter");
+ }
+ }
+-
+ // Method(s)
+ 
+ int FileExporter::fileExport (JavaVM * jvm_, int figureIndex, char * fileName, int fileType, int orientation){
+diff --git a/scilab/modules/graphic_export/src/jni/FileExporter.hxx b/scilab/modules/graphic_export/src/jni/FileExporter.hxx
+index b0a919f..da4b690 100644
+--- a/scilab/modules/graphic_export/src/jni/FileExporter.hxx
++++ b/scilab/modules/graphic_export/src/jni/FileExporter.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.cpp b/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.cpp
+index c376468..0057fe6 100644
+--- a/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.cpp
++++ b/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.cpp
+@@ -1,5 +1,5 @@
+ #include "GL2PSToJOGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -167,22 +167,17 @@ voidglPassThroughjfloatID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void GL2PSToJOGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GL2PSToJOGL");
+ }
+ }
+ 
+-
+ void GL2PSToJOGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GL2PSToJOGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void GL2PSToJOGL::glFeedbackBuffer (JavaVM * jvm_, int arg0, int arg1){
+diff --git a/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.hxx b/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.hxx
+index c9bf10b..fad0780 100644
+--- a/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.hxx
++++ b/scilab/modules/graphic_export/src/jni/GL2PSToJOGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/graphic_export/src/jni/GiwsException.cpp b/scilab/modules/graphic_export/src/jni/GiwsException.cpp
+index fc4d53c..234e52b 100644
+--- a/scilab/modules/graphic_export/src/jni/GiwsException.cpp
++++ b/scilab/modules/graphic_export/src/jni/GiwsException.cpp
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -47,7 +47,7 @@ namespace GiwsException {
+ */
+ JniException::JniException(JNIEnv * curEnv) throw() : exception()
+ {
+-// retrieve informations about the exception
++// retrieve information about the exception
+ javaException = curEnv->ExceptionOccurred();
+ /* Clear the Java Exception to avoid calling it again & again */
+ curEnv->ExceptionClear();
+@@ -122,7 +122,7 @@ std::string JniException::retrieveExceptionMessage(JNIEnv * curEnv)
+ {
+ // return the result of the getLocalizedMessage method
+ 
+-// retrieve informations from the exception.
++// retrieve information from the exception.
+ // get method id
+ jmethodID getLocalizedMessageId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+                                                "getLocalizedMessage",
+@@ -153,7 +153,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+ 
+     // return the result of the getStackTrace method
+ 
+-    // retrieve informations from the exception.
++    // retrieve information from the exception.
+     // get method id
+     // getStackTrace returns an array of StackTraceElement
+     jmethodID getStackTraceId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+@@ -242,9 +242,9 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   }
+ 
+   /**
+-   * To be called when all the informations about the exceptions have been
++   * To be called when all the information about the exceptions have been
+    * retrived.
+-   * Remove the exception from the environement.
++   * Remove the exception from the environment.
+    */
+   void JniException::closeException(JNIEnv * curEnv)
+   {
+@@ -293,7 +293,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   */
+   
+   /**
+-  * @pram curEnv java environment where the exception occured.
++  * @param curEnv java environment where the exception occured.
+   */
+   JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv)
+   {
+@@ -305,7 +305,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   
+   JniCallMethodException::~JniCallMethodException(void) throw() {}
+   /**
+-  * @pram className name of the class which haven't been found
++  * @param className name of the class which haven't been found
+   */
+   JniClassNotFoundException::JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -316,7 +316,7 @@ setErrorMessage(errorMessage);
+   JniClassNotFoundException::~JniClassNotFoundException(void) throw() {}
+ 
+   /**
+-   * @pram className name of the method which haven't been found
++   * @param className name of the method which haven't been found
+    */
+   JniMethodNotFoundException::JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw() : JniException(curEnv)
+   {
+@@ -325,8 +325,9 @@ setErrorMessage(errorMessage);
+   }
+ 
+   JniMethodNotFoundException::~JniMethodNotFoundException(void) throw() {}
++  
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniObjectCreationException::JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -336,6 +337,17 @@ setErrorMessage(errorMessage);
+ 
+   JniObjectCreationException::~JniObjectCreationException(void) throw() {}
+ 
++  /**
++   * @param curEnv java envirnonment where the exception occured.
++   */
++  JniMonitorException::JniMonitorException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
++  {
++std::string errorMessage = "Error in the access (Enter or exit) or a Java env monitor of class " + className + ".";
++setErrorMessage(errorMessage);
++  }
++
++  JniMonitorException::~JniMonitorException(void) throw() {}
++
+ 
+ 
+ }
+diff --git a/scilab/modules/graphic_export/src/jni/GiwsException.hxx b/scilab/modules/graphic_export/src/jni/GiwsException.hxx
+index a2be211..73f8175 100644
+--- a/scilab/modules/graphic_export/src/jni/GiwsException.hxx
++++ b/scilab/modules/graphic_export/src/jni/GiwsException.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,9 +129,9 @@ std::string retrieveStackTrace(JNIEnv * curEnv);
+ */
+ std::string retrieveExceptionName(JNIEnv * curEnv);
+ /**
+-* To be called when all the informations about the exceptions have been
++* To be called when all the information about the exceptions have been
+ * retrived.
+-* Remove the exception from the environement.
++* Remove the exception from the environment.
+ */
+ void closeException(JNIEnv * curEnv);
+ 
+@@ -164,7 +164,7 @@ class JniCallMethodException : public JniException
+ public:
+ 
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniCallMethodException(JNIEnv * curEnv) throw();
+ 
+@@ -179,7 +179,7 @@ class JniClassNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the class which haven't been found
++* @param className name of the class which haven't been found
+ */
+ JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw();
+ 
+@@ -195,7 +195,7 @@ class JniMethodNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the method which haven't been found
++* @param className name of the method which haven't been found
+ */
+ JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw();
+ virtual ~JniMethodNotFoundException(void) throw();
+@@ -213,7 +213,7 @@ class JniObjectCreationException : public JniException
+ public:
+ 
+ /**
+-* @pram curEnv java envirnonment where the exception occured.
++* @param curEnv java envirnonment where the exception occured.
+ */
+ JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw();
+ virtual ~JniObjectCreationException(void) throw();
+@@ -221,6 +221,23 @@ virtual ~JniObjectCreationException(void) throw();
+ };
+ 
+ 
++/**
++* Exception that should be thrown when a call to the Java monitor
++* failed
++*/
++class JniMonitorException : public JniException
++{
++public:
++
++/**
++* @param curEnv java envirnonment where the exception occured.
++*/
++JniMonitorException(JNIEnv * curEnv, const std::string & className) throw();
++virtual ~JniMonitorException(void) throw();
++
++};
++
++
+ }
+ #endif
+ 
+diff --git a/scilab/modules/graphic_export/src/jni/JOGLConstant.cpp b/scilab/modules/graphic_export/src/jni/JOGLConstant.cpp
+index ca38add..7dc8a85 100644
+--- a/scilab/modules/graphic_export/src/jni/JOGLConstant.cpp
++++ b/scilab/modules/graphic_export/src/jni/JOGLConstant.cpp
+@@ -1,5 +1,5 @@
+ #include "JOGLConstant.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -193,22 +193,17 @@ jintget_GL_LINE_STIPPLE_REPEATID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void JOGLConstant::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "JOGLConstant");
+ }
+ }
+ 
+-
+ void JOGLConstant::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "JOGLConstant");
+ }
+ }
+-
+ // Method(s)
+ 
+ int JOGLConstant::get_GL_RGBA (JavaVM * jvm_){
+diff --git a/scilab/modules/graphic_export/src/jni/JOGLConstant.hxx b/scilab/modules/graphic_export/src/jni/JOGLConstant.hxx
+index e8e62a6..10a02cf 100644
+--- a/scilab/modules/graphic_export/src/jni/JOGLConstant.hxx
++++ b/scilab/modules/graphic_export/src/jni/JOGLConstant.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/gui/src/jni/CallScilabBridge.cpp b/scilab/modules/gui/src/jni/CallScilabBridge.cpp
+index 936a19c..f1a1acc 100644
+--- a/scilab/modules/gui/src/jni/CallScilabBridge.cpp
++++ b/scilab/modules/gui/src/jni/CallScilabBridge.cpp
+@@ -1,5 +1,5 @@
+ #include "CallScilabBridge.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -68,9 +68,7 @@ JNIEnv * curEnv = getCurrentEnv();
+ 
+ localClass = curEnv->FindClass( this->className().c_str() ) ;
+ if (localClass == NULL) {
+-std::cerr << "Could not get the Class " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++  throw GiwsException::JniClassNotFoundException(curEnv, this->className());
+ }
+ 
+ this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass) ;
+@@ -79,31 +77,23 @@ this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass) ;
+ curEnv->DeleteLocalRef(localClass);
+ 
+ if (this->instanceClass == NULL) {
+-std::cerr << "Could not create a Global Ref of " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ 
+ 
+ constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
+ if(constructObject == NULL){
+-std::cerr << "Could not retrieve the constructor of the class " << this->className() << " with the profile : " << construct << param << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ 
+ localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
+ if(localInstance == NULL){
+-std::cerr << "Could not instantiate the object " << this->className() << " with the constructor : " << construct << param << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+  
+ this->instance = curEnv->NewGlobalRef(localInstance) ;
+ if(this->instance == NULL){
+-std::cerr << "Could not create a new global ref of " << this->className() << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ /* localInstance not needed anymore */
+ curEnv->DeleteLocalRef(localInstance);
+@@ -301,18 +291,12 @@ jclass localClass = curEnv->GetObjectClass(JObj);
+         curEnv->DeleteLocalRef(localClass);
+ 
+         if (this->instanceClass == NULL) {
+-
+-std::cerr << "Could not create a Global Ref of " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+         }
+ 
+         this->instance = curEnv->NewGlobalRef(JObj) ;
+         if(this->instance == NULL){
+-
+-std::cerr << "Could not create a new global ref of " << this->className() << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+         }
+         /* Methods ID set to NULL */
+         jintnewWindowID=NULL; 
+@@ -499,22 +483,17 @@ jbooleanuseCanvasForDisplayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void CallScilabBridge::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CallScilabBridge");
+ }
+ }
+ 
+-
+ void CallScilabBridge::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CallScilabBridge");
+ }
+ }
+-
+ // Method(s)
+ 
+ int CallScilabBridge::newWindow (JavaVM * jvm_){
+@@ -525,17 +504,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewWindowID = curEnv->GetStaticMethodID(cls, "newWindow", "()I" ) ;
+ if (jintnewWindowID == NULL) {
+-std::cerr << "Could not access to the method " << "newWindow" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newWindow");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewWindowID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -548,17 +523,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewMenuBarID = curEnv->GetStaticMethodID(cls, "newMenuBar", "()I" ) ;
+ if (jintnewMenuBarID == NULL) {
+-std::cerr << "Could not access to the method " << "newMenuBar" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newMenuBar");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewMenuBarID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -571,17 +542,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewMenuID = curEnv->GetStaticMethodID(cls, "newMenu", "()I" ) ;
+ if (jintnewMenuID == NULL) {
+-std::cerr << "Could not access to the method " << "newMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newMenu");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewMenuID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -594,17 +561,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewPushButtonID = curEnv->GetStaticMethodID(cls, "newPushButton", "()I" ) ;
+ if (jintnewPushButtonID == NULL) {
+-std::cerr << "Could not access to the method " << "newPushButton" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newPushButton");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewPushButtonID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -617,17 +580,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewEditBoxID = curEnv->GetStaticMethodID(cls, "newEditBox", "()I" ) ;
+ if (jintnewEditBoxID == NULL) {
+-std::cerr << "Could not access to the method " << "newEditBox" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newEditBox");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewEditBoxID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -640,17 +599,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewLabelID = curEnv->GetStaticMethodID(cls, "newLabel", "()I" ) ;
+ if (jintnewLabelID == NULL) {
+-std::cerr << "Could not access to the method " << "newLabel" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newLabel");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewLabelID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -663,17 +618,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewCheckBoxID = curEnv->GetStaticMethodID(cls, "newCheckBox", "()I" ) ;
+ if (jintnewCheckBoxID == NULL) {
+-std::cerr << "Could not access to the method " << "newCheckBox" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newCheckBox");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewCheckBoxID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -686,17 +637,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewRadioButtonID = curEnv->GetStaticMethodID(cls, "newRadioButton", "()I" ) ;
+ if (jintnewRadioButtonID == NULL) {
+-std::cerr << "Could not access to the method " << "newRadioButton" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newRadioButton");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewRadioButtonID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -709,17 +656,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewSliderID = curEnv->GetStaticMethodID(cls, "newSlider", "()I" ) ;
+ if (jintnewSliderID == NULL) {
+-std::cerr << "Could not access to the method " << "newSlider" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newSlider");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewSliderID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -732,17 +675,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewPopupMenuID = curEnv->GetStaticMethodID(cls, "newPopupMenu", "()I" ) ;
+ if (jintnewPopupMenuID == NULL) {
+-std::cerr << "Could not access to the method " << "newPopupMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newPopupMenu");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewPopupMenuID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -755,17 +694,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewListBoxID = curEnv->GetStaticMethodID(cls, "newListBox", "()I" ) ;
+ if (jintnewListBoxID == NULL) {
+-std::cerr << "Could not access to the method " << "newListBox" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newListBox");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewListBoxID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -778,17 +713,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewFrameID = curEnv->GetStaticMethodID(cls, "newFrame", "()I" ) ;
+ if (jintnewFrameID == NULL) {
+-std::cerr << "Could not access to the method " << "newFrame" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newFrame");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewFrameID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -801,9 +732,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringnewContextMenujobjectArrayID = curEnv->GetStaticMethodID(cls, "newContextMenu", "([Ljava/lang/String;)Ljava/lang/String;" ) ;
+ if (jstringnewContextMenujobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "newContextMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newContextMenu");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -811,8 +740,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray menuLabels_ = curEnv->NewObjectArray( menuLabelsSize, stringArrayClass, NULL);
+ if (menuLabels_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -821,8 +749,7 @@ for ( int i = 0; i < menuLabelsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( menuLabels[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( menuLabels_, i, TempString);
+@@ -831,12 +758,10 @@ curEnv->SetObjectArrayElement( menuLabels_, i, TempString);
+ curEnv->DeleteLocalRef(TempString);
+ }
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringnewContextMenujobjectArrayID ,menuLabels_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+@@ -844,11 +769,9 @@ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(menuLabels_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -861,17 +784,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewContextMenuID = curEnv->GetStaticMethodID(cls, "newContextMenu", "()I" ) ;
+ if (jintnewContextMenuID == NULL) {
+-std::cerr << "Could not access to the method " << "newContextMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newContextMenu");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewContextMenuID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -884,17 +803,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiddestroyWidgetjintID = curEnv->GetStaticMethodID(cls, "destroyWidget", "(I)V" ) ;
+ if (voiddestroyWidgetjintID == NULL) {
+-std::cerr << "Could not access to the method " << "destroyWidget" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "destroyWidget");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiddestroyWidgetjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::destroyFrame (JavaVM * jvm_, int objID){
+@@ -905,17 +820,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiddestroyFramejintID = curEnv->GetStaticMethodID(cls, "destroyFrame", "(I)V" ) ;
+ if (voiddestroyFramejintID == NULL) {
+-std::cerr << "Could not access to the method " << "destroyFrame" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "destroyFrame");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiddestroyFramejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::newWindow (JavaVM * jvm_, int figureIndex){
+@@ -926,17 +837,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewWindowjintID = curEnv->GetStaticMethodID(cls, "newWindow", "(I)I" ) ;
+ if (jintnewWindowjintID == NULL) {
+-std::cerr << "Could not access to the method " << "newWindow" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newWindow");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewWindowjintID ,figureIndex);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -949,17 +856,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFigureAsParentjintjintID = curEnv->GetStaticMethodID(cls, "setFigureAsParent", "(II)V" ) ;
+ if (voidsetFigureAsParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFigureAsParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFigureAsParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFigureAsParentjintjintID ,figureID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMenuAsParent (JavaVM * jvm_, int menuID, int objID){
+@@ -970,17 +873,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMenuAsParentjintjintID = curEnv->GetStaticMethodID(cls, "setMenuAsParent", "(II)V" ) ;
+ if (voidsetMenuAsParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setMenuAsParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMenuAsParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMenuAsParentjintjintID ,menuID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setRootAsParent (JavaVM * jvm_, int objID){
+@@ -991,17 +890,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetRootAsParentjintID = curEnv->GetStaticMethodID(cls, "setRootAsParent", "(I)V" ) ;
+ if (voidsetRootAsParentjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setRootAsParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setRootAsParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetRootAsParentjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1012,17 +907,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetParentjintjintID = curEnv->GetStaticMethodID(cls, "setParent", "(II)V" ) ;
+ if (voidsetParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setPushButtonParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1033,17 +924,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetPushButtonParentjintjintID = curEnv->GetStaticMethodID(cls, "setPushButtonParent", "(II)V" ) ;
+ if (voidsetPushButtonParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setPushButtonParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setPushButtonParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetPushButtonParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removePushButtonFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1054,17 +941,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremovePushButtonFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removePushButtonFromParent", "(II)V" ) ;
+ if (voidremovePushButtonFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removePushButtonFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removePushButtonFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremovePushButtonFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setEditBoxParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1075,17 +958,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetEditBoxParentjintjintID = curEnv->GetStaticMethodID(cls, "setEditBoxParent", "(II)V" ) ;
+ if (voidsetEditBoxParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setEditBoxParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setEditBoxParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetEditBoxParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeEditBoxFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1096,17 +975,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveEditBoxFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeEditBoxFromParent", "(II)V" ) ;
+ if (voidremoveEditBoxFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeEditBoxFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeEditBoxFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveEditBoxFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setLabelParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1117,17 +992,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetLabelParentjintjintID = curEnv->GetStaticMethodID(cls, "setLabelParent", "(II)V" ) ;
+ if (voidsetLabelParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setLabelParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setLabelParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetLabelParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeLabelFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1138,17 +1009,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveLabelFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeLabelFromParent", "(II)V" ) ;
+ if (voidremoveLabelFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeLabelFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeLabelFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveLabelFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setCheckBoxParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1159,17 +1026,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetCheckBoxParentjintjintID = curEnv->GetStaticMethodID(cls, "setCheckBoxParent", "(II)V" ) ;
+ if (voidsetCheckBoxParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setCheckBoxParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setCheckBoxParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetCheckBoxParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeCheckBoxFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1180,17 +1043,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveCheckBoxFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeCheckBoxFromParent", "(II)V" ) ;
+ if (voidremoveCheckBoxFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeCheckBoxFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeCheckBoxFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveCheckBoxFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setRadioButtonParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1201,17 +1060,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetRadioButtonParentjintjintID = curEnv->GetStaticMethodID(cls, "setRadioButtonParent", "(II)V" ) ;
+ if (voidsetRadioButtonParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setRadioButtonParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setRadioButtonParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetRadioButtonParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeRadioButtonFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1222,17 +1077,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveRadioButtonFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeRadioButtonFromParent", "(II)V" ) ;
+ if (voidremoveRadioButtonFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeRadioButtonFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeRadioButtonFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveRadioButtonFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1243,17 +1094,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderParentjintjintID = curEnv->GetStaticMethodID(cls, "setSliderParent", "(II)V" ) ;
+ if (voidsetSliderParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeSliderFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1264,17 +1111,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveSliderFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeSliderFromParent", "(II)V" ) ;
+ if (voidremoveSliderFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeSliderFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeSliderFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveSliderFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setPopupMenuParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1285,17 +1128,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetPopupMenuParentjintjintID = curEnv->GetStaticMethodID(cls, "setPopupMenuParent", "(II)V" ) ;
+ if (voidsetPopupMenuParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setPopupMenuParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setPopupMenuParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetPopupMenuParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removePopupMenuFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1306,17 +1145,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremovePopupMenuFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removePopupMenuFromParent", "(II)V" ) ;
+ if (voidremovePopupMenuFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removePopupMenuFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removePopupMenuFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremovePopupMenuFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setListBoxParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1327,17 +1162,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetListBoxParentjintjintID = curEnv->GetStaticMethodID(cls, "setListBoxParent", "(II)V" ) ;
+ if (voidsetListBoxParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setListBoxParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setListBoxParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetListBoxParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeListBoxFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1348,17 +1179,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveListBoxFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeListBoxFromParent", "(II)V" ) ;
+ if (voidremoveListBoxFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeListBoxFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeListBoxFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveListBoxFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1369,17 +1196,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameParentjintjintID = curEnv->GetStaticMethodID(cls, "setFrameParent", "(II)V" ) ;
+ if (voidsetFrameParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeFrameFromParent (JavaVM * jvm_, int parentID, int objID){
+@@ -1390,17 +1213,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveFrameFromParentjintjintID = curEnv->GetStaticMethodID(cls, "removeFrameFromParent", "(II)V" ) ;
+ if (voidremoveFrameFromParentjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "removeFrameFromParent" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeFrameFromParent");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveFrameFromParentjintjintID ,parentID, objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetText (JavaVM * jvm_, int objID, char * text){
+@@ -1411,19 +1230,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetTextjintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetText", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetTextjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetText");
+ }
+ 
+ jstring text_ = curEnv->NewStringUTF( text );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetTextjintjstringID ,objID, text_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::getWidgetText (JavaVM * jvm_, int objID){
+@@ -1434,28 +1249,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetWidgetTextjintID = curEnv->GetStaticMethodID(cls, "getWidgetText", "(I)Ljava/lang/String;" ) ;
+ if (jstringgetWidgetTextjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetText");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetWidgetTextjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -1468,19 +1277,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameTextjintjstringID = curEnv->GetStaticMethodID(cls, "setFrameText", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFrameTextjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameText");
+ }
+ 
+ jstring text_ = curEnv->NewStringUTF( text );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameTextjintjstringID ,objID, text_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::getFrameText (JavaVM * jvm_, int objID){
+@@ -1491,28 +1296,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetFrameTextjintID = curEnv->GetStaticMethodID(cls, "getFrameText", "(I)Ljava/lang/String;" ) ;
+ if (jstringgetFrameTextjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFrameText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFrameText");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetFrameTextjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -1525,17 +1324,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetBackgroundColorjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setWidgetBackgroundColor", "(IIII)V" ) ;
+ if (voidsetWidgetBackgroundColorjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetBackgroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetBackgroundColor");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetBackgroundColorjintjintjintjintID ,objID, red, green, blue);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getWidgetBackgroundColor (JavaVM * jvm_, int objID){
+@@ -1546,9 +1341,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetWidgetBackgroundColorjintID = curEnv->GetStaticMethodID(cls, "getWidgetBackgroundColor", "(I)[I" ) ;
+ if (jintArraygetWidgetBackgroundColorjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetBackgroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetBackgroundColor");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetWidgetBackgroundColorjintID ,objID);
+@@ -1566,11 +1359,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -1583,17 +1374,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetForegroundColorjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setWidgetForegroundColor", "(IIII)V" ) ;
+ if (voidsetWidgetForegroundColorjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetForegroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetForegroundColor");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetForegroundColorjintjintjintjintID ,objID, red, green, blue);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getWidgetForegroundColor (JavaVM * jvm_, int objID){
+@@ -1604,9 +1391,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetWidgetForegroundColorjintID = curEnv->GetStaticMethodID(cls, "getWidgetForegroundColor", "(I)[I" ) ;
+ if (jintArraygetWidgetForegroundColorjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetForegroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetForegroundColor");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetWidgetForegroundColorjintID ,objID);
+@@ -1624,11 +1409,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -1641,17 +1424,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameBackgroundColorjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setFrameBackgroundColor", "(IIII)V" ) ;
+ if (voidsetFrameBackgroundColorjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameBackgroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameBackgroundColor");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameBackgroundColorjintjintjintjintID ,objID, red, green, blue);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getFrameBackgroundColor (JavaVM * jvm_, int objID){
+@@ -1662,9 +1441,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetFrameBackgroundColorjintID = curEnv->GetStaticMethodID(cls, "getFrameBackgroundColor", "(I)[I" ) ;
+ if (jintArraygetFrameBackgroundColorjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFrameBackgroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFrameBackgroundColor");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetFrameBackgroundColorjintID ,objID);
+@@ -1682,11 +1459,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -1699,17 +1474,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameForegroundColorjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setFrameForegroundColor", "(IIII)V" ) ;
+ if (voidsetFrameForegroundColorjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameForegroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameForegroundColor");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameForegroundColorjintjintjintjintID ,objID, red, green, blue);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getFrameForegroundColor (JavaVM * jvm_, int objID){
+@@ -1720,9 +1491,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetFrameForegroundColorjintID = curEnv->GetStaticMethodID(cls, "getFrameForegroundColor", "(I)[I" ) ;
+ if (jintArraygetFrameForegroundColorjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFrameForegroundColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFrameForegroundColor");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetFrameForegroundColorjintID ,objID);
+@@ -1740,11 +1509,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -1757,19 +1524,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetFontNamejintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetFontName", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetFontNamejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetFontName");
+ }
+ 
+ jstring name_ = curEnv->NewStringUTF( name );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetFontNamejintjstringID ,objID, name_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::getWidgetFontName (JavaVM * jvm_, int objID){
+@@ -1780,28 +1543,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetWidgetFontNamejintID = curEnv->GetStaticMethodID(cls, "getWidgetFontName", "(I)Ljava/lang/String;" ) ;
+ if (jstringgetWidgetFontNamejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetFontName");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetWidgetFontNamejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -1814,19 +1571,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetFontWeightjintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetFontWeight", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetFontWeightjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetFontWeight" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetFontWeight");
+ }
+ 
+ jstring weight_ = curEnv->NewStringUTF( weight );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetFontWeightjintjstringID ,objID, weight_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetFontSize (JavaVM * jvm_, int objID, int size){
+@@ -1837,17 +1590,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetFontSizejintjintID = curEnv->GetStaticMethodID(cls, "setWidgetFontSize", "(II)V" ) ;
+ if (voidsetWidgetFontSizejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetFontSize");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetFontSizejintjintID ,objID, size);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getWidgetFontSize (JavaVM * jvm_, int objID){
+@@ -1858,17 +1607,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetWidgetFontSizejintID = curEnv->GetStaticMethodID(cls, "getWidgetFontSize", "(I)I" ) ;
+ if (jintgetWidgetFontSizejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetFontSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetWidgetFontSizejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -1881,19 +1626,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetFontAnglejintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetFontAngle", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetFontAnglejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetFontAngle" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetFontAngle");
+ }
+ 
+ jstring angle_ = curEnv->NewStringUTF( angle );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetFontAnglejintjstringID ,objID, angle_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameFontName (JavaVM * jvm_, int objID, char * name){
+@@ -1904,19 +1645,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameFontNamejintjstringID = curEnv->GetStaticMethodID(cls, "setFrameFontName", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFrameFontNamejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameFontName");
+ }
+ 
+ jstring name_ = curEnv->NewStringUTF( name );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameFontNamejintjstringID ,objID, name_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::getFrameFontName (JavaVM * jvm_, int objID){
+@@ -1927,28 +1664,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetFrameFontNamejintID = curEnv->GetStaticMethodID(cls, "getFrameFontName", "(I)Ljava/lang/String;" ) ;
+ if (jstringgetFrameFontNamejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFrameFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFrameFontName");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetFrameFontNamejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -1961,19 +1692,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameFontWeightjintjstringID = curEnv->GetStaticMethodID(cls, "setFrameFontWeight", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFrameFontWeightjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameFontWeight" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameFontWeight");
+ }
+ 
+ jstring weight_ = curEnv->NewStringUTF( weight );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameFontWeightjintjstringID ,objID, weight_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameFontSize (JavaVM * jvm_, int objID, int size){
+@@ -1984,17 +1711,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameFontSizejintjintID = curEnv->GetStaticMethodID(cls, "setFrameFontSize", "(II)V" ) ;
+ if (voidsetFrameFontSizejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameFontSize");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameFontSizejintjintID ,objID, size);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getFrameFontSize (JavaVM * jvm_, int objID){
+@@ -2005,17 +1728,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetFrameFontSizejintID = curEnv->GetStaticMethodID(cls, "getFrameFontSize", "(I)I" ) ;
+ if (jintgetFrameFontSizejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFrameFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFrameFontSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetFrameFontSizejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2028,19 +1747,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameFontAnglejintjstringID = curEnv->GetStaticMethodID(cls, "setFrameFontAngle", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFrameFontAnglejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameFontAngle" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameFontAngle");
+ }
+ 
+ jstring angle_ = curEnv->NewStringUTF( angle );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameFontAnglejintjstringID ,objID, angle_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetPosition (JavaVM * jvm_, int objID, int x, int y, int width, int height){
+@@ -2051,17 +1766,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetPositionjintjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setWidgetPosition", "(IIIII)V" ) ;
+ if (voidsetWidgetPositionjintjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetPosition" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetPosition");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetPositionjintjintjintjintjintID ,objID, x, y, width, height);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getWidgetPosition (JavaVM * jvm_, int objID){
+@@ -2072,9 +1783,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetWidgetPositionjintID = curEnv->GetStaticMethodID(cls, "getWidgetPosition", "(I)[I" ) ;
+ if (jintArraygetWidgetPositionjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getWidgetPosition" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getWidgetPosition");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetWidgetPositionjintID ,objID);
+@@ -2092,11 +1801,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -2109,17 +1816,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFramePositionjintjintjintjintjintID = curEnv->GetStaticMethodID(cls, "setFramePosition", "(IIIII)V" ) ;
+ if (voidsetFramePositionjintjintjintjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFramePosition" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFramePosition");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFramePositionjintjintjintjintjintID ,objID, x, y, width, height);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getFramePosition (JavaVM * jvm_, int objID){
+@@ -2130,9 +1833,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetFramePositionjintID = curEnv->GetStaticMethodID(cls, "getFramePosition", "(I)[I" ) ;
+ if (jintArraygetFramePositionjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFramePosition" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFramePosition");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetFramePositionjintID ,objID);
+@@ -2150,11 +1851,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -2167,19 +1866,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetCallbackjintjstringjintID = curEnv->GetStaticMethodID(cls, "setWidgetCallback", "(ILjava/lang/String;I)V" ) ;
+ if (voidsetWidgetCallbackjintjstringjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetCallback" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetCallback");
+ }
+ 
+ jstring text_ = curEnv->NewStringUTF( text );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetCallbackjintjstringjintID ,objID, text_, type);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameCallback (JavaVM * jvm_, int objID, char * text, int type){
+@@ -2190,19 +1885,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameCallbackjintjstringjintID = curEnv->GetStaticMethodID(cls, "setFrameCallback", "(ILjava/lang/String;I)V" ) ;
+ if (voidsetFrameCallbackjintjstringjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameCallback" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameCallback");
+ }
+ 
+ jstring text_ = curEnv->NewStringUTF( text );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameCallbackjintjstringjintID ,objID, text_, type);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetHorizontalAlignment (JavaVM * jvm_, int objID, char * alignment){
+@@ -2213,19 +1904,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetHorizontalAlignmentjintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetHorizontalAlignment", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetHorizontalAlignmentjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetHorizontalAlignment" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetHorizontalAlignment");
+ }
+ 
+ jstring alignment_ = curEnv->NewStringUTF( alignment );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetHorizontalAlignmentjintjstringID ,objID, alignment_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetVerticalAlignment (JavaVM * jvm_, int objID, char * alignment){
+@@ -2236,19 +1923,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetVerticalAlignmentjintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetVerticalAlignment", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetVerticalAlignmentjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetVerticalAlignment" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetVerticalAlignment");
+ }
+ 
+ jstring alignment_ = curEnv->NewStringUTF( alignment );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetVerticalAlignmentjintjstringID ,objID, alignment_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderMinorTickSpacing (JavaVM * jvm_, int objID, int space){
+@@ -2259,17 +1942,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderMinorTickSpacingjintjintID = curEnv->GetStaticMethodID(cls, "setSliderMinorTickSpacing", "(II)V" ) ;
+ if (voidsetSliderMinorTickSpacingjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderMinorTickSpacing" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderMinorTickSpacing");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderMinorTickSpacingjintjintID ,objID, space);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderMajorTickSpacing (JavaVM * jvm_, int objID, int space){
+@@ -2280,17 +1959,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderMajorTickSpacingjintjintID = curEnv->GetStaticMethodID(cls, "setSliderMajorTickSpacing", "(II)V" ) ;
+ if (voidsetSliderMajorTickSpacingjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderMajorTickSpacing" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderMajorTickSpacing");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderMajorTickSpacingjintjintID ,objID, space);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setListBoxSelectedIndices (JavaVM * jvm_, int objID, int * indices, int indicesSize){
+@@ -2301,23 +1976,25 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetListBoxSelectedIndicesjintjintArrayID = curEnv->GetStaticMethodID(cls, "setListBoxSelectedIndices", "(I[I)V" ) ;
+ if (voidsetListBoxSelectedIndicesjintjintArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setListBoxSelectedIndices" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setListBoxSelectedIndices");
+ }
+ 
+ jintArray indices_ = curEnv->NewIntArray( indicesSize ) ;
+ 
++if (indices_ == NULL)
++{
++// check that allocation succeed
++throw GiwsException::JniBadAllocException(curEnv);
++}
++
+ curEnv->SetIntArrayRegion( indices_, 0, indicesSize, (jint*) indices ) ;
+ 
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetListBoxSelectedIndicesjintjintArrayID ,objID, indices_);
+ curEnv->DeleteLocalRef(indices_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getListBoxSelectedIndices (JavaVM * jvm_, int objID){
+@@ -2328,9 +2005,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetListBoxSelectedIndicesjintID = curEnv->GetStaticMethodID(cls, "getListBoxSelectedIndices", "(I)[I" ) ;
+ if (jintArraygetListBoxSelectedIndicesjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getListBoxSelectedIndices" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getListBoxSelectedIndices");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetListBoxSelectedIndicesjintID ,objID);
+@@ -2348,11 +2023,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -2365,17 +2038,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetListBoxSelectionSizejintID = curEnv->GetStaticMethodID(cls, "getListBoxSelectionSize", "(I)I" ) ;
+ if (jintgetListBoxSelectionSizejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getListBoxSelectionSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getListBoxSelectionSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetListBoxSelectionSizejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2388,17 +2057,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetPopupMenuSelectedIndexjintjintID = curEnv->GetStaticMethodID(cls, "setPopupMenuSelectedIndex", "(II)V" ) ;
+ if (voidsetPopupMenuSelectedIndexjintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setPopupMenuSelectedIndex" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setPopupMenuSelectedIndex");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetPopupMenuSelectedIndexjintjintID ,objID, index);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getPopupMenuSelectedIndex (JavaVM * jvm_, int objID){
+@@ -2409,17 +2074,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetPopupMenuSelectedIndexjintID = curEnv->GetStaticMethodID(cls, "getPopupMenuSelectedIndex", "(I)I" ) ;
+ if (jintgetPopupMenuSelectedIndexjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getPopupMenuSelectedIndex" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getPopupMenuSelectedIndex");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetPopupMenuSelectedIndexjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2432,17 +2093,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderValuejintjintID = curEnv->GetStaticMethodID(cls, "setSliderValue", "(II)V" ) ;
+ if (voidsetSliderValuejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderValue");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderValuejintjintID ,objID, index);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getSliderValue (JavaVM * jvm_, int objID){
+@@ -2453,17 +2110,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetSliderValuejintID = curEnv->GetStaticMethodID(cls, "getSliderValue", "(I)I" ) ;
+ if (jintgetSliderValuejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getSliderValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getSliderValue");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetSliderValuejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2476,19 +2129,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetRadioButtonCheckedjintjbooleanID = curEnv->GetStaticMethodID(cls, "setRadioButtonChecked", "(IZ)V" ) ;
+ if (voidsetRadioButtonCheckedjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setRadioButtonChecked" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setRadioButtonChecked");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetRadioButtonCheckedjintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::isRadioButtonChecked (JavaVM * jvm_, int objID){
+@@ -2499,17 +2148,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisRadioButtonCheckedjintID = curEnv->GetStaticMethodID(cls, "isRadioButtonChecked", "(I)Z" ) ;
+ if (jbooleanisRadioButtonCheckedjintID == NULL) {
+-std::cerr << "Could not access to the method " << "isRadioButtonChecked" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isRadioButtonChecked");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisRadioButtonCheckedjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -2522,19 +2167,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetCheckBoxCheckedjintjbooleanID = curEnv->GetStaticMethodID(cls, "setCheckBoxChecked", "(IZ)V" ) ;
+ if (voidsetCheckBoxCheckedjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setCheckBoxChecked" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setCheckBoxChecked");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetCheckBoxCheckedjintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::isCheckBoxChecked (JavaVM * jvm_, int objID){
+@@ -2545,17 +2186,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisCheckBoxCheckedjintID = curEnv->GetStaticMethodID(cls, "isCheckBoxChecked", "(I)Z" ) ;
+ if (jbooleanisCheckBoxCheckedjintID == NULL) {
+-std::cerr << "Could not access to the method " << "isCheckBoxChecked" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isCheckBoxChecked");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisCheckBoxCheckedjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -2568,17 +2205,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderMinValuejintjintID = curEnv->GetStaticMethodID(cls, "setSliderMinValue", "(II)V" ) ;
+ if (voidsetSliderMinValuejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderMinValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderMinValue");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderMinValuejintjintID ,objID, value);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderMaxValue (JavaVM * jvm_, int objID, int value){
+@@ -2589,17 +2222,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderMaxValuejintjintID = curEnv->GetStaticMethodID(cls, "setSliderMaxValue", "(II)V" ) ;
+ if (voidsetSliderMaxValuejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderMaxValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderMaxValue");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderMaxValuejintjintID ,objID, value);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderVertical (JavaVM * jvm_, int objID){
+@@ -2610,17 +2239,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderVerticaljintID = curEnv->GetStaticMethodID(cls, "setSliderVertical", "(I)V" ) ;
+ if (voidsetSliderVerticaljintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderVertical" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderVertical");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderVerticaljintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setSliderHorizontal (JavaVM * jvm_, int objID){
+@@ -2631,17 +2256,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetSliderHorizontaljintID = curEnv->GetStaticMethodID(cls, "setSliderHorizontal", "(I)V" ) ;
+ if (voidsetSliderHorizontaljintID == NULL) {
+-std::cerr << "Could not access to the method " << "setSliderHorizontal" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setSliderHorizontal");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetSliderHorizontaljintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setListBoxMultipleSelectionEnabled (JavaVM * jvm_, int objID, bool status){
+@@ -2652,19 +2273,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetListBoxMultipleSelectionEnabledjintjbooleanID = curEnv->GetStaticMethodID(cls, "setListBoxMultipleSelectionEnabled", "(IZ)V" ) ;
+ if (voidsetListBoxMultipleSelectionEnabledjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setListBoxMultipleSelectionEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setListBoxMultipleSelectionEnabled");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetListBoxMultipleSelectionEnabledjintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char ** CallScilabBridge::getListBoxAllItemsText (JavaVM * jvm_, int objID){
+@@ -2675,17 +2292,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetListBoxAllItemsTextjintID = curEnv->GetStaticMethodID(cls, "getListBoxAllItemsText", "(I)[Ljava/lang/String;" ) ;
+ if (jobjectArraygetListBoxAllItemsTextjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getListBoxAllItemsText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getListBoxAllItemsText");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetListBoxAllItemsTextjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -2698,11 +2311,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -2716,17 +2327,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetListBoxNumberOfItemsjintID = curEnv->GetStaticMethodID(cls, "getListBoxNumberOfItems", "(I)I" ) ;
+ if (jintgetListBoxNumberOfItemsjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getListBoxNumberOfItems" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getListBoxNumberOfItems");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetListBoxNumberOfItemsjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2739,9 +2346,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetListBoxTextjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setListBoxText", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetListBoxTextjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setListBoxText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setListBoxText");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -2749,8 +2354,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray text_ = curEnv->NewObjectArray( textSize, stringArrayClass, NULL);
+ if (text_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -2759,8 +2363,7 @@ for ( int i = 0; i < textSize; i++)
+ jstring TempString = curEnv->NewStringUTF( text[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( text_, i, TempString);
+@@ -2771,11 +2374,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetListBoxTextjintjobjectArrayID ,objID, text_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(text_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char ** CallScilabBridge::getPopupMenuAllItemsText (JavaVM * jvm_, int objID){
+@@ -2786,17 +2387,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetPopupMenuAllItemsTextjintID = curEnv->GetStaticMethodID(cls, "getPopupMenuAllItemsText", "(I)[Ljava/lang/String;" ) ;
+ if (jobjectArraygetPopupMenuAllItemsTextjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getPopupMenuAllItemsText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getPopupMenuAllItemsText");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetPopupMenuAllItemsTextjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -2809,11 +2406,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -2827,17 +2422,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetPopupMenuNumberOfItemsjintID = curEnv->GetStaticMethodID(cls, "getPopupMenuNumberOfItems", "(I)I" ) ;
+ if (jintgetPopupMenuNumberOfItemsjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getPopupMenuNumberOfItems" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getPopupMenuNumberOfItems");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetPopupMenuNumberOfItemsjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -2850,9 +2441,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetPopupMenuTextjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setPopupMenuText", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetPopupMenuTextjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setPopupMenuText" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setPopupMenuText");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -2860,8 +2449,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray text_ = curEnv->NewObjectArray( textSize, stringArrayClass, NULL);
+ if (text_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -2870,8 +2458,7 @@ for ( int i = 0; i < textSize; i++)
+ jstring TempString = curEnv->NewStringUTF( text[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( text_, i, TempString);
+@@ -2882,11 +2469,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetPopupMenuTextjintjobjectArrayID ,objID, text_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(text_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetRelief (JavaVM * jvm_, int objID, char * reliefType){
+@@ -2897,19 +2482,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetReliefjintjstringID = curEnv->GetStaticMethodID(cls, "setWidgetRelief", "(ILjava/lang/String;)V" ) ;
+ if (voidsetWidgetReliefjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetRelief" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetRelief");
+ }
+ 
+ jstring reliefType_ = curEnv->NewStringUTF( reliefType );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetReliefjintjstringID ,objID, reliefType_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameRelief (JavaVM * jvm_, int objID, char * reliefType){
+@@ -2920,19 +2501,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameReliefjintjstringID = curEnv->GetStaticMethodID(cls, "setFrameRelief", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFrameReliefjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameRelief" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameRelief");
+ }
+ 
+ jstring reliefType_ = curEnv->NewStringUTF( reliefType );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameReliefjintjstringID ,objID, reliefType_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setRootMenuEnabled (JavaVM * jvm_, char * menuName, bool status){
+@@ -2943,9 +2520,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetRootMenuEnabledjstringjbooleanID = curEnv->GetStaticMethodID(cls, "setRootMenuEnabled", "(Ljava/lang/String;Z)V" ) ;
+ if (voidsetRootMenuEnabledjstringjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setRootMenuEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setRootMenuEnabled");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+@@ -2953,11 +2528,9 @@ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetRootMenuEnabledjstringjbooleanID ,menuName_, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setRootSubMenuEnabled (JavaVM * jvm_, char * menuName, int position, bool status){
+@@ -2968,9 +2541,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetRootSubMenuEnabledjstringjintjbooleanID = curEnv->GetStaticMethodID(cls, "setRootSubMenuEnabled", "(Ljava/lang/String;IZ)V" ) ;
+ if (voidsetRootSubMenuEnabledjstringjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setRootSubMenuEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setRootSubMenuEnabled");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+@@ -2978,11 +2549,9 @@ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetRootSubMenuEnabledjstringjintjbooleanID ,menuName_, position, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFigureMenuEnabled (JavaVM * jvm_, int figureID, char * menuName, bool status){
+@@ -2993,9 +2562,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFigureMenuEnabledjintjstringjbooleanID = curEnv->GetStaticMethodID(cls, "setFigureMenuEnabled", "(ILjava/lang/String;Z)V" ) ;
+ if (voidsetFigureMenuEnabledjintjstringjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFigureMenuEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFigureMenuEnabled");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+@@ -3003,11 +2570,9 @@ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFigureMenuEnabledjintjstringjbooleanID ,figureID, menuName_, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFigureSubMenuEnabled (JavaVM * jvm_, int figureID, char * menuName, int position, bool status){
+@@ -3018,9 +2583,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFigureSubMenuEnabledjintjstringjintjbooleanID = curEnv->GetStaticMethodID(cls, "setFigureSubMenuEnabled", "(ILjava/lang/String;IZ)V" ) ;
+ if (voidsetFigureSubMenuEnabledjintjstringjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFigureSubMenuEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFigureSubMenuEnabled");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+@@ -3028,11 +2591,9 @@ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFigureSubMenuEnabledjintjstringjintjbooleanID ,figureID, menuName_, position, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetEnable (JavaVM * jvm_, int objID, bool status){
+@@ -3043,19 +2604,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetEnablejintjbooleanID = curEnv->GetStaticMethodID(cls, "setWidgetEnable", "(IZ)V" ) ;
+ if (voidsetWidgetEnablejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetEnable" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetEnable");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetEnablejintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameEnable (JavaVM * jvm_, int objID, bool status){
+@@ -3066,19 +2623,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameEnablejintjbooleanID = curEnv->GetStaticMethodID(cls, "setFrameEnable", "(IZ)V" ) ;
+ if (voidsetFrameEnablejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameEnable" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameEnable");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameEnablejintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::isWidgetEnable (JavaVM * jvm_, int objID){
+@@ -3089,17 +2642,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisWidgetEnablejintID = curEnv->GetStaticMethodID(cls, "isWidgetEnable", "(I)Z" ) ;
+ if (jbooleanisWidgetEnablejintID == NULL) {
+-std::cerr << "Could not access to the method " << "isWidgetEnable" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isWidgetEnable");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisWidgetEnablejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -3112,17 +2661,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisFrameEnablejintID = curEnv->GetStaticMethodID(cls, "isFrameEnable", "(I)Z" ) ;
+ if (jbooleanisFrameEnablejintID == NULL) {
+-std::cerr << "Could not access to the method " << "isFrameEnable" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isFrameEnable");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisFrameEnablejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -3135,19 +2680,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveRootMenujstringID = curEnv->GetStaticMethodID(cls, "removeRootMenu", "(Ljava/lang/String;)V" ) ;
+ if (voidremoveRootMenujstringID == NULL) {
+-std::cerr << "Could not access to the method " << "removeRootMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeRootMenu");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveRootMenujstringID ,menuName_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::removeFigureMenu (JavaVM * jvm_, int figureID, char * menuName){
+@@ -3158,19 +2699,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidremoveFigureMenujintjstringID = curEnv->GetStaticMethodID(cls, "removeFigureMenu", "(ILjava/lang/String;)V" ) ;
+ if (voidremoveFigureMenujintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "removeFigureMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "removeFigureMenu");
+ }
+ 
+ jstring menuName_ = curEnv->NewStringUTF( menuName );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidremoveFigureMenujintjstringID ,figureID, menuName_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::displayAndWaitContextMenu (JavaVM * jvm_, int ID){
+@@ -3181,28 +2718,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringdisplayAndWaitContextMenujintID = curEnv->GetStaticMethodID(cls, "displayAndWaitContextMenu", "(I)Ljava/lang/String;" ) ;
+ if (jstringdisplayAndWaitContextMenujintID == NULL) {
+-std::cerr << "Could not access to the method " << "displayAndWaitContextMenu" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "displayAndWaitContextMenu");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringdisplayAndWaitContextMenujintID ,ID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -3215,17 +2746,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewMessageBoxID = curEnv->GetStaticMethodID(cls, "newMessageBox", "()I" ) ;
+ if (jintnewMessageBoxID == NULL) {
+-std::cerr << "Could not access to the method " << "newMessageBox" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newMessageBox");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewMessageBoxID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -3238,19 +2765,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxTitlejintjstringID = curEnv->GetStaticMethodID(cls, "setMessageBoxTitle", "(ILjava/lang/String;)V" ) ;
+ if (voidsetMessageBoxTitlejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxTitle" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxTitle");
+ }
+ 
+ jstring title_ = curEnv->NewStringUTF( title );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxTitlejintjstringID ,id, title_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxMessage (JavaVM * jvm_, int id, char * message){
+@@ -3261,19 +2784,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxMessagejintjstringID = curEnv->GetStaticMethodID(cls, "setMessageBoxMessage", "(ILjava/lang/String;)V" ) ;
+ if (voidsetMessageBoxMessagejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxMessage" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxMessage");
+ }
+ 
+ jstring message_ = curEnv->NewStringUTF( message );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxMessagejintjstringID ,id, message_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxMessage (JavaVM * jvm_, int id, char ** message, int messageSize){
+@@ -3284,9 +2803,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxMessagejintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxMessage", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxMessagejintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxMessage" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxMessage");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3294,8 +2811,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray message_ = curEnv->NewObjectArray( messageSize, stringArrayClass, NULL);
+ if (message_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3304,8 +2820,7 @@ for ( int i = 0; i < messageSize; i++)
+ jstring TempString = curEnv->NewStringUTF( message[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( message_, i, TempString);
+@@ -3316,11 +2831,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxMessagejintjobjectArrayID ,id, message_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(message_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::messageBoxDisplayAndWait (JavaVM * jvm_, int id){
+@@ -3331,17 +2844,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidmessageBoxDisplayAndWaitjintID = curEnv->GetStaticMethodID(cls, "messageBoxDisplayAndWait", "(I)V" ) ;
+ if (voidmessageBoxDisplayAndWaitjintID == NULL) {
+-std::cerr << "Could not access to the method " << "messageBoxDisplayAndWait" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "messageBoxDisplayAndWait");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidmessageBoxDisplayAndWaitjintID ,id);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getMessageBoxSelectedButton (JavaVM * jvm_, int id){
+@@ -3352,17 +2861,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetMessageBoxSelectedButtonjintID = curEnv->GetStaticMethodID(cls, "getMessageBoxSelectedButton", "(I)I" ) ;
+ if (jintgetMessageBoxSelectedButtonjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getMessageBoxSelectedButton" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMessageBoxSelectedButton");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetMessageBoxSelectedButtonjintID ,id);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -3375,23 +2880,25 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxDefaultSelectedButtonsjintjintArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxDefaultSelectedButtons", "(I[I)V" ) ;
+ if (voidsetMessageBoxDefaultSelectedButtonsjintjintArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxDefaultSelectedButtons" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxDefaultSelectedButtons");
+ }
+ 
+ jintArray index_ = curEnv->NewIntArray( indexSize ) ;
+ 
++if (index_ == NULL)
++{
++// check that allocation succeed
++throw GiwsException::JniBadAllocException(curEnv);
++}
++
+ curEnv->SetIntArrayRegion( index_, 0, indexSize, (jint*) index ) ;
+ 
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxDefaultSelectedButtonsjintjintArrayID ,id, index_);
+ curEnv->DeleteLocalRef(index_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getMessageBoxUserSelectedButtons (JavaVM * jvm_, int id){
+@@ -3402,9 +2909,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetMessageBoxUserSelectedButtonsjintID = curEnv->GetStaticMethodID(cls, "getMessageBoxUserSelectedButtons", "(I)[I" ) ;
+ if (jintArraygetMessageBoxUserSelectedButtonsjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getMessageBoxUserSelectedButtons" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMessageBoxUserSelectedButtons");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetMessageBoxUserSelectedButtonsjintID ,id);
+@@ -3422,11 +2927,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -3439,9 +2942,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxButtonsLabelsjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxButtonsLabels", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxButtonsLabelsjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxButtonsLabels" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxButtonsLabels");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3449,8 +2950,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray labels_ = curEnv->NewObjectArray( labelsSize, stringArrayClass, NULL);
+ if (labels_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3459,8 +2959,7 @@ for ( int i = 0; i < labelsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( labels[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( labels_, i, TempString);
+@@ -3471,11 +2970,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxButtonsLabelsjintjobjectArrayID ,id, labels_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(labels_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxInitialValue (JavaVM * jvm_, int id, char ** value, int valueSize){
+@@ -3486,9 +2983,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxInitialValuejintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxInitialValue", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxInitialValuejintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxInitialValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxInitialValue");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3496,8 +2991,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray value_ = curEnv->NewObjectArray( valueSize, stringArrayClass, NULL);
+ if (value_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3506,8 +3000,7 @@ for ( int i = 0; i < valueSize; i++)
+ jstring TempString = curEnv->NewStringUTF( value[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( value_, i, TempString);
+@@ -3518,11 +3011,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxInitialValuejintjobjectArrayID ,id, value_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(value_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char ** CallScilabBridge::getMessageBoxValue (JavaVM * jvm_, int id){
+@@ -3533,17 +3024,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetMessageBoxValuejintID = curEnv->GetStaticMethodID(cls, "getMessageBoxValue", "(I)[Ljava/lang/String;" ) ;
+ if (jobjectArraygetMessageBoxValuejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getMessageBoxValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMessageBoxValue");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetMessageBoxValuejintID ,id);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -3556,11 +3043,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -3574,17 +3059,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetMessageBoxValueSizejintID = curEnv->GetStaticMethodID(cls, "getMessageBoxValueSize", "(I)I" ) ;
+ if (jintgetMessageBoxValueSizejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getMessageBoxValueSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMessageBoxValueSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetMessageBoxValueSizejintID ,id);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -3597,9 +3078,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxListBoxItemsjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxListBoxItems", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxListBoxItemsjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxListBoxItems" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxListBoxItems");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3607,8 +3086,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray items_ = curEnv->NewObjectArray( itemsSize, stringArrayClass, NULL);
+ if (items_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3617,8 +3095,7 @@ for ( int i = 0; i < itemsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( items[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( items_, i, TempString);
+@@ -3629,11 +3106,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxListBoxItemsjintjobjectArrayID ,id, items_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(items_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getMessageBoxSelectedItem (JavaVM * jvm_, int id){
+@@ -3644,17 +3119,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetMessageBoxSelectedItemjintID = curEnv->GetStaticMethodID(cls, "getMessageBoxSelectedItem", "(I)I" ) ;
+ if (jintgetMessageBoxSelectedItemjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getMessageBoxSelectedItem" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMessageBoxSelectedItem");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetMessageBoxSelectedItemjintID ,id);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -3667,9 +3138,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxLineLabelsjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxLineLabels", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxLineLabelsjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxLineLabels" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxLineLabels");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3677,8 +3146,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray labels_ = curEnv->NewObjectArray( labelsSize, stringArrayClass, NULL);
+ if (labels_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3687,8 +3155,7 @@ for ( int i = 0; i < labelsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( labels[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( labels_, i, TempString);
+@@ -3699,11 +3166,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxLineLabelsjintjobjectArrayID ,id, labels_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(labels_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxColumnLabels (JavaVM * jvm_, int id, char ** labels, int labelsSize){
+@@ -3714,9 +3179,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxColumnLabelsjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxColumnLabels", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxColumnLabelsjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxColumnLabels" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxColumnLabels");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3724,8 +3187,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray labels_ = curEnv->NewObjectArray( labelsSize, stringArrayClass, NULL);
+ if (labels_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3734,8 +3196,7 @@ for ( int i = 0; i < labelsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( labels[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( labels_, i, TempString);
+@@ -3746,11 +3207,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxColumnLabelsjintjobjectArrayID ,id, labels_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(labels_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxDefaultInput (JavaVM * jvm_, int id, char ** values, int valuesSize){
+@@ -3761,9 +3220,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxDefaultInputjintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setMessageBoxDefaultInput", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetMessageBoxDefaultInputjintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxDefaultInput" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxDefaultInput");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3771,8 +3228,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray values_ = curEnv->NewObjectArray( valuesSize, stringArrayClass, NULL);
+ if (values_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3781,8 +3237,7 @@ for ( int i = 0; i < valuesSize; i++)
+ jstring TempString = curEnv->NewStringUTF( values[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( values_, i, TempString);
+@@ -3793,11 +3248,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxDefaultInputjintjobjectArrayID ,id, values_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(values_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxModal (JavaVM * jvm_, int id, bool status){
+@@ -3808,19 +3261,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxModaljintjbooleanID = curEnv->GetStaticMethodID(cls, "setMessageBoxModal", "(IZ)V" ) ;
+ if (voidsetMessageBoxModaljintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxModal" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxModal");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxModaljintjbooleanID ,id, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setMessageBoxIcon (JavaVM * jvm_, int id, char * name){
+@@ -3831,19 +3280,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetMessageBoxIconjintjstringID = curEnv->GetStaticMethodID(cls, "setMessageBoxIcon", "(ILjava/lang/String;)V" ) ;
+ if (voidsetMessageBoxIconjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setMessageBoxIcon" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setMessageBoxIcon");
+ }
+ 
+ jstring name_ = curEnv->NewStringUTF( name );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetMessageBoxIconjintjstringID ,id, name_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::isToolbarVisible (JavaVM * jvm_, int figNum){
+@@ -3854,17 +3299,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisToolbarVisiblejintID = curEnv->GetStaticMethodID(cls, "isToolbarVisible", "(I)Z" ) ;
+ if (jbooleanisToolbarVisiblejintID == NULL) {
+-std::cerr << "Could not access to the method " << "isToolbarVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isToolbarVisible");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisToolbarVisiblejintID ,figNum);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -3877,19 +3318,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetToolbarVisiblejintjbooleanID = curEnv->GetStaticMethodID(cls, "setToolbarVisible", "(IZ)V" ) ;
+ if (voidsetToolbarVisiblejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setToolbarVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setToolbarVisible");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetToolbarVisiblejintjbooleanID ,figNum, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setEventHandler (JavaVM * jvm_, int figNum, char * command){
+@@ -3900,19 +3337,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetEventHandlerjintjstringID = curEnv->GetStaticMethodID(cls, "setEventHandler", "(ILjava/lang/String;)V" ) ;
+ if (voidsetEventHandlerjintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setEventHandler" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setEventHandler");
+ }
+ 
+ jstring command_ = curEnv->NewStringUTF( command );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetEventHandlerjintjstringID ,figNum, command_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setEventHandlerEnabled (JavaVM * jvm_, int figNum, bool status){
+@@ -3923,19 +3356,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetEventHandlerEnabledjintjbooleanID = curEnv->GetStaticMethodID(cls, "setEventHandlerEnabled", "(IZ)V" ) ;
+ if (voidsetEventHandlerEnabledjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setEventHandlerEnabled" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setEventHandlerEnabled");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetEventHandlerEnabledjintjbooleanID ,figNum, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::newWaitBar (JavaVM * jvm_){
+@@ -3946,17 +3375,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewWaitBarID = curEnv->GetStaticMethodID(cls, "newWaitBar", "()I" ) ;
+ if (jintnewWaitBarID == NULL) {
+-std::cerr << "Could not access to the method " << "newWaitBar" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newWaitBar");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewWaitBarID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -3969,9 +3394,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWaitBarMessagejintjobjectArrayID = curEnv->GetStaticMethodID(cls, "setWaitBarMessage", "(I[Ljava/lang/String;)V" ) ;
+ if (voidsetWaitBarMessagejintjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setWaitBarMessage" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWaitBarMessage");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -3979,8 +3402,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray message_ = curEnv->NewObjectArray( messageSize, stringArrayClass, NULL);
+ if (message_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -3989,8 +3411,7 @@ for ( int i = 0; i < messageSize; i++)
+ jstring TempString = curEnv->NewStringUTF( message[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( message_, i, TempString);
+@@ -4001,11 +3422,9 @@ curEnv->DeleteLocalRef(TempString);
+                          curEnv->CallStaticVoidMethod(cls, voidsetWaitBarMessagejintjobjectArrayID ,id, message_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(message_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWaitBarValue (JavaVM * jvm_, int id, int value){
+@@ -4016,17 +3435,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWaitBarValuejintjintID = curEnv->GetStaticMethodID(cls, "setWaitBarValue", "(II)V" ) ;
+ if (voidsetWaitBarValuejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setWaitBarValue" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWaitBarValue");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWaitBarValuejintjintID ,id, value);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::destroyWaitBar (JavaVM * jvm_, int objID){
+@@ -4037,17 +3452,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiddestroyWaitBarjintID = curEnv->GetStaticMethodID(cls, "destroyWaitBar", "(I)V" ) ;
+ if (voiddestroyWaitBarjintID == NULL) {
+-std::cerr << "Could not access to the method " << "destroyWaitBar" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "destroyWaitBar");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiddestroyWaitBarjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWaitBarIndeterminateMode (JavaVM * jvm_, int objID, bool status){
+@@ -4058,19 +3469,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWaitBarIndeterminateModejintjbooleanID = curEnv->GetStaticMethodID(cls, "setWaitBarIndeterminateMode", "(IZ)V" ) ;
+ if (voidsetWaitBarIndeterminateModejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setWaitBarIndeterminateMode" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWaitBarIndeterminateMode");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWaitBarIndeterminateModejintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::launchHelpBrowser (JavaVM * jvm_, char ** helps, int helpsSize, char * language){
+@@ -4081,9 +3488,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidlaunchHelpBrowserjobjectArrayjstringID = curEnv->GetStaticMethodID(cls, "launchHelpBrowser", "([Ljava/lang/String;Ljava/lang/String;)V" ) ;
+ if (voidlaunchHelpBrowserjobjectArrayjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "launchHelpBrowser" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "launchHelpBrowser");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -4091,8 +3496,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray helps_ = curEnv->NewObjectArray( helpsSize, stringArrayClass, NULL);
+ if (helps_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -4101,8 +3505,7 @@ for ( int i = 0; i < helpsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( helps[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( helps_, i, TempString);
+@@ -4115,11 +3518,9 @@ jstring language_ = curEnv->NewStringUTF( language );
+                          curEnv->CallStaticVoidMethod(cls, voidlaunchHelpBrowserjobjectArrayjstringID ,helps_, language_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(helps_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::searchKeyword (JavaVM * jvm_, char ** helps, int helpsSize, char * keyword, char * language, bool fullText){
+@@ -4130,9 +3531,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsearchKeywordjobjectArrayjstringjstringjbooleanID = curEnv->GetStaticMethodID(cls, "searchKeyword", "([Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V" ) ;
+ if (voidsearchKeywordjobjectArrayjstringjstringjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "searchKeyword" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "searchKeyword");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -4140,8 +3539,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray helps_ = curEnv->NewObjectArray( helpsSize, stringArrayClass, NULL);
+ if (helps_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -4150,8 +3548,7 @@ for ( int i = 0; i < helpsSize; i++)
+ jstring TempString = curEnv->NewStringUTF( helps[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( helps_, i, TempString);
+@@ -4168,11 +3565,9 @@ jboolean fullText_ = ((bool) fullText ? JNI_TRUE : JNI_FALSE);
+                          curEnv->CallStaticVoidMethod(cls, voidsearchKeywordjobjectArrayjstringjstringjbooleanID ,helps_, keyword_, language_, fullText_);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(helps_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::saveMainWindowSettings (JavaVM * jvm_){
+@@ -4183,17 +3578,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsaveMainWindowSettingsID = curEnv->GetStaticMethodID(cls, "saveMainWindowSettings", "()V" ) ;
+ if (voidsaveMainWindowSettingsID == NULL) {
+-std::cerr << "Could not access to the method " << "saveMainWindowSettings" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "saveMainWindowSettings");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsaveMainWindowSettingsID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::newExportFileChooser (JavaVM * jvm_, int figureId){
+@@ -4204,17 +3595,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewExportFileChooserjintID = curEnv->GetStaticMethodID(cls, "newExportFileChooser", "(I)I" ) ;
+ if (jintnewExportFileChooserjintID == NULL) {
+-std::cerr << "Could not access to the method " << "newExportFileChooser" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newExportFileChooser");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewExportFileChooserjintID ,figureId);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4227,17 +3614,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewFontChooserID = curEnv->GetStaticMethodID(cls, "newFontChooser", "()I" ) ;
+ if (jintnewFontChooserID == NULL) {
+-std::cerr << "Could not access to the method " << "newFontChooser" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newFontChooser");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewFontChooserID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4250,17 +3633,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidfontChooserDisplayAndWaitjintID = curEnv->GetStaticMethodID(cls, "fontChooserDisplayAndWait", "(I)V" ) ;
+ if (voidfontChooserDisplayAndWaitjintID == NULL) {
+-std::cerr << "Could not access to the method " << "fontChooserDisplayAndWait" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "fontChooserDisplayAndWait");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidfontChooserDisplayAndWaitjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFontChooserFontName (JavaVM * jvm_, int objID, char * fontName){
+@@ -4271,19 +3650,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFontChooserFontNamejintjstringID = curEnv->GetStaticMethodID(cls, "setFontChooserFontName", "(ILjava/lang/String;)V" ) ;
+ if (voidsetFontChooserFontNamejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setFontChooserFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFontChooserFontName");
+ }
+ 
+ jstring fontName_ = curEnv->NewStringUTF( fontName );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFontChooserFontNamejintjstringID ,objID, fontName_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFontChooserFontSize (JavaVM * jvm_, int objID, int fontSize){
+@@ -4294,17 +3669,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFontChooserFontSizejintjintID = curEnv->GetStaticMethodID(cls, "setFontChooserFontSize", "(II)V" ) ;
+ if (voidsetFontChooserFontSizejintjintID == NULL) {
+-std::cerr << "Could not access to the method " << "setFontChooserFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFontChooserFontSize");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFontChooserFontSizejintjintID ,objID, fontSize);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFontChooserBold (JavaVM * jvm_, int objID, bool bold){
+@@ -4315,19 +3686,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFontChooserBoldjintjbooleanID = curEnv->GetStaticMethodID(cls, "setFontChooserBold", "(IZ)V" ) ;
+ if (voidsetFontChooserBoldjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFontChooserBold" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFontChooserBold");
+ }
+ 
+ jboolean bold_ = ((bool) bold ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFontChooserBoldjintjbooleanID ,objID, bold_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFontChooserItalic (JavaVM * jvm_, int objID, bool italic){
+@@ -4338,19 +3705,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFontChooserItalicjintjbooleanID = curEnv->GetStaticMethodID(cls, "setFontChooserItalic", "(IZ)V" ) ;
+ if (voidsetFontChooserItalicjintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFontChooserItalic" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFontChooserItalic");
+ }
+ 
+ jboolean italic_ = ((bool) italic ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFontChooserItalicjintjbooleanID ,objID, italic_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * CallScilabBridge::getFontChooserFontName (JavaVM * jvm_, int objID){
+@@ -4361,28 +3724,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetFontChooserFontNamejintID = curEnv->GetStaticMethodID(cls, "getFontChooserFontName", "(I)Ljava/lang/String;" ) ;
+ if (jstringgetFontChooserFontNamejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFontChooserFontName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFontChooserFontName");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetFontChooserFontNamejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -4395,17 +3752,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetFontChooserFontSizejintID = curEnv->GetStaticMethodID(cls, "getFontChooserFontSize", "(I)I" ) ;
+ if (jintgetFontChooserFontSizejintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFontChooserFontSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFontChooserFontSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetFontChooserFontSizejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4418,17 +3771,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleangetFontChooserBoldjintID = curEnv->GetStaticMethodID(cls, "getFontChooserBold", "(I)Z" ) ;
+ if (jbooleangetFontChooserBoldjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFontChooserBold" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFontChooserBold");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleangetFontChooserBoldjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4441,17 +3790,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleangetFontChooserItalicjintID = curEnv->GetStaticMethodID(cls, "getFontChooserItalic", "(I)Z" ) ;
+ if (jbooleangetFontChooserItalicjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getFontChooserItalic" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFontChooserItalic");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleangetFontChooserItalicjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4464,17 +3809,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintnewColorChooserID = curEnv->GetStaticMethodID(cls, "newColorChooser", "()I" ) ;
+ if (jintnewColorChooserID == NULL) {
+-std::cerr << "Could not access to the method " << "newColorChooser" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "newColorChooser");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintnewColorChooserID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4487,17 +3828,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidcolorChooserDisplayAndWaitjintID = curEnv->GetStaticMethodID(cls, "colorChooserDisplayAndWait", "(I)V" ) ;
+ if (voidcolorChooserDisplayAndWaitjintID == NULL) {
+-std::cerr << "Could not access to the method " << "colorChooserDisplayAndWait" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "colorChooserDisplayAndWait");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidcolorChooserDisplayAndWaitjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setColorChooserDefaultColor (JavaVM * jvm_, int objID, int * rgb, int rgbSize){
+@@ -4508,23 +3845,25 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetColorChooserDefaultColorjintjintArrayID = curEnv->GetStaticMethodID(cls, "setColorChooserDefaultColor", "(I[I)V" ) ;
+ if (voidsetColorChooserDefaultColorjintjintArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "setColorChooserDefaultColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setColorChooserDefaultColor");
+ }
+ 
+ jintArray rgb_ = curEnv->NewIntArray( rgbSize ) ;
+ 
++if (rgb_ == NULL)
++{
++// check that allocation succeed
++throw GiwsException::JniBadAllocException(curEnv);
++}
++
+ curEnv->SetIntArrayRegion( rgb_, 0, rgbSize, (jint*) rgb ) ;
+ 
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetColorChooserDefaultColorjintjintArrayID ,objID, rgb_);
+ curEnv->DeleteLocalRef(rgb_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int * CallScilabBridge::getColorChooserSelectedColor (JavaVM * jvm_, int objID){
+@@ -4535,9 +3874,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintArraygetColorChooserSelectedColorjintID = curEnv->GetStaticMethodID(cls, "getColorChooserSelectedColor", "(I)[I" ) ;
+ if (jintArraygetColorChooserSelectedColorjintID == NULL) {
+-std::cerr << "Could not access to the method " << "getColorChooserSelectedColor" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getColorChooserSelectedColor");
+ }
+ 
+                         jintArray res =  (jintArray) curEnv->CallObjectMethod(cls, jintArraygetColorChooserSelectedColorjintID ,objID);
+@@ -4555,11 +3892,9 @@ myArray[i]=resultsArray[i];
+ curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+ 
+                         curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myArray;
+ 
+ }
+@@ -4572,19 +3907,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetColorChooserTitlejintjstringID = curEnv->GetStaticMethodID(cls, "setColorChooserTitle", "(ILjava/lang/String;)V" ) ;
+ if (voidsetColorChooserTitlejintjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setColorChooserTitle" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setColorChooserTitle");
+ }
+ 
+ jstring title_ = curEnv->NewStringUTF( title );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetColorChooserTitlejintjstringID ,objID, title_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setWidgetVisible (JavaVM * jvm_, int objID, bool status){
+@@ -4595,19 +3926,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetWidgetVisiblejintjbooleanID = curEnv->GetStaticMethodID(cls, "setWidgetVisible", "(IZ)V" ) ;
+ if (voidsetWidgetVisiblejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setWidgetVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setWidgetVisible");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetWidgetVisiblejintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setFrameVisible (JavaVM * jvm_, int objID, bool status){
+@@ -4618,19 +3945,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetFrameVisiblejintjbooleanID = curEnv->GetStaticMethodID(cls, "setFrameVisible", "(IZ)V" ) ;
+ if (voidsetFrameVisiblejintjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "setFrameVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setFrameVisible");
+ }
+ 
+ jboolean status_ = ((bool) status ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetFrameVisiblejintjbooleanID ,objID, status_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::isWidgetVisible (JavaVM * jvm_, int objID){
+@@ -4641,17 +3964,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisWidgetVisiblejintID = curEnv->GetStaticMethodID(cls, "isWidgetVisible", "(I)Z" ) ;
+ if (jbooleanisWidgetVisiblejintID == NULL) {
+-std::cerr << "Could not access to the method " << "isWidgetVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isWidgetVisible");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisWidgetVisiblejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4664,17 +3983,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisFrameVisiblejintID = curEnv->GetStaticMethodID(cls, "isFrameVisible", "(I)Z" ) ;
+ if (jbooleanisFrameVisiblejintID == NULL) {
+-std::cerr << "Could not access to the method " << "isFrameVisible" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isFrameVisible");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisFrameVisiblejintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4687,28 +4002,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetClipboardContentsID = curEnv->GetStaticMethodID(cls, "getClipboardContents", "()Ljava/lang/String;" ) ;
+ if (jstringgetClipboardContentsID == NULL) {
+-std::cerr << "Could not access to the method " << "getClipboardContents" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getClipboardContents");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetClipboardContentsID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -4721,17 +4030,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidpasteClipboardIntoConsoleID = curEnv->GetStaticMethodID(cls, "pasteClipboardIntoConsole", "()V" ) ;
+ if (voidpasteClipboardIntoConsoleID == NULL) {
+-std::cerr << "Could not access to the method " << "pasteClipboardIntoConsole" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "pasteClipboardIntoConsole");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidpasteClipboardIntoConsoleID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::copyConsoleSelection (JavaVM * jvm_){
+@@ -4742,17 +4047,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidcopyConsoleSelectionID = curEnv->GetStaticMethodID(cls, "copyConsoleSelection", "()V" ) ;
+ if (voidcopyConsoleSelectionID == NULL) {
+-std::cerr << "Could not access to the method " << "copyConsoleSelection" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "copyConsoleSelection");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidcopyConsoleSelectionID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::emptyClipboard (JavaVM * jvm_){
+@@ -4763,17 +4064,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidemptyClipboardID = curEnv->GetStaticMethodID(cls, "emptyClipboard", "()V" ) ;
+ if (voidemptyClipboardID == NULL) {
+-std::cerr << "Could not access to the method " << "emptyClipboard" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "emptyClipboard");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidemptyClipboardID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::setClipboardContents (JavaVM * jvm_, char * text){
+@@ -4784,19 +4081,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidsetClipboardContentsjstringID = curEnv->GetStaticMethodID(cls, "setClipboardContents", "(Ljava/lang/String;)V" ) ;
+ if (voidsetClipboardContentsjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "setClipboardContents" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "setClipboardContents");
+ }
+ 
+ jstring text_ = curEnv->NewStringUTF( text );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidsetClipboardContentsjstringID ,text_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::copyFigureToClipBoard (JavaVM * jvm_, int figID){
+@@ -4807,17 +4100,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidcopyFigureToClipBoardjintID = curEnv->GetStaticMethodID(cls, "copyFigureToClipBoard", "(I)V" ) ;
+ if (voidcopyFigureToClipBoardjintID == NULL) {
+-std::cerr << "Could not access to the method " << "copyFigureToClipBoard" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "copyFigureToClipBoard");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidcopyFigureToClipBoardjintID ,figID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ int CallScilabBridge::getScreenResolution (JavaVM * jvm_){
+@@ -4828,17 +4117,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetScreenResolutionID = curEnv->GetStaticMethodID(cls, "getScreenResolution", "()I" ) ;
+ if (jintgetScreenResolutionID == NULL) {
+-std::cerr << "Could not access to the method " << "getScreenResolution" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getScreenResolution");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetScreenResolutionID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4851,17 +4136,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jdoublegetScreenWidthID = curEnv->GetStaticMethodID(cls, "getScreenWidth", "()D" ) ;
+ if (jdoublegetScreenWidthID == NULL) {
+-std::cerr << "Could not access to the method " << "getScreenWidth" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getScreenWidth");
+ }
+ 
+                         jdouble res =  (jdouble) curEnv->CallStaticDoubleMethod(cls, jdoublegetScreenWidthID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4874,17 +4155,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jdoublegetScreenHeightID = curEnv->GetStaticMethodID(cls, "getScreenHeight", "()D" ) ;
+ if (jdoublegetScreenHeightID == NULL) {
+-std::cerr << "Could not access to the method " << "getScreenHeight" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getScreenHeight");
+ }
+ 
+                         jdouble res =  (jdouble) curEnv->CallStaticDoubleMethod(cls, jdoublegetScreenHeightID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4897,17 +4174,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetScreenDepthID = curEnv->GetStaticMethodID(cls, "getScreenDepth", "()I" ) ;
+ if (jintgetScreenDepthID == NULL) {
+-std::cerr << "Could not access to the method " << "getScreenDepth" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getScreenDepth");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetScreenDepthID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -4920,9 +4193,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanprintFigurejintjbooleanjbooleanID = curEnv->GetStaticMethodID(cls, "printFigure", "(IZZ)Z" ) ;
+ if (jbooleanprintFigurejintjbooleanjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "printFigure" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "printFigure");
+ }
+ 
+ jboolean postScript_ = ((bool) postScript ? JNI_TRUE : JNI_FALSE);
+@@ -4930,11 +4201,9 @@ jboolean postScript_ = ((bool) postScript ? JNI_TRUE : JNI_FALSE);
+ jboolean displayDialog_ = ((bool) displayDialog ? JNI_TRUE : JNI_FALSE);
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanprintFigurejintjbooleanjbooleanID ,figID, postScript_, displayDialog_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4947,19 +4216,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanprintFilejstringID = curEnv->GetStaticMethodID(cls, "printFile", "(Ljava/lang/String;)Z" ) ;
+ if (jbooleanprintFilejstringID == NULL) {
+-std::cerr << "Could not access to the method " << "printFile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "printFile");
+ }
+ 
+ jstring fileName_ = curEnv->NewStringUTF( fileName );
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanprintFilejstringID ,fileName_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4972,9 +4237,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanprintStringjstringjstringID = curEnv->GetStaticMethodID(cls, "printString", "(Ljava/lang/String;Ljava/lang/String;)Z" ) ;
+ if (jbooleanprintStringjstringjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "printString" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "printString");
+ }
+ 
+ jstring theString_ = curEnv->NewStringUTF( theString );
+@@ -4982,11 +4245,9 @@ jstring theString_ = curEnv->NewStringUTF( theString );
+ jstring pageHeader_ = curEnv->NewStringUTF( pageHeader );
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanprintStringjstringjstringID ,theString_, pageHeader_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -4999,17 +4260,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanpageSetupID = curEnv->GetStaticMethodID(cls, "pageSetup", "()Z" ) ;
+ if (jbooleanpageSetupID == NULL) {
+-std::cerr << "Could not access to the method " << "pageSetup" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "pageSetup");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanpageSetupID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -5022,17 +4279,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidrequestWidgetFocusjintID = curEnv->GetStaticMethodID(cls, "requestWidgetFocus", "(I)V" ) ;
+ if (voidrequestWidgetFocusjintID == NULL) {
+-std::cerr << "Could not access to the method " << "requestWidgetFocus" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "requestWidgetFocus");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidrequestWidgetFocusjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::requestFrameFocus (JavaVM * jvm_, int objID){
+@@ -5043,17 +4296,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidrequestFrameFocusjintID = curEnv->GetStaticMethodID(cls, "requestFrameFocus", "(I)V" ) ;
+ if (voidrequestFrameFocusjintID == NULL) {
+-std::cerr << "Could not access to the method " << "requestFrameFocus" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "requestFrameFocus");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidrequestFrameFocusjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::raiseWindow (JavaVM * jvm_, int objID){
+@@ -5064,17 +4313,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voidraiseWindowjintID = curEnv->GetStaticMethodID(cls, "raiseWindow", "(I)V" ) ;
+ if (voidraiseWindowjintID == NULL) {
+-std::cerr << "Could not access to the method " << "raiseWindow" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "raiseWindow");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voidraiseWindowjintID ,objID);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void CallScilabBridge::useCanvasForDisplay (JavaVM * jvm_, bool onOrOff){
+@@ -5085,19 +4330,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduseCanvasForDisplayjbooleanID = curEnv->GetStaticMethodID(cls, "useCanvasForDisplay", "(Z)V" ) ;
+ if (voiduseCanvasForDisplayjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "useCanvasForDisplay" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "useCanvasForDisplay");
+ }
+ 
+ jboolean onOrOff_ = ((bool) onOrOff ? JNI_TRUE : JNI_FALSE);
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiduseCanvasForDisplayjbooleanID ,onOrOff_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ bool CallScilabBridge::useCanvasForDisplay (JavaVM * jvm_){
+@@ -5108,17 +4349,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanuseCanvasForDisplayID = curEnv->GetStaticMethodID(cls, "useCanvasForDisplay", "()Z" ) ;
+ if (jbooleanuseCanvasForDisplayID == NULL) {
+-std::cerr << "Could not access to the method " << "useCanvasForDisplay" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "useCanvasForDisplay");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanuseCanvasForDisplayID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+diff --git a/scilab/modules/gui/src/jni/CallScilabBridge.hxx b/scilab/modules/gui/src/jni/CallScilabBridge.hxx
+index 0c84828..43a4746 100644
+--- a/scilab/modules/gui/src/jni/CallScilabBridge.hxx
++++ b/scilab/modules/gui/src/jni/CallScilabBridge.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -44,6 +44,8 @@ knowledge of the CeCILL-B license and that you accept its terms.
+ #include <stdlib.h>
+ #include <jni.h>
+ 
++#include "GiwsException.hxx"
++
+ namespace org_scilab_modules_gui_bridge {
+ 
+ class CallScilabBridge {
+diff --git a/scilab/modules/gui/src/jni/GiwsException.cpp b/scilab/modules/gui/src/jni/GiwsException.cpp
+index fc4d53c..234e52b 100644
+--- a/scilab/modules/gui/src/jni/GiwsException.cpp
++++ b/scilab/modules/gui/src/jni/GiwsException.cpp
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -47,7 +47,7 @@ namespace GiwsException {
+ */
+ JniException::JniException(JNIEnv * curEnv) throw() : exception()
+ {
+-// retrieve informations about the exception
++// retrieve information about the exception
+ javaException = curEnv->ExceptionOccurred();
+ /* Clear the Java Exception to avoid calling it again & again */
+ curEnv->ExceptionClear();
+@@ -122,7 +122,7 @@ std::string JniException::retrieveExceptionMessage(JNIEnv * curEnv)
+ {
+ // return the result of the getLocalizedMessage method
+ 
+-// retrieve informations from the exception.
++// retrieve information from the exception.
+ // get method id
+ jmethodID getLocalizedMessageId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+                                                "getLocalizedMessage",
+@@ -153,7 +153,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+ 
+     // return the result of the getStackTrace method
+ 
+-    // retrieve informations from the exception.
++    // retrieve information from the exception.
+     // get method id
+     // getStackTrace returns an array of StackTraceElement
+     jmethodID getStackTraceId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+@@ -242,9 +242,9 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   }
+ 
+   /**
+-   * To be called when all the informations about the exceptions have been
++   * To be called when all the information about the exceptions have been
+    * retrived.
+-   * Remove the exception from the environement.
++   * Remove the exception from the environment.
+    */
+   void JniException::closeException(JNIEnv * curEnv)
+   {
+@@ -293,7 +293,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   */
+   
+   /**
+-  * @pram curEnv java environment where the exception occured.
++  * @param curEnv java environment where the exception occured.
+   */
+   JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv)
+   {
+@@ -305,7 +305,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   
+   JniCallMethodException::~JniCallMethodException(void) throw() {}
+   /**
+-  * @pram className name of the class which haven't been found
++  * @param className name of the class which haven't been found
+   */
+   JniClassNotFoundException::JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -316,7 +316,7 @@ setErrorMessage(errorMessage);
+   JniClassNotFoundException::~JniClassNotFoundException(void) throw() {}
+ 
+   /**
+-   * @pram className name of the method which haven't been found
++   * @param className name of the method which haven't been found
+    */
+   JniMethodNotFoundException::JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw() : JniException(curEnv)
+   {
+@@ -325,8 +325,9 @@ setErrorMessage(errorMessage);
+   }
+ 
+   JniMethodNotFoundException::~JniMethodNotFoundException(void) throw() {}
++  
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniObjectCreationException::JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -336,6 +337,17 @@ setErrorMessage(errorMessage);
+ 
+   JniObjectCreationException::~JniObjectCreationException(void) throw() {}
+ 
++  /**
++   * @param curEnv java envirnonment where the exception occured.
++   */
++  JniMonitorException::JniMonitorException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
++  {
++std::string errorMessage = "Error in the access (Enter or exit) or a Java env monitor of class " + className + ".";
++setErrorMessage(errorMessage);
++  }
++
++  JniMonitorException::~JniMonitorException(void) throw() {}
++
+ 
+ 
+ }
+diff --git a/scilab/modules/gui/src/jni/GiwsException.hxx b/scilab/modules/gui/src/jni/GiwsException.hxx
+index a2be211..73f8175 100644
+--- a/scilab/modules/gui/src/jni/GiwsException.hxx
++++ b/scilab/modules/gui/src/jni/GiwsException.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,9 +129,9 @@ std::string retrieveStackTrace(JNIEnv * curEnv);
+ */
+ std::string retrieveExceptionName(JNIEnv * curEnv);
+ /**
+-* To be called when all the informations about the exceptions have been
++* To be called when all the information about the exceptions have been
+ * retrived.
+-* Remove the exception from the environement.
++* Remove the exception from the environment.
+ */
+ void closeException(JNIEnv * curEnv);
+ 
+@@ -164,7 +164,7 @@ class JniCallMethodException : public JniException
+ public:
+ 
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniCallMethodException(JNIEnv * curEnv) throw();
+ 
+@@ -179,7 +179,7 @@ class JniClassNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the class which haven't been found
++* @param className name of the class which haven't been found
+ */
+ JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw();
+ 
+@@ -195,7 +195,7 @@ class JniMethodNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the method which haven't been found
++* @param className name of the method which haven't been found
+ */
+ JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw();
+ virtual ~JniMethodNotFoundException(void) throw();
+@@ -213,7 +213,7 @@ class JniObjectCreationException : public JniException
+ public:
+ 
+ /**
+-* @pram curEnv java envirnonment where the exception occured.
++* @param curEnv java envirnonment where the exception occured.
+ */
+ JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw();
+ virtual ~JniObjectCreationException(void) throw();
+@@ -221,6 +221,23 @@ virtual ~JniObjectCreationException(void) throw();
+ };
+ 
+ 
++/**
++* Exception that should be thrown when a call to the Java monitor
++* failed
++*/
++class JniMonitorException : public JniException
++{
++public:
++
++/**
++* @param curEnv java envirnonment where the exception occured.
++*/
++JniMonitorException(JNIEnv * curEnv, const std::string & className) throw();
++virtual ~JniMonitorException(void) throw();
++
++};
++
++
+ }
+ #endif
+ 
+diff --git a/scilab/modules/gui/src/jni/Juigetfile.cpp b/scilab/modules/gui/src/jni/Juigetfile.cpp
+index 27f005f..5f78ac1 100644
+--- a/scilab/modules/gui/src/jni/Juigetfile.cpp
++++ b/scilab/modules/gui/src/jni/Juigetfile.cpp
+@@ -1,5 +1,5 @@
+ #include "Juigetfile.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -68,9 +68,7 @@ JNIEnv * curEnv = getCurrentEnv();
+ 
+ localClass = curEnv->FindClass( this->className().c_str() ) ;
+ if (localClass == NULL) {
+-std::cerr << "Could not get the Class " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++  throw GiwsException::JniClassNotFoundException(curEnv, this->className());
+ }
+ 
+ this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass) ;
+@@ -79,31 +77,23 @@ this->instanceClass = (jclass) curEnv->NewGlobalRef(localClass) ;
+ curEnv->DeleteLocalRef(localClass);
+ 
+ if (this->instanceClass == NULL) {
+-std::cerr << "Could not create a Global Ref of " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ 
+ 
+ constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
+ if(constructObject == NULL){
+-std::cerr << "Could not retrieve the constructor of the class " << this->className() << " with the profile : " << construct << param << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ 
+ localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
+ if(localInstance == NULL){
+-std::cerr << "Could not instantiate the object " << this->className() << " with the constructor : " << construct << param << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+  
+ this->instance = curEnv->NewGlobalRef(localInstance) ;
+ if(this->instance == NULL){
+-std::cerr << "Could not create a new global ref of " << this->className() << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ /* localInstance not needed anymore */
+ curEnv->DeleteLocalRef(localInstance);
+@@ -142,18 +132,12 @@ jclass localClass = curEnv->GetObjectClass(JObj);
+         curEnv->DeleteLocalRef(localClass);
+ 
+         if (this->instanceClass == NULL) {
+-
+-std::cerr << "Could not create a Global Ref of " << this->className() <<  std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+         }
+ 
+         this->instance = curEnv->NewGlobalRef(JObj) ;
+         if(this->instance == NULL){
+-
+-std::cerr << "Could not create a new global ref of " << this->className() << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniObjectCreationException(curEnv, this->className());
+         }
+         /* Methods ID set to NULL */
+         voiduigetfileID=NULL; 
+@@ -181,22 +165,17 @@ voiduigetdirjstringjstringID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void Juigetfile::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Juigetfile");
+ }
+ }
+ 
+-
+ void Juigetfile::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Juigetfile");
+ }
+ }
+-
+ // Method(s)
+ 
+ void Juigetfile::uigetfile (JavaVM * jvm_){
+@@ -207,17 +186,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetfileID = curEnv->GetStaticMethodID(cls, "uigetfile", "()V" ) ;
+ if (voiduigetfileID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetfile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetfile");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiduigetfileID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetfile (JavaVM * jvm_, char ** mask, int maskSize, char ** description, int descriptionSize){
+@@ -228,9 +203,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetfilejobjectArrayjobjectArrayID = curEnv->GetStaticMethodID(cls, "uigetfile", "([Ljava/lang/String;[Ljava/lang/String;)V" ) ;
+ if (voiduigetfilejobjectArrayjobjectArrayID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetfile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetfile");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -238,8 +211,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray mask_ = curEnv->NewObjectArray( maskSize, stringArrayClass, NULL);
+ if (mask_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -248,8 +220,7 @@ for ( int i = 0; i < maskSize; i++)
+ jstring TempString = curEnv->NewStringUTF( mask[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( mask_, i, TempString);
+@@ -262,8 +233,7 @@ curEnv->DeleteLocalRef(TempString);
+ jobjectArray description_ = curEnv->NewObjectArray( descriptionSize, stringArrayClass, NULL);
+ if (description_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -272,8 +242,7 @@ for ( int i = 0; i < descriptionSize; i++)
+ jstring TempString = curEnv->NewStringUTF( description[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( description_, i, TempString);
+@@ -285,11 +254,9 @@ curEnv->DeleteLocalRef(TempString);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(mask_);
+ curEnv->DeleteLocalRef(description_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetfile (JavaVM * jvm_, char ** mask, int maskSize, char ** description, int descriptionSize, char * initialDirectory){
+@@ -300,9 +267,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetfilejobjectArrayjobjectArrayjstringID = curEnv->GetStaticMethodID(cls, "uigetfile", "([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V" ) ;
+ if (voiduigetfilejobjectArrayjobjectArrayjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetfile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetfile");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -310,8 +275,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray mask_ = curEnv->NewObjectArray( maskSize, stringArrayClass, NULL);
+ if (mask_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -320,8 +284,7 @@ for ( int i = 0; i < maskSize; i++)
+ jstring TempString = curEnv->NewStringUTF( mask[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( mask_, i, TempString);
+@@ -334,8 +297,7 @@ curEnv->DeleteLocalRef(TempString);
+ jobjectArray description_ = curEnv->NewObjectArray( descriptionSize, stringArrayClass, NULL);
+ if (description_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -344,8 +306,7 @@ for ( int i = 0; i < descriptionSize; i++)
+ jstring TempString = curEnv->NewStringUTF( description[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( description_, i, TempString);
+@@ -359,11 +320,9 @@ jstring initialDirectory_ = curEnv->NewStringUTF( initialDirectory );
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(mask_);
+ curEnv->DeleteLocalRef(description_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetfile (JavaVM * jvm_, char ** mask, int maskSize, char ** description, int descriptionSize, char * initialDirectory, char * boxtTitle){
+@@ -374,9 +333,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetfilejobjectArrayjobjectArrayjstringjstringID = curEnv->GetStaticMethodID(cls, "uigetfile", "([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V" ) ;
+ if (voiduigetfilejobjectArrayjobjectArrayjstringjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetfile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetfile");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -384,8 +341,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray mask_ = curEnv->NewObjectArray( maskSize, stringArrayClass, NULL);
+ if (mask_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -394,8 +350,7 @@ for ( int i = 0; i < maskSize; i++)
+ jstring TempString = curEnv->NewStringUTF( mask[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( mask_, i, TempString);
+@@ -408,8 +363,7 @@ curEnv->DeleteLocalRef(TempString);
+ jobjectArray description_ = curEnv->NewObjectArray( descriptionSize, stringArrayClass, NULL);
+ if (description_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -418,8 +372,7 @@ for ( int i = 0; i < descriptionSize; i++)
+ jstring TempString = curEnv->NewStringUTF( description[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( description_, i, TempString);
+@@ -435,11 +388,9 @@ jstring boxtTitle_ = curEnv->NewStringUTF( boxtTitle );
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(mask_);
+ curEnv->DeleteLocalRef(description_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetfile (JavaVM * jvm_, char ** mask, int maskSize, char ** description, int descriptionSize, char * initialDirectory, char * boxtTitle, bool multipleSelection){
+@@ -450,9 +401,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetfilejobjectArrayjobjectArrayjstringjstringjbooleanID = curEnv->GetStaticMethodID(cls, "uigetfile", "([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V" ) ;
+ if (voiduigetfilejobjectArrayjobjectArrayjstringjstringjbooleanID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetfile" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetfile");
+ }
+ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ 
+@@ -460,8 +409,7 @@ jclass stringArrayClass = curEnv->FindClass("java/lang/String");
+ jobjectArray mask_ = curEnv->NewObjectArray( maskSize, stringArrayClass, NULL);
+ if (mask_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -470,8 +418,7 @@ for ( int i = 0; i < maskSize; i++)
+ jstring TempString = curEnv->NewStringUTF( mask[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( mask_, i, TempString);
+@@ -484,8 +431,7 @@ curEnv->DeleteLocalRef(TempString);
+ jobjectArray description_ = curEnv->NewObjectArray( descriptionSize, stringArrayClass, NULL);
+ if (description_ == NULL)
+ {
+-std::cerr << "Could not allocate Java string array, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ // convert each char * to java strings and fill the java array.
+@@ -494,8 +440,7 @@ for ( int i = 0; i < descriptionSize; i++)
+ jstring TempString = curEnv->NewStringUTF( description[i] );
+ if (TempString == NULL)
+ {
+-std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniBadAllocException(curEnv);
+ }
+ 
+ curEnv->SetObjectArrayElement( description_, i, TempString);
+@@ -513,11 +458,9 @@ jboolean multipleSelection_ = ((bool) multipleSelection ? JNI_TRUE : JNI_FALSE);
+ curEnv->DeleteLocalRef(stringArrayClass);
+ curEnv->DeleteLocalRef(mask_);
+ curEnv->DeleteLocalRef(description_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ char * Juigetfile::getTitleBox (JavaVM * jvm_){
+@@ -528,28 +471,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetTitleBoxID = curEnv->GetStaticMethodID(cls, "getTitleBox", "()Ljava/lang/String;" ) ;
+ if (jstringgetTitleBoxID == NULL) {
+-std::cerr << "Could not access to the method " << "getTitleBox" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getTitleBox");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetTitleBoxID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -562,17 +499,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetMaskID = curEnv->GetStaticMethodID(cls, "getMask", "()[Ljava/lang/String;" ) ;
+ if (jobjectArraygetMaskID == NULL) {
+-std::cerr << "Could not access to the method " << "getMask" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMask");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetMaskID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -585,11 +518,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -603,17 +534,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetMaskDescriptionID = curEnv->GetStaticMethodID(cls, "getMaskDescription", "()[Ljava/lang/String;" ) ;
+ if (jobjectArraygetMaskDescriptionID == NULL) {
+-std::cerr << "Could not access to the method " << "getMaskDescription" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMaskDescription");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetMaskDescriptionID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -626,11 +553,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -644,28 +569,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetInitialDirectoryID = curEnv->GetStaticMethodID(cls, "getInitialDirectory", "()Ljava/lang/String;" ) ;
+ if (jstringgetInitialDirectoryID == NULL) {
+-std::cerr << "Could not access to the method " << "getInitialDirectory" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getInitialDirectory");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetInitialDirectoryID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -678,17 +597,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetSelectionSizeID = curEnv->GetStaticMethodID(cls, "getSelectionSize", "()I" ) ;
+ if (jintgetSelectionSizeID == NULL) {
+-std::cerr << "Could not access to the method " << "getSelectionSize" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getSelectionSize");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetSelectionSizeID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -701,17 +616,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetSelectionID = curEnv->GetStaticMethodID(cls, "getSelection", "()[Ljava/lang/String;" ) ;
+ if (jobjectArraygetSelectionID == NULL) {
+-std::cerr << "Could not access to the method " << "getSelection" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getSelection");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetSelectionID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -724,11 +635,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -742,17 +651,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jobjectArraygetSelectionFileNamesID = curEnv->GetStaticMethodID(cls, "getSelectionFileNames", "()[Ljava/lang/String;" ) ;
+ if (jobjectArraygetSelectionFileNamesID == NULL) {
+-std::cerr << "Could not access to the method " << "getSelectionFileNames" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getSelectionFileNames");
+ }
+ 
+                         jobjectArray res =  (jobjectArray) curEnv->CallObjectMethod(cls, jobjectArraygetSelectionFileNamesID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ jsize len = curEnv->GetArrayLength(res);
+ char **arrayOfString;
+                         arrayOfString= arrayOfString= new char *[len + 1];
+@@ -765,11 +670,9 @@ strcpy(arrayOfString[i], tempString);
+ curEnv->ReleaseStringUTFChars(resString, tempString);
+ curEnv->DeleteLocalRef(resString);
+ }
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ curEnv->DeleteLocalRef(res);
+ return arrayOfString;
+ 
+@@ -783,17 +686,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jbooleanisMultipleSelectionID = curEnv->GetStaticMethodID(cls, "isMultipleSelection", "()Z" ) ;
+ if (jbooleanisMultipleSelectionID == NULL) {
+-std::cerr << "Could not access to the method " << "isMultipleSelection" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "isMultipleSelection");
+ }
+ 
+                         jboolean res =  (jboolean) curEnv->CallStaticBooleanMethod(cls, jbooleanisMultipleSelectionID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return (res == JNI_TRUE);
+ 
+ }
+@@ -806,28 +705,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetSelectionPathNameID = curEnv->GetStaticMethodID(cls, "getSelectionPathName", "()Ljava/lang/String;" ) ;
+ if (jstringgetSelectionPathNameID == NULL) {
+-std::cerr << "Could not access to the method " << "getSelectionPathName" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getSelectionPathName");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetSelectionPathNameID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -840,17 +733,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jintgetFilterIndexID = curEnv->GetStaticMethodID(cls, "getFilterIndex", "()I" ) ;
+ if (jintgetFilterIndexID == NULL) {
+-std::cerr << "Could not access to the method " << "getFilterIndex" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getFilterIndex");
+ }
+ 
+                         jint res =  (jint) curEnv->CallIntMethod(cls, jintgetFilterIndexID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return res;
+ 
+ }
+@@ -863,28 +752,22 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID jstringgetMenuCallbackID = curEnv->GetStaticMethodID(cls, "getMenuCallback", "()Ljava/lang/String;" ) ;
+ if (jstringgetMenuCallbackID == NULL) {
+-std::cerr << "Could not access to the method " << "getMenuCallback" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "getMenuCallback");
+ }
+ 
+                         jstring res =  (jstring) curEnv->CallStaticObjectMethod(cls, jstringgetMenuCallbackID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+ 
+-
+ const char *tempString = curEnv->GetStringUTFChars(res, 0);
+ char * myStringBuffer = new char[strlen(tempString) + 1];
+ strcpy(myStringBuffer, tempString);
+ curEnv->ReleaseStringUTFChars(res, tempString);
+ curEnv->DeleteLocalRef(res);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ return myStringBuffer;
+ 
+ }
+@@ -897,17 +780,13 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetdirID = curEnv->GetStaticMethodID(cls, "uigetdir", "()V" ) ;
+ if (voiduigetdirID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetdir" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetdir");
+ }
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiduigetdirID );
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetdir (JavaVM * jvm_, char * initialDirectory){
+@@ -918,19 +797,15 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetdirjstringID = curEnv->GetStaticMethodID(cls, "uigetdir", "(Ljava/lang/String;)V" ) ;
+ if (voiduigetdirjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetdir" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetdir");
+ }
+ 
+ jstring initialDirectory_ = curEnv->NewStringUTF( initialDirectory );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiduigetdirjstringID ,initialDirectory_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ void Juigetfile::uigetdir (JavaVM * jvm_, char * initialDirectory, char * title){
+@@ -941,9 +816,7 @@ jclass cls = curEnv->FindClass( className().c_str() );
+ 
+ jmethodID voiduigetdirjstringjstringID = curEnv->GetStaticMethodID(cls, "uigetdir", "(Ljava/lang/String;Ljava/lang/String;)V" ) ;
+ if (voiduigetdirjstringjstringID == NULL) {
+-std::cerr << "Could not access to the method " << "uigetdir" << std::endl;
+-curEnv->ExceptionDescribe();
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMethodNotFoundException(curEnv, "uigetdir");
+ }
+ 
+ jstring initialDirectory_ = curEnv->NewStringUTF( initialDirectory );
+@@ -951,11 +824,9 @@ jstring initialDirectory_ = curEnv->NewStringUTF( initialDirectory );
+ jstring title_ = curEnv->NewStringUTF( title );
+ 
+                          curEnv->CallStaticVoidMethod(cls, voiduigetdirjstringjstringID ,initialDirectory_, title_);
+-
+ if (curEnv->ExceptionCheck()) {
+-curEnv->ExceptionDescribe() ;
++throw GiwsException::JniCallMethodException(curEnv);
+ }
+-
+ }
+ 
+ }
+diff --git a/scilab/modules/gui/src/jni/Juigetfile.hxx b/scilab/modules/gui/src/jni/Juigetfile.hxx
+index 09e20d4..13e47af 100644
+--- a/scilab/modules/gui/src/jni/Juigetfile.hxx
++++ b/scilab/modules/gui/src/jni/Juigetfile.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -44,6 +44,8 @@ knowledge of the CeCILL-B license and that you accept its terms.
+ #include <stdlib.h>
+ #include <jni.h>
+ 
++#include "GiwsException.hxx"
++
+ namespace org_scilab_modules_gui_filechooser {
+ 
+ class Juigetfile {
+diff --git a/scilab/modules/gui/src/jni/Jxclick.cpp b/scilab/modules/gui/src/jni/Jxclick.cpp
+index a597c00..05a240e 100644
+--- a/scilab/modules/gui/src/jni/Jxclick.cpp
++++ b/scilab/modules/gui/src/jni/Jxclick.cpp
+@@ -1,5 +1,5 @@
+ #include "Jxclick.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -139,22 +139,17 @@ jstringgetMenuCallbackID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void Jxclick::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Jxclick");
+ }
+ }
+ 
+-
+ void Jxclick::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Jxclick");
+ }
+ }
+-
+ // Method(s)
+ 
+ void Jxclick::xclick (JavaVM * jvm_){
+diff --git a/scilab/modules/gui/src/jni/Jxclick.hxx b/scilab/modules/gui/src/jni/Jxclick.hxx
+index bc8aac1..d552d83 100644
+--- a/scilab/modules/gui/src/jni/Jxclick.hxx
++++ b/scilab/modules/gui/src/jni/Jxclick.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/gui/src/jni/Jxgetmouse.cpp b/scilab/modules/gui/src/jni/Jxgetmouse.cpp
+index b9e71d6..b3a73af 100644
+--- a/scilab/modules/gui/src/jni/Jxgetmouse.cpp
++++ b/scilab/modules/gui/src/jni/Jxgetmouse.cpp
+@@ -1,5 +1,5 @@
+ #include "Jxgetmouse.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -139,22 +139,17 @@ jdoublegetYCoordinateID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void Jxgetmouse::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Jxgetmouse");
+ }
+ }
+ 
+-
+ void Jxgetmouse::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "Jxgetmouse");
+ }
+ }
+-
+ // Method(s)
+ 
+ void Jxgetmouse::xgetmouse (JavaVM * jvm_){
+diff --git a/scilab/modules/gui/src/jni/Jxgetmouse.hxx b/scilab/modules/gui/src/jni/Jxgetmouse.hxx
+index 0e2d931..a47958b 100644
+--- a/scilab/modules/gui/src/jni/Jxgetmouse.hxx
++++ b/scilab/modules/gui/src/jni/Jxgetmouse.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/gui/src/jni/LookAndFeelManager.cpp b/scilab/modules/gui/src/jni/LookAndFeelManager.cpp
+index 796657c..e342ec4 100644
+--- a/scilab/modules/gui/src/jni/LookAndFeelManager.cpp
++++ b/scilab/modules/gui/src/jni/LookAndFeelManager.cpp
+@@ -1,5 +1,5 @@
+ #include "LookAndFeelManager.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -139,22 +139,17 @@ jintnumbersOfInstalledLookAndFeelsID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void LookAndFeelManager::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "LookAndFeelManager");
+ }
+ }
+ 
+-
+ void LookAndFeelManager::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "LookAndFeelManager");
+ }
+ }
+-
+ // Method(s)
+ 
+ bool LookAndFeelManager::isSupportedLookAndFeel (char * lookandfeel){
+diff --git a/scilab/modules/gui/src/jni/LookAndFeelManager.hxx b/scilab/modules/gui/src/jni/LookAndFeelManager.hxx
+index 42cc1a4..6733171 100644
+--- a/scilab/modules/gui/src/jni/LookAndFeelManager.hxx
++++ b/scilab/modules/gui/src/jni/LookAndFeelManager.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/gui/src/jni/SwingScilabMenu.cpp b/scilab/modules/gui/src/jni/SwingScilabMenu.cpp
+index 48abb79..b163ef6 100644
+--- a/scilab/modules/gui/src/jni/SwingScilabMenu.cpp
++++ b/scilab/modules/gui/src/jni/SwingScilabMenu.cpp
+@@ -1,5 +1,5 @@
+ #include "SwingScilabMenu.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -139,22 +139,17 @@ voiddestroyID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SwingScilabMenu::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SwingScilabMenu");
+ }
+ }
+ 
+-
+ void SwingScilabMenu::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SwingScilabMenu");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SwingScilabMenu::setText (char * newText){
+diff --git a/scilab/modules/gui/src/jni/SwingScilabMenu.hxx b/scilab/modules/gui/src/jni/SwingScilabMenu.hxx
+index 0069de5..c148b5d 100644
+--- a/scilab/modules/gui/src/jni/SwingScilabMenu.hxx
++++ b/scilab/modules/gui/src/jni/SwingScilabMenu.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/gui/src/jni/UIElementMapper.cpp b/scilab/modules/gui/src/jni/UIElementMapper.cpp
+index cc7bab7..e050539 100644
+--- a/scilab/modules/gui/src/jni/UIElementMapper.cpp
++++ b/scilab/modules/gui/src/jni/UIElementMapper.cpp
+@@ -1,5 +1,5 @@
+ #include "UIElementMapper.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,22 +129,17 @@ throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ 
+ // Generic methods
+ 
+-
+ void UIElementMapper::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "UIElementMapper");
+ }
+ }
+ 
+-
+ void UIElementMapper::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "UIElementMapper");
+ }
+ }
+-
+ // Method(s)
+ 
+ int UIElementMapper::getMaxId (){
+diff --git a/scilab/modules/gui/src/jni/UIElementMapper.hxx b/scilab/modules/gui/src/jni/UIElementMapper.hxx
+index 219c398..07fc6c7 100644
+--- a/scilab/modules/gui/src/jni/UIElementMapper.hxx
++++ b/scilab/modules/gui/src/jni/UIElementMapper.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/helptools/src/jni/BuildDocObject.cpp b/scilab/modules/helptools/src/jni/BuildDocObject.cpp
+index 0b61c8a..98814da 100644
+--- a/scilab/modules/helptools/src/jni/BuildDocObject.cpp
++++ b/scilab/modules/helptools/src/jni/BuildDocObject.cpp
+@@ -1,5 +1,5 @@
+ #include "BuildDocObject.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -135,22 +135,17 @@ jstringprocessjstringjstringID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void BuildDocObject::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "BuildDocObject");
+ }
+ }
+ 
+-
+ void BuildDocObject::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "BuildDocObject");
+ }
+ }
+-
+ // Method(s)
+ 
+ bool BuildDocObject::setOutputDirectory (char * directory){
+diff --git a/scilab/modules/helptools/src/jni/BuildDocObject.hxx b/scilab/modules/helptools/src/jni/BuildDocObject.hxx
+index 3e3afc0..1c55009 100644
+--- a/scilab/modules/helptools/src/jni/BuildDocObject.hxx
++++ b/scilab/modules/helptools/src/jni/BuildDocObject.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/helptools/src/jni/GiwsException.cpp b/scilab/modules/helptools/src/jni/GiwsException.cpp
+index fc4d53c..234e52b 100644
+--- a/scilab/modules/helptools/src/jni/GiwsException.cpp
++++ b/scilab/modules/helptools/src/jni/GiwsException.cpp
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -47,7 +47,7 @@ namespace GiwsException {
+ */
+ JniException::JniException(JNIEnv * curEnv) throw() : exception()
+ {
+-// retrieve informations about the exception
++// retrieve information about the exception
+ javaException = curEnv->ExceptionOccurred();
+ /* Clear the Java Exception to avoid calling it again & again */
+ curEnv->ExceptionClear();
+@@ -122,7 +122,7 @@ std::string JniException::retrieveExceptionMessage(JNIEnv * curEnv)
+ {
+ // return the result of the getLocalizedMessage method
+ 
+-// retrieve informations from the exception.
++// retrieve information from the exception.
+ // get method id
+ jmethodID getLocalizedMessageId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+                                                "getLocalizedMessage",
+@@ -153,7 +153,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+ 
+     // return the result of the getStackTrace method
+ 
+-    // retrieve informations from the exception.
++    // retrieve information from the exception.
+     // get method id
+     // getStackTrace returns an array of StackTraceElement
+     jmethodID getStackTraceId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+@@ -242,9 +242,9 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   }
+ 
+   /**
+-   * To be called when all the informations about the exceptions have been
++   * To be called when all the information about the exceptions have been
+    * retrived.
+-   * Remove the exception from the environement.
++   * Remove the exception from the environment.
+    */
+   void JniException::closeException(JNIEnv * curEnv)
+   {
+@@ -293,7 +293,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   */
+   
+   /**
+-  * @pram curEnv java environment where the exception occured.
++  * @param curEnv java environment where the exception occured.
+   */
+   JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv)
+   {
+@@ -305,7 +305,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   
+   JniCallMethodException::~JniCallMethodException(void) throw() {}
+   /**
+-  * @pram className name of the class which haven't been found
++  * @param className name of the class which haven't been found
+   */
+   JniClassNotFoundException::JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -316,7 +316,7 @@ setErrorMessage(errorMessage);
+   JniClassNotFoundException::~JniClassNotFoundException(void) throw() {}
+ 
+   /**
+-   * @pram className name of the method which haven't been found
++   * @param className name of the method which haven't been found
+    */
+   JniMethodNotFoundException::JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw() : JniException(curEnv)
+   {
+@@ -325,8 +325,9 @@ setErrorMessage(errorMessage);
+   }
+ 
+   JniMethodNotFoundException::~JniMethodNotFoundException(void) throw() {}
++  
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniObjectCreationException::JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -336,6 +337,17 @@ setErrorMessage(errorMessage);
+ 
+   JniObjectCreationException::~JniObjectCreationException(void) throw() {}
+ 
++  /**
++   * @param curEnv java envirnonment where the exception occured.
++   */
++  JniMonitorException::JniMonitorException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
++  {
++std::string errorMessage = "Error in the access (Enter or exit) or a Java env monitor of class " + className + ".";
++setErrorMessage(errorMessage);
++  }
++
++  JniMonitorException::~JniMonitorException(void) throw() {}
++
+ 
+ 
+ }
+diff --git a/scilab/modules/helptools/src/jni/GiwsException.hxx b/scilab/modules/helptools/src/jni/GiwsException.hxx
+index a2be211..73f8175 100644
+--- a/scilab/modules/helptools/src/jni/GiwsException.hxx
++++ b/scilab/modules/helptools/src/jni/GiwsException.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,9 +129,9 @@ std::string retrieveStackTrace(JNIEnv * curEnv);
+ */
+ std::string retrieveExceptionName(JNIEnv * curEnv);
+ /**
+-* To be called when all the informations about the exceptions have been
++* To be called when all the information about the exceptions have been
+ * retrived.
+-* Remove the exception from the environement.
++* Remove the exception from the environment.
+ */
+ void closeException(JNIEnv * curEnv);
+ 
+@@ -164,7 +164,7 @@ class JniCallMethodException : public JniException
+ public:
+ 
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniCallMethodException(JNIEnv * curEnv) throw();
+ 
+@@ -179,7 +179,7 @@ class JniClassNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the class which haven't been found
++* @param className name of the class which haven't been found
+ */
+ JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw();
+ 
+@@ -195,7 +195,7 @@ class JniMethodNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the method which haven't been found
++* @param className name of the method which haven't been found
+ */
+ JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw();
+ virtual ~JniMethodNotFoundException(void) throw();
+@@ -213,7 +213,7 @@ class JniObjectCreationException : public JniException
+ public:
+ 
+ /**
+-* @pram curEnv java envirnonment where the exception occured.
++* @param curEnv java envirnonment where the exception occured.
+ */
+ JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw();
+ virtual ~JniObjectCreationException(void) throw();
+@@ -221,6 +221,23 @@ virtual ~JniObjectCreationException(void) throw();
+ };
+ 
+ 
++/**
++* Exception that should be thrown when a call to the Java monitor
++* failed
++*/
++class JniMonitorException : public JniException
++{
++public:
++
++/**
++* @param curEnv java envirnonment where the exception occured.
++*/
++JniMonitorException(JNIEnv * curEnv, const std::string & className) throw();
++virtual ~JniMonitorException(void) throw();
++
++};
++
++
+ }
+ #endif
+ 
+diff --git a/scilab/modules/renderer/src/jni/ArcFillDrawerGL.cpp b/scilab/modules/renderer/src/jni/ArcFillDrawerGL.cpp
+index fa50823..6368a3b 100644
+--- a/scilab/modules/renderer/src/jni/ArcFillDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/ArcFillDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "ArcFillDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voidsetUseNurbsjbooleanID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void ArcFillDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "ArcFillDrawerGL");
+ }
+ }
+ 
+-
+ void ArcFillDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "ArcFillDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void ArcFillDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/ArcFillDrawerGL.hxx b/scilab/modules/renderer/src/jni/ArcFillDrawerGL.hxx
+index 3452ff7..7c238be 100644
+--- a/scilab/modules/renderer/src/jni/ArcFillDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/ArcFillDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/ArcLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/ArcLineDrawerGL.cpp
+index bdc26b2..ada2f87 100644
+--- a/scilab/modules/renderer/src/jni/ArcLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/ArcLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "ArcLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voidsetUseNurbsjbooleanID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void ArcLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "ArcLineDrawerGL");
+ }
+ }
+ 
+-
+ void ArcLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "ArcLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void ArcLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/ArcLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/ArcLineDrawerGL.hxx
+index b08e89a..229736f 100644
+--- a/scilab/modules/renderer/src/jni/ArcLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/ArcLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.cpp b/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.cpp
+index 603d131..22ba164 100644
+--- a/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "BackTrihedronDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void BackTrihedronDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "BackTrihedronDrawerGL");
+ }
+ }
+ 
+-
+ void BackTrihedronDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "BackTrihedronDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void BackTrihedronDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.hxx b/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.hxx
+index b310231..2c7f591 100644
+--- a/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/BackTrihedronDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.cpp b/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.cpp
+index 11a3a2e..f6ca693 100644
+--- a/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "CenteredTextDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -161,22 +161,17 @@ jdoubleArrayupdateParentFigurejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void CenteredTextDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CenteredTextDrawerGL");
+ }
+ }
+ 
+-
+ void CenteredTextDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "CenteredTextDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void CenteredTextDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.hxx b/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.hxx
+index 2ec7ccd..c886f89 100644
+--- a/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/CenteredTextDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableArcGL.cpp b/scilab/modules/renderer/src/jni/DrawableArcGL.cpp
+index 81394d8..fab5701 100644
+--- a/scilab/modules/renderer/src/jni/DrawableArcGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableArcGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableArcGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableArcGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableArcGL");
+ }
+ }
+ 
+-
+ void DrawableArcGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableArcGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableArcGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableArcGL.hxx b/scilab/modules/renderer/src/jni/DrawableArcGL.hxx
+index 3a19ac8..1246f97 100644
+--- a/scilab/modules/renderer/src/jni/DrawableArcGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableArcGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableAxesGL.cpp b/scilab/modules/renderer/src/jni/DrawableAxesGL.cpp
+index a558d3e..d61b16d 100644
+--- a/scilab/modules/renderer/src/jni/DrawableAxesGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableAxesGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableAxesGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableAxesGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableAxesGL");
+ }
+ }
+ 
+-
+ void DrawableAxesGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableAxesGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableAxesGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableAxesGL.hxx b/scilab/modules/renderer/src/jni/DrawableAxesGL.hxx
+index 30f8093..82237b7 100644
+--- a/scilab/modules/renderer/src/jni/DrawableAxesGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableAxesGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableFecGL.cpp b/scilab/modules/renderer/src/jni/DrawableFecGL.cpp
+index 6e96142..4614ce0 100644
+--- a/scilab/modules/renderer/src/jni/DrawableFecGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableFecGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableFecGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableFecGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableFecGL");
+ }
+ }
+ 
+-
+ void DrawableFecGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableFecGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableFecGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableFecGL.hxx b/scilab/modules/renderer/src/jni/DrawableFecGL.hxx
+index c7b1994..5b55e42 100644
+--- a/scilab/modules/renderer/src/jni/DrawableFecGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableFecGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableFigureGL.cpp b/scilab/modules/renderer/src/jni/DrawableFigureGL.cpp
+index d2eb288..db3f001 100644
+--- a/scilab/modules/renderer/src/jni/DrawableFigureGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableFigureGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableFigureGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -201,22 +201,17 @@ voidsetUseSingleBufferjbooleanID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableFigureGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableFigureGL");
+ }
+ }
+ 
+-
+ void DrawableFigureGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableFigureGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableFigureGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableFigureGL.hxx b/scilab/modules/renderer/src/jni/DrawableFigureGL.hxx
+index 05ef0cf..8703d29 100644
+--- a/scilab/modules/renderer/src/jni/DrawableFigureGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableFigureGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableGrayplotGL.cpp b/scilab/modules/renderer/src/jni/DrawableGrayplotGL.cpp
+index 809e65e..d0dc555 100644
+--- a/scilab/modules/renderer/src/jni/DrawableGrayplotGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableGrayplotGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableGrayplotGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -151,22 +151,17 @@ voiddrawGrayplotjdoubleArrayjdoubleArrayjdoublejintArrayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableGrayplotGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableGrayplotGL");
+ }
+ }
+ 
+-
+ void DrawableGrayplotGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableGrayplotGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableGrayplotGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableGrayplotGL.hxx b/scilab/modules/renderer/src/jni/DrawableGrayplotGL.hxx
+index a5bc85e..ce5c311 100644
+--- a/scilab/modules/renderer/src/jni/DrawableGrayplotGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableGrayplotGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawablePolylineGL.cpp b/scilab/modules/renderer/src/jni/DrawablePolylineGL.cpp
+index fa6c4bd..365cdfb 100644
+--- a/scilab/modules/renderer/src/jni/DrawablePolylineGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawablePolylineGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawablePolylineGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawablePolylineGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawablePolylineGL");
+ }
+ }
+ 
+-
+ void DrawablePolylineGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawablePolylineGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawablePolylineGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawablePolylineGL.hxx b/scilab/modules/renderer/src/jni/DrawablePolylineGL.hxx
+index 44d325a..a845c87 100644
+--- a/scilab/modules/renderer/src/jni/DrawablePolylineGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawablePolylineGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableRectangleGL.cpp b/scilab/modules/renderer/src/jni/DrawableRectangleGL.cpp
+index 90d04f5..07cad7a 100644
+--- a/scilab/modules/renderer/src/jni/DrawableRectangleGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableRectangleGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableRectangleGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableRectangleGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableRectangleGL");
+ }
+ }
+ 
+-
+ void DrawableRectangleGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableRectangleGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableRectangleGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableRectangleGL.hxx b/scilab/modules/renderer/src/jni/DrawableRectangleGL.hxx
+index c21604d..0bd1d32 100644
+--- a/scilab/modules/renderer/src/jni/DrawableRectangleGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableRectangleGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableSegsGL.cpp b/scilab/modules/renderer/src/jni/DrawableSegsGL.cpp
+index 158f603..09598d1 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSegsGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableSegsGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableSegsGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableSegsGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSegsGL");
+ }
+ }
+ 
+-
+ void DrawableSegsGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSegsGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableSegsGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableSegsGL.hxx b/scilab/modules/renderer/src/jni/DrawableSegsGL.hxx
+index 729fbb8..4a89ccd 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSegsGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableSegsGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableSubwinGL.cpp b/scilab/modules/renderer/src/jni/DrawableSubwinGL.cpp
+index 03e0065..efc4016 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSubwinGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableSubwinGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableSubwinGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voidunzoomjlongID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableSubwinGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSubwinGL");
+ }
+ }
+ 
+-
+ void DrawableSubwinGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSubwinGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableSubwinGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableSubwinGL.hxx b/scilab/modules/renderer/src/jni/DrawableSubwinGL.hxx
+index ad924b9..80f0215 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSubwinGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableSubwinGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableSurfaceGL.cpp b/scilab/modules/renderer/src/jni/DrawableSurfaceGL.cpp
+index 1d4eec6..d7c03a8 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSurfaceGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableSurfaceGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableSurfaceGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableSurfaceGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSurfaceGL");
+ }
+ }
+ 
+-
+ void DrawableSurfaceGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableSurfaceGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableSurfaceGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableSurfaceGL.hxx b/scilab/modules/renderer/src/jni/DrawableSurfaceGL.hxx
+index 6335ad3..d19b205 100644
+--- a/scilab/modules/renderer/src/jni/DrawableSurfaceGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableSurfaceGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/DrawableTextGL.cpp b/scilab/modules/renderer/src/jni/DrawableTextGL.cpp
+index 5020967..25a61b5 100644
+--- a/scilab/modules/renderer/src/jni/DrawableTextGL.cpp
++++ b/scilab/modules/renderer/src/jni/DrawableTextGL.cpp
+@@ -1,5 +1,5 @@
+ #include "DrawableTextGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ voidunClipID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void DrawableTextGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableTextGL");
+ }
+ }
+ 
+-
+ void DrawableTextGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "DrawableTextGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void DrawableTextGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/DrawableTextGL.hxx b/scilab/modules/renderer/src/jni/DrawableTextGL.hxx
+index 5b583a8..14a29bb 100644
+--- a/scilab/modules/renderer/src/jni/DrawableTextGL.hxx
++++ b/scilab/modules/renderer/src/jni/DrawableTextGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/FecFacetDrawerGL.cpp b/scilab/modules/renderer/src/jni/FecFacetDrawerGL.cpp
+index 68caec3..b5355f3 100644
+--- a/scilab/modules/renderer/src/jni/FecFacetDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/FecFacetDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "FecFacetDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawFecjdoubleArrayjdoubleArrayjdoubleArrayjintArrayjintArrayjintArrayID=NUL
+ 
+ // Generic methods
+ 
+-
+ void FecFacetDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FecFacetDrawerGL");
+ }
+ }
+ 
+-
+ void FecFacetDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FecFacetDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void FecFacetDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/FecFacetDrawerGL.hxx b/scilab/modules/renderer/src/jni/FecFacetDrawerGL.hxx
+index 957b3b8..7319bb7 100644
+--- a/scilab/modules/renderer/src/jni/FecFacetDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/FecFacetDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/FecLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/FecLineDrawerGL.cpp
+index 2831e6d..979eeae 100644
+--- a/scilab/modules/renderer/src/jni/FecLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/FecLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "FecLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawFecjdoubleArrayjdoubleArrayjdoubleArrayjintArrayjintArrayjintArrayID=NUL
+ 
+ // Generic methods
+ 
+-
+ void FecLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FecLineDrawerGL");
+ }
+ }
+ 
+-
+ void FecLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FecLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void FecLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/FecLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/FecLineDrawerGL.hxx
+index 8b24969..e221b91 100644
+--- a/scilab/modules/renderer/src/jni/FecLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/FecLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/FilledTextDrawerGL.cpp b/scilab/modules/renderer/src/jni/FilledTextDrawerGL.cpp
+index 15fa72e..d420cbf 100644
+--- a/scilab/modules/renderer/src/jni/FilledTextDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/FilledTextDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "FilledTextDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -163,22 +163,17 @@ jdoubleArrayupdateParentFigurejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void FilledTextDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FilledTextDrawerGL");
+ }
+ }
+ 
+-
+ void FilledTextDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FilledTextDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void FilledTextDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/FilledTextDrawerGL.hxx b/scilab/modules/renderer/src/jni/FilledTextDrawerGL.hxx
+index 9129971..dc84934 100644
+--- a/scilab/modules/renderer/src/jni/FilledTextDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/FilledTextDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/FullBoxDrawerGL.cpp b/scilab/modules/renderer/src/jni/FullBoxDrawerGL.cpp
+index 8573e75..3672217 100644
+--- a/scilab/modules/renderer/src/jni/FullBoxDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/FullBoxDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "FullBoxDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void FullBoxDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FullBoxDrawerGL");
+ }
+ }
+ 
+-
+ void FullBoxDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "FullBoxDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void FullBoxDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/FullBoxDrawerGL.hxx b/scilab/modules/renderer/src/jni/FullBoxDrawerGL.hxx
+index d279baa..663a47a 100644
+--- a/scilab/modules/renderer/src/jni/FullBoxDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/FullBoxDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/GiwsException.cpp b/scilab/modules/renderer/src/jni/GiwsException.cpp
+index fc4d53c..234e52b 100644
+--- a/scilab/modules/renderer/src/jni/GiwsException.cpp
++++ b/scilab/modules/renderer/src/jni/GiwsException.cpp
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -47,7 +47,7 @@ namespace GiwsException {
+ */
+ JniException::JniException(JNIEnv * curEnv) throw() : exception()
+ {
+-// retrieve informations about the exception
++// retrieve information about the exception
+ javaException = curEnv->ExceptionOccurred();
+ /* Clear the Java Exception to avoid calling it again & again */
+ curEnv->ExceptionClear();
+@@ -122,7 +122,7 @@ std::string JniException::retrieveExceptionMessage(JNIEnv * curEnv)
+ {
+ // return the result of the getLocalizedMessage method
+ 
+-// retrieve informations from the exception.
++// retrieve information from the exception.
+ // get method id
+ jmethodID getLocalizedMessageId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+                                                "getLocalizedMessage",
+@@ -153,7 +153,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+ 
+     // return the result of the getStackTrace method
+ 
+-    // retrieve informations from the exception.
++    // retrieve information from the exception.
+     // get method id
+     // getStackTrace returns an array of StackTraceElement
+     jmethodID getStackTraceId = curEnv->GetMethodID(curEnv->GetObjectClass(javaException),
+@@ -242,9 +242,9 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   }
+ 
+   /**
+-   * To be called when all the informations about the exceptions have been
++   * To be called when all the information about the exceptions have been
+    * retrived.
+-   * Remove the exception from the environement.
++   * Remove the exception from the environment.
+    */
+   void JniException::closeException(JNIEnv * curEnv)
+   {
+@@ -293,7 +293,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   */
+   
+   /**
+-  * @pram curEnv java environment where the exception occured.
++  * @param curEnv java environment where the exception occured.
+   */
+   JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv)
+   {
+@@ -305,7 +305,7 @@ jstring description = (jstring) curEnv->CallObjectMethod(javaException, getLocal
+   
+   JniCallMethodException::~JniCallMethodException(void) throw() {}
+   /**
+-  * @pram className name of the class which haven't been found
++  * @param className name of the class which haven't been found
+   */
+   JniClassNotFoundException::JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -316,7 +316,7 @@ setErrorMessage(errorMessage);
+   JniClassNotFoundException::~JniClassNotFoundException(void) throw() {}
+ 
+   /**
+-   * @pram className name of the method which haven't been found
++   * @param className name of the method which haven't been found
+    */
+   JniMethodNotFoundException::JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw() : JniException(curEnv)
+   {
+@@ -325,8 +325,9 @@ setErrorMessage(errorMessage);
+   }
+ 
+   JniMethodNotFoundException::~JniMethodNotFoundException(void) throw() {}
++  
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniObjectCreationException::JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
+   {
+@@ -336,6 +337,17 @@ setErrorMessage(errorMessage);
+ 
+   JniObjectCreationException::~JniObjectCreationException(void) throw() {}
+ 
++  /**
++   * @param curEnv java envirnonment where the exception occured.
++   */
++  JniMonitorException::JniMonitorException(JNIEnv * curEnv, const std::string & className) throw() : JniException(curEnv)
++  {
++std::string errorMessage = "Error in the access (Enter or exit) or a Java env monitor of class " + className + ".";
++setErrorMessage(errorMessage);
++  }
++
++  JniMonitorException::~JniMonitorException(void) throw() {}
++
+ 
+ 
+ }
+diff --git a/scilab/modules/renderer/src/jni/GiwsException.hxx b/scilab/modules/renderer/src/jni/GiwsException.hxx
+index a2be211..73f8175 100644
+--- a/scilab/modules/renderer/src/jni/GiwsException.hxx
++++ b/scilab/modules/renderer/src/jni/GiwsException.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,9 +129,9 @@ std::string retrieveStackTrace(JNIEnv * curEnv);
+ */
+ std::string retrieveExceptionName(JNIEnv * curEnv);
+ /**
+-* To be called when all the informations about the exceptions have been
++* To be called when all the information about the exceptions have been
+ * retrived.
+-* Remove the exception from the environement.
++* Remove the exception from the environment.
+ */
+ void closeException(JNIEnv * curEnv);
+ 
+@@ -164,7 +164,7 @@ class JniCallMethodException : public JniException
+ public:
+ 
+   /**
+-   * @pram curEnv java envirnonment where the exception occured.
++   * @param curEnv java envirnonment where the exception occured.
+    */
+   JniCallMethodException(JNIEnv * curEnv) throw();
+ 
+@@ -179,7 +179,7 @@ class JniClassNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the class which haven't been found
++* @param className name of the class which haven't been found
+ */
+ JniClassNotFoundException(JNIEnv * curEnv, const std::string & className) throw();
+ 
+@@ -195,7 +195,7 @@ class JniMethodNotFoundException : public JniException
+ public:
+ 
+ /**
+-* @pram className name of the method which haven't been found
++* @param className name of the method which haven't been found
+ */
+ JniMethodNotFoundException(JNIEnv * curEnv, const std::string & methodName) throw();
+ virtual ~JniMethodNotFoundException(void) throw();
+@@ -213,7 +213,7 @@ class JniObjectCreationException : public JniException
+ public:
+ 
+ /**
+-* @pram curEnv java envirnonment where the exception occured.
++* @param curEnv java envirnonment where the exception occured.
+ */
+ JniObjectCreationException(JNIEnv * curEnv, const std::string & className) throw();
+ virtual ~JniObjectCreationException(void) throw();
+@@ -221,6 +221,23 @@ virtual ~JniObjectCreationException(void) throw();
+ };
+ 
+ 
++/**
++* Exception that should be thrown when a call to the Java monitor
++* failed
++*/
++class JniMonitorException : public JniException
++{
++public:
++
++/**
++* @param curEnv java envirnonment where the exception occured.
++*/
++JniMonitorException(JNIEnv * curEnv, const std::string & className) throw();
++virtual ~JniMonitorException(void) throw();
++
++};
++
++
+ }
+ #endif
+ 
+diff --git a/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.cpp b/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.cpp
+index b68ff28..ce6b188 100644
+--- a/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.cpp
++++ b/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.cpp
+@@ -1,5 +1,5 @@
+ #include "GraphicSynchronizerJava.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -135,22 +135,17 @@ jintgetCurrentThreadIdID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void GraphicSynchronizerJava::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GraphicSynchronizerJava");
+ }
+ }
+ 
+-
+ void GraphicSynchronizerJava::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GraphicSynchronizerJava");
+ }
+ }
+-
+ // Method(s)
+ 
+ void GraphicSynchronizerJava::wait (){
+diff --git a/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.hxx b/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.hxx
+index 5a69fc9..cfa8cd0 100644
+--- a/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.hxx
++++ b/scilab/modules/renderer/src/jni/GraphicSynchronizerJava.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/GridDrawerGL.cpp b/scilab/modules/renderer/src/jni/GridDrawerGL.cpp
+index 897919b..63c9dec 100644
+--- a/scilab/modules/renderer/src/jni/GridDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/GridDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "GridDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -143,22 +143,17 @@ voidshowGridID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void GridDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GridDrawerGL");
+ }
+ }
+ 
+-
+ void GridDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "GridDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void GridDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/GridDrawerGL.hxx b/scilab/modules/renderer/src/jni/GridDrawerGL.hxx
+index a332497..0df5073 100644
+--- a/scilab/modules/renderer/src/jni/GridDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/GridDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.cpp b/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.cpp
+index 1f534b3..04502f8 100644
+--- a/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "HalfBoxDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void HalfBoxDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "HalfBoxDrawerGL");
+ }
+ }
+ 
+-
+ void HalfBoxDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "HalfBoxDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void HalfBoxDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.hxx b/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.hxx
+index 3abb245..591e3a1 100644
+--- a/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/HalfBoxDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/IsoViewCameraGL.cpp b/scilab/modules/renderer/src/jni/IsoViewCameraGL.cpp
+index 33f1901..3744bc1 100644
+--- a/scilab/modules/renderer/src/jni/IsoViewCameraGL.cpp
++++ b/scilab/modules/renderer/src/jni/IsoViewCameraGL.cpp
+@@ -1,5 +1,5 @@
+ #include "IsoViewCameraGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -169,22 +169,17 @@ voidsetAxesBoundsjdoublejdoublejdoublejdoublejdoublejdoubleID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void IsoViewCameraGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "IsoViewCameraGL");
+ }
+ }
+ 
+-
+ void IsoViewCameraGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "IsoViewCameraGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void IsoViewCameraGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/IsoViewCameraGL.hxx b/scilab/modules/renderer/src/jni/IsoViewCameraGL.hxx
+index 5549a06..5937df2 100644
+--- a/scilab/modules/renderer/src/jni/IsoViewCameraGL.hxx
++++ b/scilab/modules/renderer/src/jni/IsoViewCameraGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/IsometricCameraGL.cpp b/scilab/modules/renderer/src/jni/IsometricCameraGL.cpp
+index 54f7229..3aee67c 100644
+--- a/scilab/modules/renderer/src/jni/IsometricCameraGL.cpp
++++ b/scilab/modules/renderer/src/jni/IsometricCameraGL.cpp
+@@ -1,5 +1,5 @@
+ #include "IsometricCameraGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -169,22 +169,17 @@ voidsetAxesBoundsjdoublejdoublejdoublejdoublejdoublejdoubleID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void IsometricCameraGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "IsometricCameraGL");
+ }
+ }
+ 
+-
+ void IsometricCameraGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "IsometricCameraGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void IsometricCameraGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/IsometricCameraGL.hxx b/scilab/modules/renderer/src/jni/IsometricCameraGL.hxx
+index 4285e90..233481c 100644
+--- a/scilab/modules/renderer/src/jni/IsometricCameraGL.hxx
++++ b/scilab/modules/renderer/src/jni/IsometricCameraGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.cpp
+index e0a0f2f..063ec60 100644
+--- a/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineArrowDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voiddrawPolylineID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void PolylineArrowDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineArrowDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineArrowDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineArrowDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineArrowDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.hxx
+index 9e50db0..3dce55e 100644
+--- a/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineArrowDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.cpp
+index 077c00c..a04e53a 100644
+--- a/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineBarDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawPolylinejdoubleArrayjdoubleArrayjdoubleArrayjdoubleArrayjdoubleArrayID=N
+ 
+ // Generic methods
+ 
+-
+ void PolylineBarDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineBarDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineBarDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineBarDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineBarDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.hxx
+index ca02143..6a07000 100644
+--- a/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineBarDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.cpp
+index 1965c08..e433ce5 100644
+--- a/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineFillDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawPolylinejdoubleArrayjdoubleArrayjdoubleArrayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void PolylineFillDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineFillDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineFillDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineFillDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineFillDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.hxx
+index 57b6e9a..87f96b9 100644
+--- a/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineFillDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.cpp
+index efc3311..145bec0 100644
+--- a/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineInterpColorDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -139,22 +139,17 @@ voiddrawPolylinejdoubleArrayjdoubleArrayjdoubleArrayjintArrayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void PolylineInterpColorDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineInterpColorDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineInterpColorDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineInterpColorDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineInterpColorDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.hxx
+index 4c9dca6..bc2c348 100644
+--- a/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineInterpColorDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.cpp
+index d412a2c..d03f06d 100644
+--- a/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawPolylinejdoubleArrayjdoubleArrayjdoubleArrayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void PolylineLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineLineDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.hxx
+index 2f9d2a7..e0bc987 100644
+--- a/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.cpp b/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.cpp
+index 5d350f8..38e2134 100644
+--- a/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "PolylineMarkDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -143,22 +143,17 @@ voiddrawPolylineID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void PolylineMarkDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineMarkDrawerGL");
+ }
+ }
+ 
+-
+ void PolylineMarkDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "PolylineMarkDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void PolylineMarkDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.hxx b/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.hxx
+index e02f312..57dbe56 100644
+--- a/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/PolylineMarkDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.cpp b/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.cpp
+index 72d1f9d..d8daa5a 100644
+--- a/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "RectangleFillDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawRectanglejdoublejdoublejdoublejdoublejdoublejdoublejdoublejdoublejdouble
+ 
+ // Generic methods
+ 
+-
+ void RectangleFillDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleFillDrawerGL");
+ }
+ }
+ 
+-
+ void RectangleFillDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleFillDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void RectangleFillDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.hxx b/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.hxx
+index e67ec96..657b71d 100644
+--- a/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/RectangleFillDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.cpp
+index df872d7..9c3c47b 100644
+--- a/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "RectangleLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawRectanglejdoublejdoublejdoublejdoublejdoublejdoublejdoublejdoublejdouble
+ 
+ // Generic methods
+ 
+-
+ void RectangleLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleLineDrawerGL");
+ }
+ }
+ 
+-
+ void RectangleLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void RectangleLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.hxx
+index 76075d7..189caeb 100644
+--- a/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/RectangleLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.cpp b/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.cpp
+index 7d25c54..1d50848 100644
+--- a/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "RectangleMarkDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -143,22 +143,17 @@ voiddrawRectangleID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void RectangleMarkDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleMarkDrawerGL");
+ }
+ }
+ 
+-
+ void RectangleMarkDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RectangleMarkDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void RectangleMarkDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.hxx b/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.hxx
+index fb3b8c1..4b87f39 100644
+--- a/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/RectangleMarkDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/RenderingChecker.cpp b/scilab/modules/renderer/src/jni/RenderingChecker.cpp
+index 0ef881c..96c3b7f 100644
+--- a/scilab/modules/renderer/src/jni/RenderingChecker.cpp
++++ b/scilab/modules/renderer/src/jni/RenderingChecker.cpp
+@@ -1,5 +1,5 @@
+ #include "RenderingChecker.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -129,22 +129,17 @@ throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ 
+ // Generic methods
+ 
+-
+ void RenderingChecker::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RenderingChecker");
+ }
+ }
+ 
+-
+ void RenderingChecker::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "RenderingChecker");
+ }
+ }
+-
+ // Method(s)
+ 
+ bool RenderingChecker::isAbleToCreateWindow (JavaVM * jvm_){
+diff --git a/scilab/modules/renderer/src/jni/RenderingChecker.hxx b/scilab/modules/renderer/src/jni/RenderingChecker.hxx
+index 2142fe6..724e553 100644
+--- a/scilab/modules/renderer/src/jni/RenderingChecker.hxx
++++ b/scilab/modules/renderer/src/jni/RenderingChecker.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.cpp b/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.cpp
+index 5116daa..cb1b093 100644
+--- a/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SegsArrowDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -147,22 +147,17 @@ voiddrawSegsID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SegsArrowDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsArrowDrawerGL");
+ }
+ }
+ 
+-
+ void SegsArrowDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsArrowDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SegsArrowDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.hxx b/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.hxx
+index d386a5b..f296eba 100644
+--- a/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SegsArrowDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SegsLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/SegsLineDrawerGL.cpp
+index 04668ba..0d25c90 100644
+--- a/scilab/modules/renderer/src/jni/SegsLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SegsLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SegsLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawSegsjdoubleArrayjdoubleArrayjdoubleArrayjdoubleArrayjdoubleArrayjdoubleA
+ 
+ // Generic methods
+ 
+-
+ void SegsLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsLineDrawerGL");
+ }
+ }
+ 
+-
+ void SegsLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SegsLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SegsLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/SegsLineDrawerGL.hxx
+index 47b1dcf..baba07f 100644
+--- a/scilab/modules/renderer/src/jni/SegsLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SegsLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.cpp b/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.cpp
+index 7c75fd3..44c99cf 100644
+--- a/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SegsMarkDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -143,22 +143,17 @@ voiddrawSegsID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SegsMarkDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsMarkDrawerGL");
+ }
+ }
+ 
+-
+ void SegsMarkDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SegsMarkDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SegsMarkDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.hxx b/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.hxx
+index f82060e..c4fd957 100644
+--- a/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SegsMarkDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/StandardTextDrawerGL.cpp b/scilab/modules/renderer/src/jni/StandardTextDrawerGL.cpp
+index 2316d7f..6ee4c79 100644
+--- a/scilab/modules/renderer/src/jni/StandardTextDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/StandardTextDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "StandardTextDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -159,22 +159,17 @@ jdoubleArrayupdateParentFigurejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void StandardTextDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "StandardTextDrawerGL");
+ }
+ }
+ 
+-
+ void StandardTextDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "StandardTextDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void StandardTextDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/StandardTextDrawerGL.hxx b/scilab/modules/renderer/src/jni/StandardTextDrawerGL.hxx
+index 3982620..d012cfb 100644
+--- a/scilab/modules/renderer/src/jni/StandardTextDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/StandardTextDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.cpp b/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.cpp
+index 1a973a5..387d264 100644
+--- a/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SubwinBackgroundDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -141,22 +141,17 @@ voiddrawBoxjdoublejdoublejdoublejdoublejdoublejdoublejintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SubwinBackgroundDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SubwinBackgroundDrawerGL");
+ }
+ }
+ 
+-
+ void SubwinBackgroundDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SubwinBackgroundDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SubwinBackgroundDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.hxx b/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.hxx
+index 565bcd8..bab99a7 100644
+--- a/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SubwinBackgroundDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.cpp b/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.cpp
+index 03e5002..7e25e4d 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SurfaceFacetDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voidsetFacetsColorsjdoubleArrayID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SurfaceFacetDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceFacetDrawerGL");
+ }
+ }
+ 
+-
+ void SurfaceFacetDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceFacetDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SurfaceFacetDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.hxx b/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.hxx
+index 1289113..8da4b9c 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SurfaceFacetDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.cpp b/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.cpp
+index 0cee266..8238c3d 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SurfaceLineDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -143,22 +143,17 @@ voiddrawSurfacejdoubleArrayjdoubleArrayjdoubleArrayjintID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SurfaceLineDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceLineDrawerGL");
+ }
+ }
+ 
+-
+ void SurfaceLineDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceLineDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SurfaceLineDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.hxx b/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.hxx
+index 607b608..4b8c0b9 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SurfaceLineDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.cpp b/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.cpp
+index bba341d..b6dcac9 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "SurfaceMarkDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -145,22 +145,17 @@ voiddrawSurfaceID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void SurfaceMarkDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceMarkDrawerGL");
+ }
+ }
+ 
+-
+ void SurfaceMarkDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "SurfaceMarkDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void SurfaceMarkDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.hxx b/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.hxx
+index 096d648..1b18b12 100644
+--- a/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/SurfaceMarkDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/TicksDrawerGL.cpp b/scilab/modules/renderer/src/jni/TicksDrawerGL.cpp
+index 2643155..b8d702a 100644
+--- a/scilab/modules/renderer/src/jni/TicksDrawerGL.cpp
++++ b/scilab/modules/renderer/src/jni/TicksDrawerGL.cpp
+@@ -1,5 +1,5 @@
+ #include "TicksDrawerGL.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -159,22 +159,17 @@ voidsetNeedTicksDecimationjbooleanID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void TicksDrawerGL::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "TicksDrawerGL");
+ }
+ }
+ 
+-
+ void TicksDrawerGL::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "TicksDrawerGL");
+ }
+ }
+-
+ // Method(s)
+ 
+ void TicksDrawerGL::display (){
+diff --git a/scilab/modules/renderer/src/jni/TicksDrawerGL.hxx b/scilab/modules/renderer/src/jni/TicksDrawerGL.hxx
+index d1b2a89..27c3d14 100644
+--- a/scilab/modules/renderer/src/jni/TicksDrawerGL.hxx
++++ b/scilab/modules/renderer/src/jni/TicksDrawerGL.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+diff --git a/scilab/modules/renderer/src/jni/XlFontManager.cpp b/scilab/modules/renderer/src/jni/XlFontManager.cpp
+index 63dd852..566d790 100644
+--- a/scilab/modules/renderer/src/jni/XlFontManager.cpp
++++ b/scilab/modules/renderer/src/jni/XlFontManager.cpp
+@@ -1,5 +1,5 @@
+ #include "XlFontManager.hxx"
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA
+@@ -149,22 +149,17 @@ jintchangeFontFromFilenamejintjstringID=NULL;
+ 
+ // Generic methods
+ 
+-
+ void XlFontManager::synchronize() {
+ if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+-std::cerr << "Fail to enter monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "XlFontManager");
+ }
+ }
+ 
+-
+ void XlFontManager::endSynchronize() {
+ if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+-std::cerr << "Fail to exit monitor." << std::endl;
+-exit(EXIT_FAILURE);
++throw GiwsException::JniMonitorException(getCurrentEnv(), "XlFontManager");
+ }
+ }
+-
+ // Method(s)
+ 
+ char ** XlFontManager::getInstalledFontsName (){
+diff --git a/scilab/modules/renderer/src/jni/XlFontManager.hxx b/scilab/modules/renderer/src/jni/XlFontManager.hxx
+index c50394c..8ae1150 100644
+--- a/scilab/modules/renderer/src/jni/XlFontManager.hxx
++++ b/scilab/modules/renderer/src/jni/XlFontManager.hxx
+@@ -1,4 +1,4 @@
+-/* Generated by GIWS (version 1.0.1) */
++/* Generated by GIWS (version 1.0.2) */
+ /*
+ 
+ Copyright 2007-2008 INRIA

Added: packages/scilab/trunk/debian/patches/missingaddchapter.diff
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/patches/missingaddchapter.diff?rev=35696&op=file
==============================================================================
--- packages/scilab/trunk/debian/patches/missingaddchapter.diff (added)
+++ packages/scilab/trunk/debian/patches/missingaddchapter.diff Tue Apr 28 08:46:50 2009
@@ -1,0 +1,25 @@
+commit aad7b644ccc97638598c2831d550edb51bdb13f1
+Author: Sylvestre Ledru <sylvestre.ledru at scilab.org>
+Date:   Mon Apr 27 15:16:20 2009 +0200
+
+    Missing addchapter.sce
+
+diff --git a/scilab/modules/call_scilab/help/en_US/addchapter.sce b/scilab/modules/call_scilab/help/en_US/addchapter.sce
+new file mode 100644
+index 0000000..29d4a54
+--- /dev/null
++++ b/scilab/modules/call_scilab/help/en_US/addchapter.sce
+@@ -0,0 +1,13 @@
++// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
++// Copyright (C) 2007-2008 - INRIA - Allan CORNET
++// Copyright (C) 2009 - DIGITEO
++// 
++// This file must be used under the terms of the CeCILL.
++// This source file is licensed as described in the file COPYING, which
++// you should have received as part of this distribution.  The terms
++// are also available at    
++// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
++
++path = SCI+"/modules/call_scilab/help/en_US";
++add_help_chapter("call_scilab API",path,%T);
++clear path add_help_chapter;

Added: packages/scilab/trunk/debian/patches/typo.diff
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/patches/typo.diff?rev=35696&op=file
==============================================================================
--- packages/scilab/trunk/debian/patches/typo.diff (added)
+++ packages/scilab/trunk/debian/patches/typo.diff Tue Apr 28 08:46:50 2009
@@ -1,0 +1,129 @@
+commit 2d2fcbc288fbfc160c3610c9a462b130e7952940
+Author: Sylvestre Ledru <sylvestre.ledru at scilab.org>
+Date:   Mon Apr 27 14:46:52 2009 +0200
+
+    Typo succesfully => successfully
+
+diff --git a/scilab/modules/scicos/src/c/scicos.c b/scilab/modules/scicos/src/c/scicos.c
+index 6929a1d..facc31d 100644
+--- a/scilab/modules/scicos/src/c/scicos.c
++++ b/scilab/modules/scicos/src/c/scicos.c
+@@ -2218,7 +2218,7 @@ void cossimdaskr(told)
+ 	    if ((C2F(cosdebug).cosd >= 1) && (C2F(cosdebug).cosd != 3))
+             {
+ 	      if (flagr>=0) {
+-		sciprint("**** SUNDIALS.IDA succesfully initialized *****/r/n" );
++		sciprint("**** SUNDIALS.IDA succesffully initialized *****/r/n" );
+ 	      }
+ 	      else{
+ 		sciprint("**** SUNDIALS.IDA failed to initialize ->try again *****/r/n" );
+commit 2fb37dc8ded26c2d68eba7f6f86b3b99130b8e10
+Author: Sylvestre Ledru <sylvestre.ledru at scilab.org>
+Date:   Mon Apr 27 14:30:54 2009 +0200
+
+    Typo: functionnality=>functionality
+
+diff --git a/scilab/modules/graphics/locales/ca_ES/graphics.po b/scilab/modules/graphics/locales/ca_ES/graphics.po
+index 64df9f5..d1c3ecc 100644
+--- a/scilab/modules/graphics/locales/ca_ES/graphics.po
++++ b/scilab/modules/graphics/locales/ca_ES/graphics.po
+@@ -606,7 +606,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ "%s: Ja no es pot utilitzar el xgetmouse amb una parca per evitar que es "
+ "netegi l'encuament.\n"
+diff --git a/scilab/modules/graphics/locales/de_DE/graphics.po b/scilab/modules/graphics/locales/de_DE/graphics.po
+index cb6ef83..efcac39 100644
+--- a/scilab/modules/graphics/locales/de_DE/graphics.po
++++ b/scilab/modules/graphics/locales/de_DE/graphics.po
+@@ -577,7 +577,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ "%s: verwende xgetmouse mit einem Kennzeichen, um zu vermeiden, daß die "
+ "Ereignisschlange, dessen Inhalt gelöscht werden soll, überflüssig ist. Diese "
+diff --git a/scilab/modules/graphics/locales/en_US/graphics.pot b/scilab/modules/graphics/locales/en_US/graphics.pot
+index 99a795e..dc48456 100644
+--- a/scilab/modules/graphics/locales/en_US/graphics.pot
++++ b/scilab/modules/graphics/locales/en_US/graphics.pot
+@@ -796,7 +796,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ #
+ # File: sci_gateway/c/sci_xlfont.c, line: 124
+diff --git a/scilab/modules/graphics/locales/es_ES/graphics.po b/scilab/modules/graphics/locales/es_ES/graphics.po
+index e970b2c..342e112 100644
+--- a/scilab/modules/graphics/locales/es_ES/graphics.po
++++ b/scilab/modules/graphics/locales/es_ES/graphics.po
+@@ -598,7 +598,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ "%s: Usando xgetmouse con una bandera para evitar que la cola de eventos sea "
+ "limpiada es obsoleto.\n"
+diff --git a/scilab/modules/graphics/locales/fr_FR/graphics.po b/scilab/modules/graphics/locales/fr_FR/graphics.po
+index 8539775..b71a27b 100644
+--- a/scilab/modules/graphics/locales/fr_FR/graphics.po
++++ b/scilab/modules/graphics/locales/fr_FR/graphics.po
+@@ -593,7 +593,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ "%s : L'utilisation de xgetmouse avec un paramètre permettant d'éviter que la "
+ "queue d'évènements soit effacée, est obsolète.\n"
+diff --git a/scilab/modules/graphics/locales/ru_RU/graphics.po b/scilab/modules/graphics/locales/ru_RU/graphics.po
+index d990c11..d04b110 100644
+--- a/scilab/modules/graphics/locales/ru_RU/graphics.po
++++ b/scilab/modules/graphics/locales/ru_RU/graphics.po
+@@ -572,7 +572,7 @@ msgstr ""
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ "%s: Использование xgetmouse с флагом для того, чтобы избежать очистку "
+ "очереди событий, устарело.\n"
+diff --git a/scilab/modules/graphics/locales/zh_CN/graphics.po b/scilab/modules/graphics/locales/zh_CN/graphics.po
+index 4b7cb37..b496d07 100644
+--- a/scilab/modules/graphics/locales/zh_CN/graphics.po
++++ b/scilab/modules/graphics/locales/zh_CN/graphics.po
+@@ -500,7 +500,7 @@ msgstr "%s:输å
¥å‚æ•°#%d的类型错误:应该为布尔向量。\n"
+ msgid ""
+ "%s: Using xgetmouse with a flag to avoid the event queue to be cleared is "
+ "obsolete.\n"
+-"This functionnality will be permanently removed in Scilab 5.1.\n"
++"This functionality will be permanently removed in Scilab 5.1.\n"
+ msgstr ""
+ 
+ #, c-format
+diff --git a/scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c b/scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c
+index 1804abc..9d55cfe 100644
+--- a/scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c
++++ b/scilab/modules/graphics/sci_gateway/c/sci_xgetmouse.c
+@@ -99,7 +99,7 @@ int sci_xgetmouse( char *fname,unsigned long fname_len )
+   // Display a warning if a flag has been given (obsolete use)
+   if (displayWarning)
+     {
+-      sciprint(_("%s: Using xgetmouse with a flag to avoid the event queue to be cleared is obsolete.\nThis functionnality will be permanently removed in Scilab 5.1.\n"),fname);
++      sciprint(_("%s: Using xgetmouse with a flag to avoid the event queue to be cleared is obsolete.\nThis functionality will be permanently removed in Scilab 5.1.\n"),fname);
+     }
+ 
+   // Call Java to get mouse information

Modified: packages/scilab/trunk/debian/rules
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/rules?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/rules (original)
+++ packages/scilab/trunk/debian/rules Tue Apr 28 08:46:50 2009
@@ -91,6 +91,7 @@
 # Move the javasci lib
 	mkdir -p $(CURDIR)/debian/libscilab-java/usr/share/java/
 	mv debian/tmp/usr/share/scilab/modules/javasci/jar/javasci.jar $(CURDIR)/debian/libscilab-java/usr/share/java/
+	rmdir debian/tmp/usr/share/scilab/modules/javasci/jar/
 
 # Move icons
 	mkdir -p $(CURDIR)/debian/scilab/usr/share/scilab/

Modified: packages/scilab/trunk/debian/scilab.1
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/scilab.1?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/scilab.1 (original)
+++ packages/scilab/trunk/debian/scilab.1 Tue Apr 28 08:46:50 2009
@@ -18,13 +18,13 @@
 Execute the scilab script given in
 .B file
 argument.
-Not that -e and -f options are mutually exclusive.
+Not that \-e and \-f options are mutually exclusive.
 .TP
 .B \-e instruction
 Execute the scilab instruction given in
 .B instruction
 argument.
-Not that -e and -f options are mutually exclusive.
+Not that \-e and \-f options are mutually exclusive.
 .TP
 .B \-nw
 Start Scilab without specialized Scilab Window.

Modified: packages/scilab/trunk/debian/scilab.desktop
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/scilab.desktop?rev=35696&op=diff
==============================================================================
--- packages/scilab/trunk/debian/scilab.desktop (original)
+++ packages/scilab/trunk/debian/scilab.desktop Tue Apr 28 08:46:50 2009
@@ -2,7 +2,6 @@
 Comment=Scientific software package for numerical computations
 Comment[fr]=Logiciel scientifique de calcul numérique
 Comment[de]=eine Wissenschaftssoftware für numerische Berechnungen
-Encoding=UTF-8
 Exec=scilab
 GenericName=Scientific Software Package
 GenericName[fr]=Logiciel de calcul numérique




More information about the debian-science-commits mailing list