Configure Websphere JVM mode: 32 vs 64 bit
Hello, I have WAS 6.1 installed on Solaris 5.10 and I have an application with native code. The native code is 32-bit compliant and the JVM of WAS fails to load this code. I believe that WAS is running 64-bit JVM and that is the problem. However, I need to find a way to force WAS to run 32-bit JVM when it starts. Please let me know if anyone knows how to do this.
Information about the environment:
# cat /etc/release
Solaris 10 5/09 s10s_u7wos_08 SPARC
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 30 March 2009
# isainfo -v
64-bit sparcv9 applications
fmaf vis2 vis popc
32-bit sparc applications
fmaf vis2 vis popc v8plus div32 mul32
[B][WAS startup log - SystemOut.log][/B]
************ Start Display Current Environment ************
WebSphere Platform 6.1 [ND 188.8.131.52 a0641.02] running with process name ren01Cell01\ren01Node01\myAppdevAS and process id 14434
Host Operating System is SunOS, version 5.10
Java version = 1.5.0_06, Java Compiler = null, [B]Java VM name = Java HotSpot(TM) 64-Bit Server VM[/B]
was.install.root = /product/was61
user.install.root = /product/was61/profiles/AppSrv01
Java Home = /product/was61/java/jre
ws.ext.dirs = /product/was61/java/lib:/product/was61/profiles/AppSrv01/classes:/product/was61/classes:/product/was61/lib:/product/was61/installedChannels:/product/was61/lib/ext:/product/was61/web/help:/product/was61/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime
Classpath = /product/was61/profiles/AppSrv01/properties:/product/was61/properties:/product/was61/lib/startup.jar:/product/was61/lib/bootstrap.jar:/product/was61/lib/j2ee.jar:/product/was61/lib/lmproxy.jar:/product/was61/lib/urlprotocols.jar:/product/was61/deploytool/itp/batchboot.jar:/product/was61/deploytool/itp/batch2.jar:/product/was61/java/lib/tools.jar
Java Library path = /product/was61/java/jre/lib/sparcv9/server:/product/was61/java/jre/lib/sparcv9:/product/was61/java/jre/../lib/sparcv9:/product/myApp/myApp/lib:/opt/GPG/lib:/product/was61/java/jre/lib/sparcv9/server:/product/was61/java/jre/lib/sparcv9:/product/was61/java/jre/../lib/sparcv9:/product/was61/bin::/usr/lib
************* End Display Current Environment *************
[B][Error that I am getting in SystemErr.log][/B]
Caused by: java.lang.UnsatisfiedLinkError: /product/myApp/lib/libappservice.so: ld.so.1: java: fatal: /product/myApp/lib/libappservice.so: wrong ELF class: ELFCLASS32
I did some search on this error and from my analysis, it seems that it is because of the architecture difference. The 'file' command confirms the libraries are 32-bit mode:
libappservice.so: ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked, not stripped
I believe, launching 32-bit mode JVM should solve it. I know that we can launch 32-bit JVM from command line using "-d32" option. I tested the library using command line "java -d32" option. However it did not work when I supplied -d32 option in WAS JVM argument settings page. I was not able to start the server when I did this. Does anybody know how to launch 32-bit JVM for WAS? Any help is greatly appreciated.
Re: Configure Websphere JVM mode: 32 vs 64 bit
After digging all around internet, it seemed like running 32-bit JVM on 64-bit WAS is almost impossible. I see a 32-bit JVM binaries under 64-bit WAS installation in "sparc" directories. However, I dont know their purpose as it is anyway not possible to launch the application server with that JVM! (at least, I did not find a fool-proof way to do that).
So the only solution is to install 32-bit WAS!!! I did that and it now works fine... Though, I would have liked to use the 32-bit JVM on 64-bit WAS. I dont know why IBM puts that JVM on the 64-bit package in the first place!