Unknown error reported in the JNI "JNI_CreateJavaVM"

Sylvestre Ledru sylvestre.ledru at scilab.org
Thu Sep 23 02:25:19 PDT 2010

Hello David,

Le mercredi 15 septembre 2010 à 17:43 +1000, David Holmes a écrit :
> Sylvestre Ledru said the following on 09/15/10 17:17:
> > As suggested in the bug report:
> > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=553
> > I am contacting you about an small issue.
> > 
> > Starting the JVM a few times with "JNI_CreateJavaVM" may lead to an
> > error JNI_ERR ("unknown error").
> > However, it could return JNI_EEXIST ("VM already created") which will be
> > more interesting to manage the error and debugging. This error code is
> > already defined in jni.h.
> This is a curious part of the JNI spec as it doesn't actually define a 
> set of error codes, even though jni.h does contain a few, including 
> JNI_EEXIST. But at least we aren't constrained by the spec as 
> CreateJavaVM is allowed to return a "a suitable JNI error code (a 
> negative number) on failure".
> The question is, is it too late to change this? Any code that checks for 
> JNI_ERR will now be broken, but code that checks for !JNI_OK will be fine.
I can't answer to this question but having this patch applied would save
some time and simplify the debugging.
JNI_ERR is too generic and doesn't provide enough information when this
error occurs... 

Thanks for your quick reply,

More information about the hotspot-dev mailing list