You can create WLST script using WLST recording.
Check this video for this
Happy Weblogic learning with Vinay Kumar in techartifact….
Latest tip and information on Java and Oracle Fusion Middleware/Weblogic
You can create WLST script using WLST recording.
Check this video for this
Happy Weblogic learning with Vinay Kumar in techartifact….
Requirement – Reset your weblogic admin console password
Solutions –
You can reset your pwd from the command line using the following process
-> Set up the following environment variables. They are not necessary for the process itself, but will help you navigate. In this case my domain is called “ClassicDomain”. Remember to change the value to match your domain.
->Shut down the WebLogic admin server.
->$MW_HOME/user_projects/domains/base_domain/bin/ stopWebLogic.sh
->Rename the data folder.
$ mv $DOMAIN_HOME/servers/AdminServer/data $DOMAIN_HOME/servers/AdminServer/data-bakup
$ $DOMAIN_HOME/bin/setDomainEnv.sh
$ cd $DOMAIN_HOME/security $ java weblogic.security.utils.AdminAccount <username> <password> .
you can also get java no class def found error.then weblogic.jar is not set in the classpath.Try to set weblogic.jar in classpath
username=<username> password=<password>
$ $DOMAIN_HOME/bin/startWebLogic.sh
Happy Weblogic Learning with Vinay Kumar
Requirement – How to create and delete managed server by wlst script in weblogic
Solutions –
As we can use wlst recording feature to generate the script.I have modified a script a little bit
Following script to create a managed server with assigning port and machine.
MakeServer.py
name=sys.argv[1] port=int(sys.argv[2]) machine=sys.argv[3] connect('weblogic', 'welcome1', 't3://192.168.0.123:7001') edit() startEdit() cd('/') cmo.createServer(name) cd('/Servers/' + name) cmo.setListenAddress("") cmo.setListenPort(port) activate() startEdit() cmo.setListenPortEnabled(true) cmo.setJavaCompiler('javac') cmo.setClientCertProxyEnabled(false) cmo.setMachine(getMBean('/Machines/' + machine)) cmo.setCluster(None) cd('/Servers/' + name + '/SSL/' + name) cmo.setEnabled(false) cd('/Servers/NewManagedServer/DataSource/NewManagedServer') cmo.setRmiJDBCSecurity(None) activate()
->Open terminal and go to
$MWHOME/wlserver_10.3/server/bin
-> . ./setWLSEnv.sh
-> open new terminal
-> go to $MWHOME/user_project/domains/ucm_domains/bin
-> execute . ./setDomainEnv.sh
:-Note it is like dot space dot/setDomainEnv.sh
Call this script as
java weblogic.WLST /u01/app/oracle/Oracle/middleware/wlserver_10.3/server/bin/MakeServer.py "servername" "portNumber" "MachineName"
___________________________________________________________________________________________________________-
Following script to delete server
DeleteServer.py
name=sys.argv[1] connect('weblogic', 'welcome1', 't3://192.168.0.123:7001') edit() startEdit() cd('/') cd('/Servers/' + name) cmo.setCluster(None) cmo.setMachine(None) editService.getConfigurationManager().removeReferencesToBean(getMBean('/Servers/' + name)) cd('/') cmo.destroyServer(getMBean('/Servers/' + name)) activate()
->Open terminal and go to
$MWHOME/wlserver_10.3/server/bin
-> . ./setWLSEnv.sh
-> open new terminal
-> go to $MWHOME/user_project/domains/ucm_domains/bin
-> execute . ./setDomainEnv.sh
:-Note it is like dot space dot/setDomainEnv.sh
Call this script as
java weblogic.WLST /u01/app/oracle/Oracle/middleware/wlserver_10.3/server/bin/DeleteServer.py "servername"
See the video here
happy learning Weblogic with Vinay kumar in techartifact…..