For starting of the Weblogic infrastructure our customer used a WLST script. The script looks like this:
startNodeManager(NodeManagerHome=<nmHome> ListenPort=5556,ListenAddress=localhost) sleep(60) nmConnect('weblogic','xxx','localhost','5556','MYDOMAIN') nmStart('AdminServer') nmStart('WLS_FORMS') nmStart('WLS_REPORTS')
First step is the starting of the node manager. The node manager process needs some time before the listener on the port 5556 is active. The “some time” is depend on several factors and the waiting of 60 sec can be not enough for the starting of the node manager. In this case the following connection to the node manager (nmConnect) will be fail and all components of the Weblogic infrastructure (except Node Manager:-) ) remain down. For the automatically start of the Weblogic server after an unplanned rebound of the system it’s not optimal solution. Oracle understood the problem too and extended the startNodeManager procedure in the version 220.127.116.11 with the following parameters:
block—Specifies whether WLST should block until it successfully connects to Node Manager or fails to connect within the specified timeout.
nmConnectOptions—When block is true, use this argument to specify a list of Node Manager connection options.
timeout—The number of milliseconds to wait for Node Manager to connect.
With this extension we can wait for successful connection to the Node Manager by starting and you don’t need the sleep() command anymore. Start node manager command will be looks like this (the blue marked parameters are the nmConnect parameters):
startNodeManager(block='true', timeout=600000, NodeManagerHome='<NodeMangerHome>', ListenPort='5556', ListenAddress='localhost', username='weblogic', password='xxx', host='localhost', port='5556', domainName= 'MYDOMAIN')
Now only if the connection to the node manager is successful, the modified script starts Admin Server and other in script defined components.