- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- JNI_CreateJavaVM return Exec format error when cal...
Operating System - HP-UX
1820254
Members
2562
Online
109622
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2003 02:47 PM
тАО02-19-2003 02:47 PM
JNI_CreateJavaVM return Exec format error when called from shared library
I am desperately looking for solution, Can somebody help me?
Our tool has a Java and native component on unix box. It is runs okay on Alpha Tru64, we are trying to port it on HP-UX 11.11.
The overall flow is as follows:
The Java Class 'A' needs to instantiate the Java class 'B' upon some event. The 'B' class can have multiple instances running at one time. In other words the 'B' needs to run either as a thread or a different process (to optimize the performance). The Thread approach is pretty much straight forward and works as it is.
The Process aproach architecture: The java class 'B' calls the JNI code(native library written in C), the JNI library in turn calls the standalone process written in C (let's call it StartProcess). The StartProcess process calls the Java shared library libjvm.sl and invokes the Java program (Class 'B') by calling JNI_CreateJavaVM etc. It works perfectly fine on Alpha Tru64, but the call JNI_CreateJavaVM return following error message HP-UX.
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /op
t/java1.3/bin/../jre/lib/PA_RISC2.0/server/libjvm.sl
/usr/lib/dld.sl: Exec format error
Can't load library "/opt/java1.3/jre/lib/PA_RISC/libverify.sl", because specifie
d file is not a shared library, or a format error was detected.
can't create java vm
When I call StartProcess process directly from the shell, it works okay (calls the class 'B') but returns error when called from the java program 'A'. I am suspecting the reason could be either because of Compiler options or my profile. I have looked into the HP documentation and have tried different compiler options, still not able to connect all pieces together.
Following are the compiler options I am giving currently
Compiler Options:
For JNI library:
aCC -Ae +u4 +z -c -D_HPUX -DNATIVE -D_POSIX_C_SOURCE=199506L \
-I/opt/java1.3/include -I/opt/java1.3/include/hp-ux \
ProcessImpl.c
aCC -b -o libprocessimpl.sl ProcessImpl.o \
-lCsup -lstream -lstd -lcl
For standalone process (StartProcess)
aCC -z -g +u4 -c -Ae -D_HPUX \
-DNATIVE -D_POSIX_C_SOURCE=199506L \
-I/opt/java1.3/include -I/opt/java1.3/include/hp-ux \
StartProcess.c
aCC -g -o StartProcess StartProcess.o -lpthread
Our tool has a Java and native component on unix box. It is runs okay on Alpha Tru64, we are trying to port it on HP-UX 11.11.
The overall flow is as follows:
The Java Class 'A' needs to instantiate the Java class 'B' upon some event. The 'B' class can have multiple instances running at one time. In other words the 'B' needs to run either as a thread or a different process (to optimize the performance). The Thread approach is pretty much straight forward and works as it is.
The Process aproach architecture: The java class 'B' calls the JNI code(native library written in C), the JNI library in turn calls the standalone process written in C (let's call it StartProcess). The StartProcess process calls the Java shared library libjvm.sl and invokes the Java program (Class 'B') by calling JNI_CreateJavaVM etc. It works perfectly fine on Alpha Tru64, but the call JNI_CreateJavaVM return following error message HP-UX.
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /op
t/java1.3/bin/../jre/lib/PA_RISC2.0/server/libjvm.sl
/usr/lib/dld.sl: Exec format error
Can't load library "/opt/java1.3/jre/lib/PA_RISC/libverify.sl", because specifie
d file is not a shared library, or a format error was detected.
can't create java vm
When I call StartProcess process directly from the shell, it works okay (calls the class 'B') but returns error when called from the java program 'A'. I am suspecting the reason could be either because of Compiler options or my profile. I have looked into the HP documentation and have tried different compiler options, still not able to connect all pieces together.
Following are the compiler options I am giving currently
Compiler Options:
For JNI library:
aCC -Ae +u4 +z -c -D_HPUX -DNATIVE -D_POSIX_C_SOURCE=199506L \
-I/opt/java1.3/include -I/opt/java1.3/include/hp-ux \
ProcessImpl.c
aCC -b -o libprocessimpl.sl ProcessImpl.o \
-lCsup -lstream -lstd -lcl
For standalone process (StartProcess)
aCC -z -g +u4 -c -Ae -D_HPUX \
-DNATIVE -D_POSIX_C_SOURCE=199506L \
-I/opt/java1.3/include -I/opt/java1.3/include/hp-ux \
StartProcess.c
aCC -g -o StartProcess StartProcess.o -lpthread
Angad
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2003 12:43 PM
тАО02-20-2003 12:43 PM
Re: JNI_CreateJavaVM return Exec format error when called from shared library
http://www.hp.com/go/java
Get and install a current version of java.
More important, whatever version you have, make sure its properly patched. The patch list for each version is on the site above.
Lastly on HP-UX
swverify \*
Report any java errors to HP and get them corrected.
SEP
Get and install a current version of java.
More important, whatever version you have, make sure its properly patched. The patch list for each version is on the site above.
Lastly on HP-UX
swverify \*
Report any java errors to HP and get them corrected.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2003 01:46 PM
тАО02-20-2003 01:46 PM
Re: JNI_CreateJavaVM return Exec format error when called from shared library
Another thing to also look into is the env var LD_PRELOAD (look for information about it in the ld man page) that will allow you to dynamically load libraries that contain thread local storage. I don't know if you are doing that but it the error isn't bogus, that may solve that part of the problem.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP