- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Error: java.lang.UnsatisfiedLinkError
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
тАО03-12-2007 11:58 AM
тАО03-12-2007 11:58 AM
Error: java.lang.UnsatisfiedLinkError
cc -Ae +u4 +Z -c -D_HPUX -D_POSIX_C_SOURCE=199506L +DD64 \
-I /tuxedo8/tuxedo8.1/include -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux \
-lc -lnsl -lpthread -L /tuxedo8/tuxedo8.1/lib -lfml -lfml32 -ltux -lengine -lbuft -lgiconv -lusort \
cImpl.c
This generate an .o file then run the next command:
cc -b -o libcImpl.sl cImpl.o +DD64 \
-lc -lnsl -lpthread -L /tuxedo8/tuxedo8.1/lib -lfml -lfml32 -ltux -lengine -lbuft -lgiconv -lusort
And generate the libcImpl.sl "Shared Library" so try load this library with a java program:
java TestJava2CallingNative cImpl
The result is a message of subject . . .
/libcImpl.sl: specified file is not a shared library, or a format error was detected.
How can verify my .sl file or what are doing bad?
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2007 01:59 PM - edited тАО10-09-2011 09:05 PM
тАО03-12-2007 01:59 PM - edited тАО10-09-2011 09:05 PM
Re: Error: java.lang.UnsatisfiedLinkError
There is nothing that tells you in more detail what is wrong? The name of the symbol in question?
cc -b -o libcImpl.sl cImpl.o +DD64 \
-lc -lnsl -lpthread -L/tuxedo8/tuxedo8.1/lib -lfml -lfml32 -ltux -lengine -lbuft -lgiconv -lusort
You have your libs out of order. -lc should be removed. System libs should be after user libs, move -lnsl -lpthread to the end.
/libcImpl.sl: specified file is not a shared library, or a format error was detected.
>How can verify my .sl file or what are doing bad?
To check if the right format, you could try
$ file libcImpl.sl
I assume you are using a 64 bit java (-d64) to go with your 64 bit lib??
If you can't get java to give you more details on unsats, you should write a dummy main that uses shl_load or dlopen on your lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2007 04:21 AM
тАО03-13-2007 04:21 AM
Re: Error: java.lang.UnsatisfiedLinkError
change the makefile as you suggest and then compile the source (.c) the result is ( />file libcImpl.sl)
libcImpl.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)
But when execute my java program send me the error:
Error: java.lang.UnsatisfiedLinkError
So what recompile without some libraries leave the makefile:
cc -b -o libcImpl.sl cImpl.o
The result was:
/>file libcImpl.sl
libcImpl.sl: PA-RISC2.0 shared library -not stripped
/>java TestJava2CallingNative cImpl
Shared library cImpl load
call to method sayHelloWorld
C say HelloWorld via stdio
/usr/lib/dld.sl: Unresolved symbol: userlog (code) from .//libcImpl.sl
/usr/lib/dld.slAbort(coredump)
I Know that need link the definition of "userlog" function, but make this generate an link error:
/usr/ccs/bin/ld: /tuxedo8/tuxedo8.1/lib/libfml.sl: Mismatched ABI. 64-bit PA shared library found in 32-bit link.
For this reason my makefile need link in mode 64-bit all libraries.
Question: How can know that my JAVA is from 64-bit?
thank
- Tags:
- ABI mismatch
- unsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2007 02:43 PM
тАО03-13-2007 02:43 PM
Re: Error: java.lang.UnsatisfiedLinkError
This would not fix your problem but make sure you don't have others.
/>>java TestJava2CallingNative cImpl
>/usr/lib/dld.sl: Unresolved symbol: userlog (code) from .//libcImpl.sl
This seems to tell you exactly what was wrong.
>Know that need link the definition of "userlog" function, but make this generate an link error:
/usr/ccs/bin/ld: /tuxedo8/tuxedo8.1/lib/libfml.sl: Mismatched ABI. 64-bit PA shared library found in 32-bit link.
You need to compile and link with +DD64.
>Question: How can know that my JAVA is from 64-bit?
You need to pass in "-d64" to get 64 bit.
Have you tried my suggestion of a dummy main to load your JNI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 07:13 AM
тАО03-14-2007 07:13 AM
Re: Error: java.lang.UnsatisfiedLinkError
I compile with +DD64 option and libraries include successful.
But the error now is:
Error: java.lang.UnsatisfiedLinkError: /jni_tst/libcImpl.sl: some symbol required by the shared library could not be found.
The core was not generated used -d64 option.
I make my main dummy for load JNI and execute successful, no have problem, the problem is when link the TUXEDO libreries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 01:17 PM
тАО03-14-2007 01:17 PM
Re: Error: java.lang.UnsatisfiedLinkError
That's not very helpful. :-(
The PA aC++ runtime makes sure you get a list before you abort.
>The core was not generated used -d64 option.
Can you use that option with java?
>I make my main dummy for load JNI and execute successful, no have problem, the problem is when link the TUXEDO libreries.
You have to link exactly the same as your real application, with TUXEDO. Using shl_load with BIND_IMMEDIATE would give you the list of all unsats.
I suppose you can also get them with -Wl,+vnoshlibunsats. (If you left off the -lc as I said above, add it back (after -lpthread), look at the messages, then remove it.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2007 01:37 PM
тАО03-14-2007 01:37 PM
Re: Error: java.lang.UnsatisfiedLinkError
java.lang.UnsatisfiedLinkError: xx.so:
xx.so' is not a valid load module: Bad machine type
A message similar to this would indicate you need that -d64.