I have a JNI class whose import statement is
import com.mycomp.mysubset.enterprise.zclass;
I have a C program compiled in EBCDIC that created a JVM and is now attempting
to do the FindClass.
My class is stored in
/u/vendor/jig/DOMYAPI3/com/mycomp/mysetset/enterprise/zclass.class
My _CEE_ENVFILE has a
CLASSPATH=/u/vendor/jig/DOMYAPI3:/u/vendor/jig/DOMYAPI3/com/mycomp/mysetset/enterprise:/u/Java6_31/J6.0/bin/j9vm
Since I have to pass in UTF-8 strings I have tried __etoa() and iconv() on my
native EBCDIC C strings before passing them into FindClass.
FindClass is returning a Null.
char myclass[]="zclass";
__etoa(myclass)
zclass_class = (*env)->FindClass(env,
myclass);
if (zclass_class == NULL)
{
(*env)->ExceptionDescribe(env);
printf("findClass returned NULL\n");
rc = ERR_NO_CLASS;
}
I have also tried
__etoa("/com/mycomp/mysetset/enterprise/zclass");
and FindClass gets a null.
I have also tried
cd = iconv_open("UTF-8", "IBM-1047");
if (cd == (iconv_t)-1)
{
printf("iconv_open failed %d,%s\n", errno,strerror(errno));
return ERR_BAD_ICONV;
}
inleft = 0;
outleft = sizeof(myclass);
numBytes = iconv(cd,
(char **)&myclass,
&inleft,
(char **)&myUTFclass,
&outleft);
if (numBytes == -1)
{
printf("iconv on myclass failed %d-%s\n",
errno, strerror(errno));
return ERR_BAD_ICONV;
}
and passed the result into FindClass which still gets a NULL.
Is this a CLASSPATH issue?
Is this a character encoding issue?
Also I expected to get back the java stack with this code
(*env)->ExceptionDescribe(env);
But SYSOUT only contains "Exception in thread "main". Should I expect more
error stack data?
Janet
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN