Operating System - HP-UX
1833873 Members
2924 Online
110063 Solutions
New Discussion

JNI Unable to load native library: insufficient room in the address space to load the library.

 
Daavid Turnbull
Frequent Advisor

JNI Unable to load native library: insufficient room in the address space to load the library.

I am trying to access java from the native side under HP-UX.

In the aCC++ source when I call:
_____

rc = JNI_CreateJavaVM(&jvm,(void **)&env, &vm_args);
_____
I get:


Error occurred during initialization of VM
Unable to load native library: insufficient room in the address space to load the library.

I tried a number of things including adjusting max stack etc. ulimit now reports:
_____

> ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 262144
stack(kbytes) 16384
memory(kbytes) unlimited
coredump(blocks) 4194303
________

One of the resources I have been using as a guide is:

http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html#non_java_ac++

Attached is my (fairly) basis source code I have been using.

What I am I doing wrong??

(For completeness I include output from a make/run pass below.

In anticipation, __daavid

______________

daavid@ausccm1:/home/daavid/projects/CCT/servers/legacy
> make -f wc.mk clean
rm test2 test2.o WesCCT.class
daavid@ausccm1:/home/daavid/projects/CCT/servers/legacy
> make -f wc.mk
javac -classpath /opt/eia_3.6/classes:/opt/eia_3.6/conf:/opt/eia_3.6/lib/eialib_client.jar:/opt/eia_3.6/lib
/weblogic.jar::/home/daavid/projects/CCT/tools/WesTest/adminclient.jar:/home/daavid/projects/CCT/tools/WesTest/comm
ons-lang-1.0.jar:. WesCCT.java
aCC -g +u4 -c -ext -I /opt/java1.4/include -I /opt/java1.4/include/hp-ux -D_HPUX -D_POSIX_C_SOURCE=19950L -
D_REENTRANT test2.cpp
aCC -g -z -o test2 test2.o -L /opt/java1.4/jre/lib/PA_RISC/hotspot -ljvm -lpthread -llwp
daavid@ausccm1:/home/daavid/projects/CCT/servers/legacy
> ./test2
beginning execution... set up vm args structure
before CreateJavaVM
options[0] - -Djava.class.path=.:/opt/java1.4/jre/lib/rt.jar:/opt/hpservices/jre/lib/i18n.jar:/opt/java/lib/classes
.zip
Error occurred during initialization of VM
Unable to load native library: insufficient room in the address space to load the library.
daavid@ausccm1:/home/daavid/projects/CCT/servers/legacy
Behold the turtle for he makes not progress unless he pokes his head out.