aspose file tools*
The moose likes BEA/Weblogic and the fly likes WLST: How to set the path to my deployment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WLST: How to set the path to my deployment?" Watch "WLST: How to set the path to my deployment?" New topic

WLST: How to set the path to my deployment?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436

I'm using WebLogic 9.2.2. I'm trying to write a script to automatically set up my server and its cluster. But I can't figure out how to set the path to the source of the deployable unit -- e.g. where my WAR file will go.

Below is the script I'm currently using, if that gives any insight into how I'm thinking. Thanks, - Dave

===========================Begin script====================================
from java.util import *
from import *

print 'starting the script .... '

cluster_name = 'Dave_Cluster'
ms1 = {'managed1': (7019,8020),'managed2': (7020,8021)}
machine = 'my-machine-machine'
log_file = 'logs/npsconfiggui-ms-1.log'
classpath = '/export/third-party/etsbea/application_conf/wls_9.2.2/nps_config_gui_conf:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/server/lib/weblogic.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n-schemas.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n_common.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n_user.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/net uix_common.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/netuix_schemas.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/netuix_user.jar:.:/export/third-party/etsbea/product/wls_9.2.2/jdk1.5.0_12/lib/tools.jar'
arguments = '-Xms256m -Xmx256m -XX:NewSize=64m -XX:MaxNewSize=64m -XX:SurvivorRatio=4 -Dweblogic.wsee.useRequestHost=true'


print 'creating cluster '+cluster_name
clu = create(cluster_name,'Cluster')
cd('Clusters/' + cluster_name)
set('MulticastAddress', '')
set('ClusterAddress', '')
set('MulticastPort', 9020)
set('DefaultLoadAlgorithm', 'round-robin-affinity')
set('WeblogicPluginEnabled', 'false')


for m, (lp, ssl_lp) in ms1.items():
cd ('/')

managedServer = create(m,'Server')
print 'creating managed server '+m
# Set SSL port
cd('Servers/' + m + '/SSL/' + m)
set ('Enabled', 'true')
set ('ListenPort', ssl_lp)

# create ServerStart
cd ('../../ServerStart/' + m)
set ('ClassPath', classpath)
set ('Arguments', arguments)

cd ('../../Log/' + m)
set ('FileName', log_file)

# assign server to machine
assign('Server', m, 'Machine', machine)

# assign server to cluster
============================End script====================================
I agree. Here's the link:
subject: WLST: How to set the path to my deployment?