WLST Script to deploy jar file on Weblogic Server

print 'deploying jar…' connect('weblogic','weblogic123','t3://localhost:7001') try: undeploy('app') print 'Redeploying' except Exception: print 'Deploy' status = deploy(appName='app', path='app.jar',targets='AdminServer,', libraryModule='true') print status

Continue reading »

WLST Script to rotate server log file

You can use the script below to rotate server log files using WLST connect('weblogic','weblogic123','t3://localhost:7001') serverRuntime() cd('LogRuntime/AdminServer') cmo.forceLogRotation() print 'Log file rotated'

Continue reading »

WLST Script to start and stop Datasource

  Script to start Datasource connect('weblogic','weblogic123','t3://localhost:7001') domainRuntime() cd('ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/JDBCDataSourceRuntimeMBeans/PegaRULES') objArray = jarray.array([], java.lang.Object) strArray = jarray.array([], java.lang.String) invoke('start', objArray, strArray) exit() Script to stop Datasource connect('weblogic','weblogic123','t3://localhost:7001') domainRuntime() cd('ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/JDBCDataSourceRuntimeMBeans/PegaRULES') objArray = jarray.array([], java.lang.Object) strArray = jarray.array([], java.lang.String) invoke('shutdown', objArray, strArray) exit()

Continue reading »

Configuring SSL on Weblogic Server using WLST Script

Create a certs folder in your C Drive and copy the setWLSEnv.cmd from your WL_HOME\bin to this location. Run the script from the command line to set the environment. C:\certs>setWLSEnv.cmd Generate Key Pair C:\certs>keytool -genkey -alias mykey -keyalg RSA -keysize 1024 -dname “CN=local host, OU=Customer Support, O=BEA Systems Inc, L=Denver,

Continue reading »

All Server States using WLST

This is an extension to my earlier post which gives the runtime attributes about the alive servers. http://weblogic-wonders.com/weblogic/2011/03/16/weblogic-server-runtime-using-wlst/ However there could be scenarios where you might want to keep a track of all the server states like RUNNING, SHUTDOWN  etc  in the domain. The below WLST script provides a list

Continue reading »

Application State Monitoring using WLST

There are scenarios when you would want to monitor the Application state of the currently deployed applications in the Domain using the WebLogic Server Runtime Mbeans. Properties like Application State. This can be achieved through many ways like the Admin Console, JMX code, WLST scripts etc. WLST allows us to

Continue reading »

Monitoring WebLogic Server Runtime using WLST

There are scenarios when you would want to monitor the properties of your alive servers in the Domain using the WebLogic Server Runtime Mbeans. Properties like Server State, Server Health, Listen Port, Listen Addresses etc. This can be achieved through many ways like the Admin Console, JMX code, WLST scripts

Continue reading »

Remote Administration Of Domain Through WLST

For administration of the whole domain and all the servers in the domain, we can use WLST commands. This is the best way for a monitoring and managing the complete domain using nodemanager. To start the admin server using WLST, ensure that the admin server is associated to a machine.

Continue reading »

Creating Datasource using WLST

connect(‘weblogic’,’weblogic’,’t3://localhost:7001′) edit() startEdit() cd(‘/’) cmo.createJDBCSystemResource(‘PegaRULES’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES’) cmo.setName(‘PegaRULES’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDataSourceParams/PegaRULES’) set(‘JNDINames’,jarray.array([String(‘jdbc/PegaRULES’)], String)) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES’) cmo.setUrl(‘jdbc:sqlserver://localhost:1433’) cmo.setDriverName(‘com.microsoft.sqlserver.jdbc.SQLServerDriver’) cmo.setPassword(‘pega612’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCConnectionPoolParams/PegaRULES’) cmo.setTestTableName(‘SQL SELECT 1\r\n\r\n’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES/Properties/PegaRULES’) cmo.createProperty(‘user’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES/Properties/PegaRULES/Properties/user’) cmo.setValue(‘pega612’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES/Properties/PegaRULES’) cmo.createProperty(‘databaseName’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDriverParams/PegaRULES/Properties/PegaRULES/Properties/databaseName’) cmo.setValue(‘prpc612’) cd(‘/JDBCSystemResources/PegaRULES/JDBCResource/PegaRULES/JDBCDataSourceParams/PegaRULES’) cmo.setGlobalTransactionsProtocol(‘OnePhaseCommit’) cd(‘/SystemResources/PegaRULES’) set(‘Targets’,jarray.array([ObjectName(‘com.bea:Name=AdminServer,Type=Server’)], ObjectName)) activate() dumpStack() exit()

Continue reading »

A short Article on CMO’s — WLST variables

WLST, CMO’s and Built-in Variables CMO is the WLST in built variable. These are like our JAVA keywords having a dedicated meaning and functionality. CMO stands for Current Management Object. While programming in WLST we can use cmo to point the current MBean (object) instance you are navigating into. The

Continue reading »