I'm trying to figure out why timer doesn't wait 300 secs, but raise imediately exception. Anybody can help me to resolve this issue? thanks.
here's my code:
import sys
import os
from java.lang import System
import getopt
import time as systime
from threading import Timer
import time
[...]
def _startServer(ServerName):
cd('domainRuntime:/ServerLifeCycleRuntimes/'+ServerName);
state=_serverstatus(ServerName);
while (state!='RUNNING'):
try:
cmo.start();
while (state!='RUNNING'):
state=_serverstatus(ServerName);
java.lang.Thread.sleep(1000);
t = threading.Timer(300.0,timeout)
t.start()
except:
print 'Error in getting current status of ' +ServerName+ '\n';
print 'Please check logged in user has full access to complete the start operation on ' +ServerName+ '\n';
print 'Timeout, NodeManager may be down. Checking... ' + '\n';
os.popen('sh /home/oracle/scripts/logAnalytics.sh')
systime.sleep(60)
state=_serverstatus(ServerName);
[...]
and the result:
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
172.31.129.68:7001
Connecting to t3://172.31.129.68:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'cll5_domain'.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
Successfully connected to the domain
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Server Server_2 is :SHUTDOWN
Trying To Start Server:Server_2...
Server Server_2 is :SHUTDOWN
Server Server_2 is :SHUTDOWN
Error in getting current status of Server_2
Please check logged in user has full access to complete the start operation on Server_2
Timeout, NodeManager may be down. Checking...
Server Server_2 is :SHUTDOWN
Server Server_2 is :SHUTDOWN
Error in getting current status of Server_2
Please check logged in user has full access to complete the start operation on Server_2
Timeout, NodeManager may be down. Checking...
Server Server_2 is :RUNNING
Disconnected from weblogic server: AdminServer
Exiting WebLogic Scripting Tool.
(Note that the string "Server Server_2 is :SHUTDOWN" must be written on screen several times before the next process start. About 60 times, because there's a while cycle that print the string of server status every 5 secs and the timer is 300 secs.)
Environment: Oracle Linux 6, Oracle Weblogic 11
Any help is apreciated.