Problem while using shl_load to load libjvm.so

Hi,

I'm trying to load libjvm.so in Hp-ux IPF using shl_load. But always the function fails saying invalid argument.
Please let me know if anything else has to be done.

Here is a sample that i've used.

#include <stdio.h>
 #include <dlfcn.h>
#include <stdlib.h>
#include <dl.h>
#include <errno.h>
static const char *szPath = "/opt/java1.5/jre/lib/IA64W/server/libjvm.so";
main()
{
void *g_handle_open = NULL;
char p[] = "libjvm.so";
g_handle_open = shl_load(szPath,BIND_DEFERRED,0);
perror("");
printf("errno is %i\n", errno);
printf("%d",g_handle_open);
}

This works on hpux 11.23:

#include <stdio.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <dl.h>
#include <errno.h>
const char *szPath = "/lib/libwrap.sl";
int main(void)
{
	shl_t g_handle_open;
	g_handle_open = shl_load(szPath, BIND_DEFERRED, 0L);
	if (g_handle_open==NULL)
	{
                 printf("errno is %i\n", errno);
	    perror("");
	    exit(1);
	}
	return 0;
}

check that the library exists exactly as you spelled it, the library does not have internal thread local storage - which for java is possible.