Search This Blog

Sunday, September 28, 2014

WebLogic 12c new features in WLST

WLST Change in 12c domain template path

When you create a new Domain with default domain template wls.jar it is moved from 
$WL_HOME/common/templates/domain/wls.jar 
to
$WL_HOME/common/templates/wls/wls.jar 
Notify this and update your old scripts with this new template path

WLST Security Stronger

WebLogic 11g or previous versions allows password with any number of lines, but now in WebLogic 12c it has changed. You need to change the password to at obey the minimum 8 alphanumerics with atleast a number or any symbol. Example you can have like 'Welcome1'
If you directly executing your WebLogic 10 WLST offline scripts you might encounter following error:
60455: The password must be at least 8 alphanumeric characters with at least one number or special character.
60455: Correct the password.

JLine associated with WLST 12c version

While working on Martin book we have found that Linux/Unix environments don't have feature like in Windows - WLST shell had. To enable that Martin suggested Apache JLine 0.9 need to installed and keep in the path. but now in WebLogic 12c (12.1.3) version it is buit-in.


  • You can use up arrow and down arrow for navigating to previous WLST commands
  • There would be separate history hidden file created .jline-WLST.history in the home directory, it is similar to .bash_history 
[wladmin@srv2 ~]$ cat .jline-WLST.history
exit
execfile('createDomain.py')
exit
exit()
print os.pathsep
help('nmConnect')
nmConnect('weblogic','welcome1','183.82.51.72','5556','sivaDomain','/home/wladmin/wldomain/sivaDomain','plain')
nmConnect('weblogic','welcome1','183.82.51.72','5556','sivaDomain','/home/wladmin/wldomains/sivaDomain','plain')
nm()
nmKill('managed3')
help(nmKill)
help('nmKill')
nmKill('managed3')
nmStart('managed3')
nmDisconnect()

This has been tested and executed on RHEL environment.

What if we don't have 12c latest version?

You can download jLine from sorceforge.net site and include the library path into your CLASSPATH then run your WLST. RefLink: JLine sourceforge.net

Related Posts

Saturday, August 2, 2014

Create Managed Server using WLST Automation

This post is intended for those who just started working on WLST for configuration of WebLogic domain. Here I have a sample WLST script that creates a Managed server. You have two choices to configure managed server: offline and online mode. Here we have online configuration script. Here the first trail with the direct connection parameter passing. I have tried it on my Oracle VirtualBox running WebLogic 12.1.2. I know this is bad coding style that is using hardcoding the values in the script.

Better you might try with properties file that can be updated frequently for your domains.
def createMS(name, listenadr, port):
        connect('weblogic', 'welcome1', 't3://192.168.1.106:9100')
        edit()
        startEdit()
        cd('/')
        cmo.createServer(name)
        cd('/Servers/' + name)
        cmo.setListenAddress(listenadr)
        cmo.setListenPort(port)
        activate()

#=========MAIN PROGRAM =========================
name=raw_input('Please enter managed server:')
listenip=raw_input('please enter listenip:')
port=int(input('please enter port:'))
createMS(name, listenip, port)

Script best practices says all the domain parameters must be generic and develop using propertice file.
try it yourself :)

The output of the above script
pavanbsd@ubuntu:~/pybin$ wlst createms.py

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Please enter managed server:BAms2
please enter listenip:192.168.1.106
please enter port:9102
Connecting to t3://192.168.1.106:9100 with userid weblogic ...
Successfully connected to Admin Server "BA_admin" that belongs to domain "BAdomain".

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.

Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().

For more help, use help('edit')
You already have an edit session in progress and hence WLST will
continue with your edit session.

Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed


Write your feedback in the comment box. Thank you for visit this article.

Popular Posts