要想在64位操作系统下安装WebLogic 10.3有些麻烦。首先Oracle的网站上没有64位的版本下载,我一开始下载的是wls1036_dev.zip,在几个批处理文件中发现有64位的几个环境变量,修改后用64位的JDK似乎没发现什么问题。但是今天在Debian 6 x64下启动Server时发现如下的错误:
####<Aug 21, 2012 5:32:45 PM PDT> <Warning> <Store> <debian6> <MedRecSvr1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1345595565955> <BEA-280109> <Unable to load the native wlfileio library for the persistent file store "_WLS_MedRecSvr1". The store will use buffered I/O. The store is still operating in a transactionally safe synchronous mode. See store open log messages for the requested and final write policies.>
####<Aug 21, 2012 5:32:46 PM PDT> <Info> <Store> <debian6> <MedRecSvr1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1345595566089> <BEA-280009> <The persistent file store "_WLS_MedRecSvr1" (98099c81-461c-4fd1-bf42-e597b4d5fb5a) has been opened: blockSize=512 actualWritePolicy="Direct-Write(single-handle-buffered)" explicitIOEnforced=false records=30.>
java.library.path =
/opt/middleware/wls1036/jdk1.6.0_34/jre/lib/amd64/server:
/opt/middleware/wls1036/jdk1.6.0_34/jre/lib/amd64:
/opt/middleware/wls1036/jdk1.6.0_34/jre/../lib/amd64:
/opt/middleware/wls1036/wlserver/server/native/linux/i686:
/opt/middleware/wls1036/wlserver/server/native/linux/i686/oci920_8:
/opt/middleware/wls1036/wlserver/server/native/linux/i686:
/opt/middleware/wls1036/wlserver/server/native/linux/i686/oci920_8:
/usr/java/packages/lib/amd64:
/usr/lib64:/lib64:/lib:/usr/lib
根据网上的指引,If this is the case, check the value of the java.library.path property (dumped to the WLS log). It should contain an entry for $WL_HOME/server/native/<OS>/<CPU-ARCH> (e.g., C:\Middleware\wlserver[_10.3]\server\native\win\32). This directory should contain the wlfileio3 native lib.
检查了一下java.library.path,发现的确有问题。按要求应该是$WL_HOME/server/native/linux/x86_64,而实际上却$WL_HOME/server/native/linux/i686。
另外网上搜到的相关回复是,Oracle WLS Team is currently tracking a 64-bit installer bug leading to native libs not being added to the java.library.path of JVM. The workaround to set it manually via -Djava.library.path JVM parameter or LD_LIBRARARY_PATH environment variable to $MW_HOME/wlserver_10.3/server/native/linux/x86_64
的确是LD_LIBRARY_PATH出了问题,在我的机器上如下:
:/opt/middleware/wls1036/wlserver/server/native/linux/i686:/opt/middleware/wls1036/wlserver/server/native/linux/i686/oci920_8
问题出在$WL_HOME/common/bin/commEnv.sh,里面有设置LD_LIBRARY_PATH,只需要修改这个脚本文件就可以解决了。
更具体地讲是SUN_ARCH_DATA_MODEL的值没有设置导致的,修改64就好了。
在commEnv.sh中有两个字符串的值需要修改,JAVA_USE_64BIT=true和SUN_ARCH_DATA_MODEL="64"。
其中SUN_ARCH_DATA_MODE="@SUN_ARCH_DATA_MODEL",估计这个值应该由configure.sh来修改的,但是它没有改。
此外还发现commEnv.sh中MW_HOME的设置有问题,修改JAVA_VENDOR更换JVM会导致WebLogic不能启动,MW_HOME为空。
至此,终于将实验环境搭好了,Oracle放在另一个Windows虚拟机上。