wrong ELF class: ELFCLASS64 (Possible cause: architecture word widthmismatch)

This is a discussion on wrong ELF class: ELFCLASS64 (Possible cause: architecture word widthmismatch) within the solaris forums in Operating Systems category; I compiled my jMultidev.jar and libhwAPI_64.so with 64bit. How to debug this error? $ java -jar jMultidev.jar Failed to load hwAPI and hwAPI_64 libraries. java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/ ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/ jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at ...

Go Back   Database Forum > Operating Systems > solaris

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 06:24 PM
Default wrong ELF class: ELFCLASS64 (Possible cause: architecture word widthmismatch)

I compiled my jMultidev.jar and libhwAPI_64.so with 64bit.
How to debug this error?
$ java -jar jMultidev.jar
Failed to load hwAPI and hwAPI_64 libraries.
java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/
ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/
jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64
(Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at com.mycomp.crypto.hwAPI.(hwAPI.java:47)
at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
101)
at
com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
at jMultidev.jMultidev.(jMultidev.java:32)
at jMultidev.jMultidev.main(jMultidev.java:805)
Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.mycomp.crypto.hwAPI.Initialize()V
at com.mycomp.crypto.hwAPI.Initialize(Native Method)
at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
107)
at
com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
at jMultidev.jMultidev.(jMultidev.java:32)
at jMultidev.jMultidev.main(jMultidev.java:805)



OS is solaris 10 (SunOS 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500).

$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

CC: WorkShop Compilers 5.0 02/10/08 C++ 5.0 Patch 107311-19
/opt/SUNWspro/bin/../SC5.0/bin/c++filt: WorkShop Compilers 5.0
02/10/08 C++ 5.0 Patch 107311-19
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477
Reply With Quote
  #2  
Old 08-26-2008, 07:25 PM
Default Re: wrong ELF class: ELFCLASS64 (Possible cause: architecture wordwidth mismatch)

TsanChung wrote:
> I compiled my jMultidev.jar and libhwAPI_64.so with 64bit.
> How to debug this error?
> $ java -jar jMultidev.jar
> Failed to load hwAPI and hwAPI_64 libraries.
> java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/
> ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/
> jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64
> (Possible cause: architecture word width mismatch)
> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660)
> at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> at java.lang.System.loadLibrary(System.java:1030)
> at com.mycomp.crypto.hwAPI.(hwAPI.java:47)
> at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> 101)
> at
> com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> at jMultidev.jMultidev.(jMultidev.java:32)
> at jMultidev.jMultidev.main(jMultidev.java:805)
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> com.mycomp.crypto.hwAPI.Initialize()V
> at com.mycomp.crypto.hwAPI.Initialize(Native Method)
> at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> 107)
> at
> com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> at jMultidev.jMultidev.(jMultidev.java:32)
> at jMultidev.jMultidev.main(jMultidev.java:805)
>
>
>
> OS is solaris 10 (SunOS 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500).
>
> $ java -version
> java version "1.6.0_07"
> Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
> Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
>
> CC: WorkShop Compilers 5.0 02/10/08 C++ 5.0 Patch 107311-19
> /opt/SUNWspro/bin/../SC5.0/bin/c++filt: WorkShop Compilers 5.0
> 02/10/08 C++ 5.0 Patch 107311-19
> ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477


You cannot compile java sources for 64bit.
They are independent of 32 or 64bit.

Try
java -d64 -jar jMultidev.jar
to force the use of the 64bit JVM.
Reply With Quote
  #3  
Old 08-27-2008, 03:45 AM
Default Re: wrong ELF class: ELFCLASS64 (Possible cause: architecture wordwidth mismatch)

Hi,


On 26 Aug., 23:24, TsanChung wrote:
> I compiled my jMultidev.jar and libhwAPI_64.so with 64bit.
> How to debug this error?
> $ java *-jar jMultidev.jar
> Failed to load hwAPI and hwAPI_64 libraries.
> java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/
> ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/
> jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64
> (Possible cause: architecture word width mismatch)
> * * * * at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> * * * * at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751)
> * * * * at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660)
> * * * * at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> * * * * at java.lang.System.loadLibrary(System.java:1030)
> * * * * at com.mycomp.crypto.hwAPI.(hwAPI.java:47)
> * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager..java:
> 101)
> * * * * at
> com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> * * * * at jMultidev.jMultidev.main(jMultidev.java:805)
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> com.mycomp.crypto.hwAPI.Initialize()V
> * * * * at com.mycomp.crypto.hwAPI.Initialize(Native Method)
> * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager..java:
> 107)
> * * * * at
> com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> * * * * at jMultidev.jMultidev.main(jMultidev.java:805)
>
> OS is solaris 10 (SunOS 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500).
>
> $ java -version
> java version "1.6.0_07"
> Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
> Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
>
> CC: WorkShop Compilers 5.0 02/10/08 C++ 5.0 Patch 107311-19
> /opt/SUNWspro/bin/../SC5.0/bin/c++filt: WorkShop Compilers 5.0
> 02/10/08 C++ 5.0 Patch 107311-19
> ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477


I've no experience with a shared object in java, but from the error
mesage I would say, that
the JVM is running in 32 bit mode and your lib is 64 bit.


HTH
Ewald
Reply With Quote
  #4  
Old 08-27-2008, 11:11 AM
Default Re: wrong ELF class: ELFCLASS64 (Possible cause: architecture wordwidth mismatch)

On Aug 26, 6:25*pm, Frank Langelage wrote:
> TsanChung wrote:
> > I compiled my jMultidev.jar and libhwAPI_64.so with 64bit.
> > How to debug this error?
> > $ java *-jar jMultidev.jar
> > Failed to load hwAPI and hwAPI_64 libraries.
> > java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/
> > ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/
> > jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64
> > (Possible cause: architecture word width mismatch)
> > * * * * at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> > * * * * at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751)
> > * * * * at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660)
> > * * * * at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> > * * * * at java.lang.System.loadLibrary(System.java:1030)
> > * * * * at com.mycomp.crypto.hwAPI.(hwAPI.java:47)
> > * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> > 101)
> > * * * * at
> > com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> > * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> > * * * * at jMultidev.jMultidev.main(jMultidev.java:805)
> > Exception in thread "main" java.lang.UnsatisfiedLinkError:
> > com.mycomp.crypto.hwAPI.Initialize()V
> > * * * * at com.mycomp.crypto.hwAPI.Initialize(Native Method)
> > * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> > 107)
> > * * * * at
> > com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> > * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> > * * * * at jMultidev.jMultidev.main(jMultidev.java:805)

>
> > OS is solaris 10 (SunOS 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500).

>
> > $ java -version
> > java version "1.6.0_07"
> > Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
> > Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

>
> > CC: WorkShop Compilers 5.0 02/10/08 C++ 5.0 Patch 107311-19
> > /opt/SUNWspro/bin/../SC5.0/bin/c++filt: WorkShop Compilers 5.0
> > 02/10/08 C++ 5.0 Patch 107311-19
> > ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477

>
> You cannot compile java sources for 64bit.
> They are independent of 32 or 64bit.
>
> Try
> * * java -d64 -jar jMultidev.jar
> to force the use of the 64bit JVM.

$ java -d64 -jar jMultidev.jar
Failed to load function 'CA_GetHAStatus'.
Exception in thread "main" com.mycomp.crypto.hwCryptokiException:
function 'CrystokiConnect failed' returns 0x0
at
com.mycomp.crypto.hwCryptokiException.ThrowNew(hwC ryptokiException.java:
57)
at com.mycomp.crypto.hwAPI.Initialize(Native Method)
at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
107)
at
com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
at jMultidev.jMultidev.(jMultidev.java:32)
at jMultidev.jMultidev.main(jMultidev.java:805)


However, the same source code works on a 64 bit linux computer (Linux
2.6.9-67.EL #1 Wed Nov 7 13:43:31 EST 2007 x86_64 x86_64 x86_64 GNU/
Linux).
java -d64 -jar jMultidev.jar
java -jar jMultidev.jar

Because java is write once, run everywhere, so I copy the jar files
from the linux computer to the solaris computer.
However,
java -d64 -jar jMultidev.jar
java -jar jMultidev.jar
both fails.

What is the problem?
Is it in libhwAPI_64.so?

Reply With Quote
  #5  
Old 08-27-2008, 01:00 PM
Default Re: wrong ELF class: ELFCLASS64 (Possible cause: architecture wordwidth mismatch)

Hi,

On 27 Aug., 16:11, TsanChung wrote:
> On Aug 26, 6:25*pm, Frank Langelage wrote:
>
> > TsanChung wrote:
> > > I compiled my jMultidev.jar and libhwAPI_64.so with 64bit.
> > > How to debug this error?
> > > $ java *-jar jMultidev.jar
> > > Failed to load hwAPI and hwAPI_64 libraries.
> > > java.lang.UnsatisfiedLinkError: /usr/jdk/instances/jdk1.6.0_07/jre/lib/
> > > ext/libhwAPI_64.so: ld.so.1: java: fatal: /usr/jdk/instances/
> > > jdk1.6.0_07/jre/lib/ext/libhwAPI_64.so: wrong ELF class: ELFCLASS64
> > > (Possible cause: architecture word width mismatch)
> > > * * * * at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> > > * * * * at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1751)
> > > * * * * at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1660)
> > > * * * * at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> > > * * * * at java.lang.System.loadLibrary(System.java:1030)
> > > * * * * at com.mycomp.crypto.hwAPI.(hwAPI.java:47)
> > > * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> > > 101)
> > > * * * * at
> > > com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> > > * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> > > * * * * at jMultidev.jMultidev.main(jMultidev.java:805)
> > > Exception in thread "main" java.lang.UnsatisfiedLinkError:
> > > com.mycomp.crypto.hwAPI.Initialize()V
> > > * * * * at com.mycomp.crypto.hwAPI.Initialize(Native Method)
> > > * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager.java:
> > > 107)
> > > * * * * at
> > > com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> > > * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> > > * * * * at jMultidev.jMultidev.main(jMultidev.java:805)

>
> > > OS is solaris 10 (SunOS 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500)..

>
> > > $ java -version
> > > java version "1.6.0_07"
> > > Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
> > > Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

>
> > > CC: WorkShop Compilers 5.0 02/10/08 C++ 5.0 Patch 107311-19
> > > /opt/SUNWspro/bin/../SC5.0/bin/c++filt: WorkShop Compilers 5.0
> > > 02/10/08 C++ 5.0 Patch 107311-19
> > > ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477

>
> > You cannot compile java sources for 64bit.
> > They are independent of 32 or 64bit.

>
> > Try
> > * * java -d64 -jar jMultidev.jar
> > to force the use of the 64bit JVM.

>
> $ java -d64 -jar jMultidev.jar
> Failed to load function 'CA_GetHAStatus'.
> Exception in thread "main" com.mycomp.crypto.hwCryptokiException:
> function 'CrystokiConnect failed' returns 0x0
> * * * * at
> com.mycomp.crypto.hwCryptokiException.ThrowNew(hwC ryptokiException.java:
> 57)
> * * * * at com.mycomp.crypto.hwAPI.Initialize(Native Method)
> * * * * at com.mycomp.crypto.hwTokenManager.(hwTokenManager..java:
> 107)
> * * * * at
> com.mycomp.crypto.hwTokenManager.getInstance(hwTok enManager.java:62)
> * * * * at jMultidev.jMultidev.(jMultidev.java:32)
> * * * * at jMultidev.jMultidev.main(jMultidev.java:805)
>
> However, the same source code works on a 64 bit linux computer (Linux
> 2.6.9-67.EL #1 Wed Nov 7 13:43:31 EST 2007 x86_64 x86_64 x86_64 GNU/
> Linux).
> java -d64 -jar jMultidev.jar
> java -jar jMultidev.jar
>
> Because java is write once, run everywhere, so I copy the jar files
> from the linux computer to the solaris computer.
> However,
> java -d64 -jar jMultidev.jar
> java -jar jMultidev.jar
> both fails.
>
> What is the problem?
> Is it in libhwAPI_64.so?

How do you get the Interface to the libhwAPI_64.so library?. Is it
over JNI?
I have not done such a thing, but perhaps there is a problem in the
generated interface's calling the
Shared Object methods?


Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.