Sunday, December 6, 2009

Starting AdminServer with WLST

Use the WLST startServer command to start the Administration Server.

startServer([adminServerName], [domainName], [url], [username],
[password],[domainDir], [block], [timeout], [serverLog],
[systemProperties], [jvmArgs] [spaceAsJvmArgsDelimiter])



import os

adminServerName = "AdminServer"
adminServerUrl = "t3://localhost:7001"
adminUser = "weblogic"
adminPassword = "weblogic123"

domainName = "base_domain"
domainHome = "/app/bea/domains/base_domain"

print "JAVA_HOME %s" % os.getenv("JAVA_HOME")
print "CLASSPATH %s" % os.getenv("CLASSPATH")

try:
print "try connect to WLS %s" % adminServerName
hideDumpStack("true")
connect(adminUser, adminPassword, adminServerUrl)
hideDumpStack("false")
print "Connected to %s" % adminServerName
except WLSTException:
hideDumpStack("false")
print "Server not started, try start %s " % adminServerName
startServer(adminServerName,domainName,
adminServerUrl, adminUser, adminPassword,
domainHome,block="true")
print "started %s" % adminServerName
connect(adminUser, adminPassword, adminServerUrl)

ls()

shutdown(force='true')

exit()




Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

JAVA_HOME /usr/java/jdk160_05
CLASSPATH None
try connect to WLS AdminServer
Connecting to t3://localhost:7001 with userid weblogic ...
Server not started, try start AdminServer
Starting weblogic server ...



Server started successfully.
started AdminServer
Connecting to t3://localhost:7001 with userid weblogic ...
WLST-WLS-1260094522421: <Dec 6, 2009 11:15:45 AM CET> <Warning> <JMX> <BEA-149517> <An attempt was made to unregister an mbean that was already unregistered: weblogic.servlet.internal.ServletRuntimeMBeanImpl@146de01>
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'.

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.

No comments:

Post a Comment