Server subsystem failed. Reason: java.lang.AssertionError: Could not obtain the localhost address

今天,在虚拟机字符界面安装weblogic11g并命令行创建weblogic domain后,执行startweblogic.sh报错。如下所示:、

/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.>
<Mar 17, 2019 8:38:54 PM CST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine.
java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine.
at weblogic.server.channels.BasicServerChannelImpl.getLocalHost(BasicServerChannelImpl.java:59)
at weblogic.server.channels.BasicServerChannelImpl.<clinit>(BasicServerChannelImpl.java:54)
at weblogic.rjvm.wls.WLSRJVMEnvironment.createDefaultChannel(WLSRJVMEnvironment.java:130)
at weblogic.protocol.ProtocolHandlerAdmin$ChannelInitializer.<clinit>(ProtocolHandlerAdmin.java:46)
at weblogic.protocol.ProtocolHandlerAdmin.getDefaultServerChannel(ProtocolHandlerAdmin.java:51)
Truncated. see log file for complete stacktrace
Caused By: java.net.UnknownHostException: openmake: openmake: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at weblogic.server.channels.BasicServerChannelImpl.getLocalHost(BasicServerChannelImpl.java:57)
at weblogic.server.channels.BasicServerChannelImpl.<clinit>(BasicServerChannelImpl.java:54)
at weblogic.rjvm.wls.WLSRJVMEnvironment.createDefaultChannel(WLSRJVMEnvironment.java:130)
at weblogic.protocol.ProtocolHandlerAdmin$ChannelInitializer.<clinit>(ProtocolHandlerAdmin.java:46)
Truncated. see log file for complete stacktrace
Caused By: java.net.UnknownHostException: openmake: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
at weblogic.server.channels.BasicServerChannelImpl.getLocalHost(BasicServerChannelImpl.java:57)
Truncated. see log file for complete stacktrace
>
<Mar 17, 2019 8:38:55 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<Mar 17, 2019 8:38:55 PM CST> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
<Mar 17, 2019 8:38:55 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
[root@openmake base_domain]# netstat -na | grep 7001
[root@openmake base_domain]# cd ..

确认无法打开7001端口。

最后解决办法:

[root@openmake ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.179.57 openmake
[root@openmake ~]#

也就是在/etc/hosts加上主机名跟IP的对应映射关系。想不到weblogic 也像websphere一样,要读写/etc/hosts的IP与主机的对应关系。

Weblogic10.3.6 补丁升级操作步骤

生产上经常会进行weblogic补丁升级操作,本文以升级补丁为例,weblogic版本为10.3.6.0.
Weblogic版本查询

weblogic版本查询方式:

1.命令方式1:

cd /usr/weblogic/Oracle/Middleware/utils/bsu
./bsu.sh -prod_dir=/usr/weblogic/Oracle/Middleware/wlserver_10.3/ -status=applied -verbose -view
/usr/weblogic/Oracle/Middleware为weblogic安装目录

2.命令方式2:

cd /usr/weblogic/Oracle/Middleware/wlserver_10.3/server/bin

source ./setWLSEnv.sh
java weblogic.version
3.web控台方式

在weblogic控制台主页 >服务器概要 >AdminServer >监视 >一般信息中也能查到版本

补丁下载

在oracle 官网下载weblogic的补丁。

补丁安装

cd /usr/weblogic/Oracle/Middleware/utils/bsu
如果有使用过bsu.sh,则会有cache_dir目录,否则请新建或执行bsu.sh生成。
上传patch至cache_dir目录并解压

unzip p20780171_1036_Generic_psu12.zip
解压出来的jar名就是Patch ID,是后面安装的参数。

停止服务,并确认无相关进程。

补丁安装:

阅读更多