Creating Weblogic Domain in console and wlst

Oracle Weblogic Server

Learning: Here we will learn creating weblogic domain in console mode and using the WLST tool.

Console-based domain creation

On *nix-like systems, there is usually no graphical environment available. You can solve this by exporting the GUI to your local desktop, with an XClient, such as XVNC or XMing, but if you don’t do it or you give the option mode=console, you get a text-based representation of your GUI installation.

./config.sh mode=console

The output will be:
< ---------------------------------------------------- BEA WebLogic
Configuration Wizard ------------------------------------------------
---->
Welcome: --------
Choose between creating and extending a domain. Based on your
selection, the Configuration Wizard guides you through the steps to
generate a new or extend an existing domain.
1|Create a new WebLogic domain
| Create a WebLogic domain in your projects directory.
2|Extend an existing WebLogic domain
| Extend an existing WebLogic domain. Use this option to add
applications and services, or to override existing database access
|(JDBC) and messaging (JMS) settings. You can also incorporate
additional functionality in your domain, for example, by including
|AquaLogic Service Bus.
Enter index number to select OR [Exit][Next]> 1
< ---------------- BEA WebLogic Configuration Wizard ---------------->
Select Domain Source:
---------------------
Select the source from which the domain will be created. You can
create the domain by selecting from the required components or by
selecting from a list of existing domain templates.
1|Choose Weblogic Platform components
| You can choose the Weblogic component(s) that you want supported
in your domain.
2|Choose custom template
| Choose this option if you want to use an existing template. This
could be a custom created template using the Template Builder.
Enter index number to select OR [Exit][Previous][Next]> 1
< ---------------- BEA WebLogic Configuration Wizard ---------------->
Application Template Selection:
-------------------------------
Available Templates
|_____WebLogic Server (Required)x

Enter number exactly as it appears in brackets to toggle selection OR
[Exit][Previous][Next]> 1
< ---------------- BEA WebLogic Configuration Wizard ---------------->
Application Template Selection:
-------------------------------
Available Templates
|_____WebLogic Server (Required)x
** Invalid input, not selectable
Enter number exactly as it appears in brackets to toggle selection OR
[Exit][Previous][Next]>
…--> and so on.

The remaining procedure will be exactly the same as with the GUI steps.

Domain creation with the WebLogic Scripting Tool (WLST)

WLST is a scripting language which is based on the Python programming language.
Because the WebLogic Domain software is JAVA-based, you will need the JAVA
implementation of Python, which is called Jython. In fact this is where WLST does
its work.

The following script is a very simple WLST script to create a WebLogic domain:

#================================================================
# Create a domain from the weblogic domain template.
#=================================================================
readTemplate('/u01/app/oracle/product/Middleware/common/templates/
domains/wls.jar')
cd('Servers/AdminServer')
#=================================================================
# Configure the Administration Server
#=================================================================
set('ListenAddress',''WLADMINIP'')
set('ListenPort', 9913)

#=================================================================
# Define the password for user weblogic. You must define the password
before you
# can write the domain.
#=================================================================
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword(AdminServerPassword)
# - OverwriteDomain:Overwrites domain when saving
setOption('OverwriteDomain', 'true')
#=============================================================
# Write the domain, close the domain template and exit from the WLST
#===============================================================
writeDomain('/u01/app/oracle/product/Middleware/user_projects/
domains/wlsdom')
closeTemplate()
exit()

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.