近日在一个原本工作正常的weblogic web server(操作系统为redhat 64位系统)上折腾安装redis/hadoop等东东,yum install了一堆第3方类库后,重启weblogic时,发现nodemanager无法启动了,报错如下:
严重: Fatal error in node manager server
weblogic.nodemanager.common.ConfigException: Native version is enabled but nodemanager native library could not be loaded
at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:245)
at weblogic.nodemanager.server.NMServerConfig.<init>(NMServerConfig.java:185)
at weblogic.nodemanager.server.NMServer.init(NMServer.java:181)
at weblogic.nodemanager.server.NMServer.<init>(NMServer.java:147)
at weblogic.nodemanager.server.NMServer.main(NMServer.java:353)
at weblogic.NodeManager.main(NodeManager.java:31)
Caused by: java.lang.UnsatisfiedLinkError: no nodemanager in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1029)
at weblogic.nodemanager.util.UnixProcessControl.<init>(UnixProcessControl.java:25)
at weblogic.nodemanager.util.Platform.getProcessControl(Platform.java:114)
at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:243)
从出错信息上目测,是nodemanager加载native本地库时,版本不匹配,网上搜索了一圈,找到了解决办法:
添加环境变量LD_LIBRARY_PATH路径为:
...
export MW_HOME=/opt/app/Oracle/Middleware
export BASE_DOMAIN=$MW_HOME/user_projects/domains/base_domain
export LD_LIBRARY_PATH=$MW_HOME/wlserver_10.3/server/native/linux/x86_64
...
注意红色部分,退出重新登录,再次启动nodemanager,如果还不行,尝试把路径最后的部分换成/linux/i686(总之跟os的版本匹配上就行)
此外,还有一个办法据说也可以:修改下面这个文件
$MW_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties
找到
NativeVersionEnabled=true
将true改成false