Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Creating WebLogic Domains in Silent Mode

The benefits of scripted domain configurations

An enterprise development project deploying to the WebLogic platform needs to maintain several different domain configurations during the project's development, test, and deployment phases.

Version control and continuous rollout of ever-changing domain configurations to the different environments can be a challenging task. The Domain Configuration Wizard can help alleviate these challenges, because there is more to this Wizard than immediately meets the eye.

The WebLogic domain has grown from a non-existent concept in WebLogic 5.1 to become the foundation of all enterprise applications running on the latest version of the WebLogic Platform. A domain defines vital parts of an application's runtime environment, such as deciding on whether or not the application will run in a cluster, and which physical databases the application will use through the connection pool definitions.

The domain concept appeared in WebLogic Server 6.0. There wasn't much help from the platform itself when it came to creating new domains. The suggested way of doing it was to make a copy of the default domain that came with the installation, start the server in the copied domain, and use the Administration Console to add changes to it. The first version of the Domain Configuration Wizard was introduced in WebLogic Server 7.0. This version of the wizard did not have support for either WebLogic Integration or WebLogic Portal domains. In the latest version of WebLogic there are numerous ways of creating a domain using various tools in the WebLogic installation: you can use the Domain Configuration Wizard, the WebLogic.Server command, or Ant scripts with the wlserver and wlconfig Ant tasks. This shows that BEA has taken the message from the developers seriously: help us make it easier to create WebLogic domains! In this article we will take a closer look at the Domain Configuration Wizard, focusing on how to use the least documented (until now) of its three running modes, the Silent mode. (In addition, as you probably know, it can be run in GUI mode and Console mode.)

The Domain Configuration Wizard has matured, and now covers the complete range of domains by default. The GUI mode is relatively easy to use, even if you have to be prepared to go through a lot of screens to configure, say, a clustered portal domain with a couple of connection pools and some JMS destinations. We feel that the main challenge with this approach in an enterprise project is maintaining several changing domain configurations for parallel environments like development, test, and production. On top of this, developers normally have their own local servers with local database settings and local JMS destinations. For all but the very smallest projects, we cannot base these domain configurations on manual creation through the Domain Configuration Wizard. We need to be able to repeatedly create our domains from scratch in a consistent way on various deployment targets. We also want to be able to put our various domain configurations under source control. Domain Configuration Wizard's Silent Mode gives us the opportunity to do just that through domain configuration scripting.

The Domain Configuration Wizard is located below WL_HOME/common/bin, where WL_HOME is BEA_HOME/weblogic81. Start it by running the config.cmd. To run it in Silent Mode, you set the mode parameter to silent, and tell it where to find your silent configuration script.

On Windows:


config.cmd ?mode=silent ?silent_script=<silent script file>

On Unix/Linux:


./config.sh ?mode=silent ?silent_script=<silent script file>

It all happens inside the silent script file. This script file contains the complete domain configuration. The language used in this file is fairly simple to understand, even if it is proprietary. It is well documented in BEA edocs.

The default installation comes with an example silent script located in WL_HOME/common/templates/domains/silent_scripts". We'll now go through this example step by step.

A WebLogic domain can be one of five different domain types, accessible through domain templates. The first thing to do is to decide on the type of domain by choosing what domain template file we want to use. The domain template files are located in the "WL_HOME/common/templates/domains/" directory. The different domain templates are:

  • Workshop domain (wlw.jar)
  • Integration domain (wli.jar)
  • Portal domain (wlp.jar)
  • Server domain (wls.jar)
  • WebLogic Platform domain (platform.jar).
The domain template files are included in the installation of BEA WebLogic Platform 8.1. For this example we chose a WebLogic Server domain; hence wls.jar is the template file. We now read in all the data that is included in the default server domain.


//Read in a domain template.
read template from "WL_HOME/weblogic81/common/templates/domains/wls.jar";

The default server domain has configured an admin server called "myserver". We now set the address, the port, and SSL.


//Find and configure the Admin Server.
find Server "myserver" as s1;
set s1.ListenAddress "localhost";
set s1.ListenPort "7001";
set s1.SSL.Enabled "true";
set s1.SSL.ListenPort "7002";

We want to create a JMSQueue in the domain. Fist we create a JMSServer, then we create the JMSQueue and set the properties for this queue. Finally, we target the JMSServer to the "myserver" that is the default server in the "wls.jar" template file.


//Create a JMSQueue.
//A JMSServer has to be created first.
create JMSServer "myJMSServer" as jmsserver;
create JMSQueue "myJMSQueue" as myq;
//required attribute
set myq.JNDIName "jms/myjmsqueue";
//required attribute
set myq.JMSServer "myJMSServer";
//optional attribute
//set myq.StoreEnabled "false";
//target "myJMSServer" to server "myserver"
assign JMSServer "myJMSServer" to target "myserver";

We want to create a connection pool in the WebLogic Server domain. In the example we use the PointBase database thet follows the BEA Weblogic Platform 8.1 installation. The connection pool is created and targeted to "myserver".


//Create a JDBCConnectionPool.
create JDBCConnectionPool "demoPool" as mypool;
//required attribute
set mypool.DriverName "com.pointbase.jdbc.jdbcUniversalDriver";
//required attribute
set mypool.URL "jdbc:pointbase:server://localhost:9092/demo";
//required attribute
set mypool.Password "PBPUBLIC";
//optional attribute (but it's recommended you set the db user...)
set mypool.Properties "user=PBPUBLIC";
//target all JDBC connection pools to server "myserver"
assign JDBCConnectionPool "*" to target "myserver";

It is possible to target applications to the server during configuration of the domain. The "wls.jar" template does not contain any application and hence this code is commented out:


//target existing applications.
//target applications only when they exist in current domain template
//assign application "*" to target "myserver";

We now want to change the password for the webloic user. We find the user and then sets the password.
//Create the admin user and password.
find User "weblogic" as u1;
set u1.password "weblogic";

Now we'll write the domain to disk. The domain is written to the specified path. The last folder in the path is the name of the domain. The domain name is wls.


//Write out the domain.
set OverwriteDomain "true";

Write the domain to "C:\bea/user_projects/domains/wls";

At last we close the template file.


//Close domain template to indicate completion of work.
close template;

In Listing 3 we have added a more complex example. Here we create a cluster with an admin server and two managed servers in a WebLogic Platform domain. The database used is an Oracle 9i database.

To be able to easily handle different domain configurations, we have replaced the script file's values with tokens. We use an Ant script to build the domain and replace the tokens with actual properties. Extracting the domain configuration file's values into property files makes it simple to handle different domain configurations, and they can easily be put under source control. The property file for the Ant script is referenced in the top of the Ant build file; in this example the name of the property file is "domain.properties". The property file must be modified to fit the chosen environment with properties for domain name, domains folder, portal database attributes such as URL, username, pass, etc., and all server attributes such as server URL, port, SSL-port etc.

The domain is now easily created by running the "build.domain" target in the Ant build file. Because of dependencies in the Ant build file, the following targets are called in sequence:

  1. "init" target: Creates the temporary build folder
  2. "copy" target: Copies the original silent script file into the temporary build folder
  3. "replace.silentfile" target: Replaces all the tokens in the silent script file with the value given in the "domain.properties" file
  4. "build.domain" target: Calls the Configuration Wizard Program (config.cmd) with the newly created silent script file as parameter
  5. "clean" target: Removes all the temporary files and folders
The domain is now created in the path and the name specified in the "domain.properties" file and ready to use. The Ant script and an example property file are shown in Listings 2 and 4.

Conclusion
The domain concept has become a vital part of the BEA WebLogic Platform, defining the applications' runtime environment. In projects with repeated deployments to various targets, it is important to be able to create and recreate the WebLogic domains in an effective and consistent way. It is also important to have these domain configurations under source control. Domain Configuration Wizard's Silent Mode achieves this by providing support for scripting of the domain configuration. This article described the benefits of using scripted domain configurations, and how to use the Silent Mode through an explanation of a scripted domain configuration. It also showed how to extract the Silent Mode script's values into a property file and how to use an Ant script to control the domain creation. We used Silent Mode on several projects and believe this is a good way to effectively and consistently create WebLogic domains.

References

  • BEA eDocs: http://edocs.bea.com
  • More Stories By Marius Larsen

    Marius Larsen is a senior consultant at Capgemini Norway, developing and configuring applications on the BEA WebLogic Platform and consulting with customers on architectural decisions within J2EE applications. He has been working with the BEA WebLogic Platform for several years.

    More Stories By Vidar Moe

    Vidar has many years of experience with software development projects at Norway's largest clients. His main interests are software quality, agile methodologies and architecture. He has been working with enterprise Java architectures since 2000, especially on the Oracle / BEA WebLogic platform. His experience is that honesty and open communication are the most important success factors in a development project. This is reflected in the way he works, both inwards and outwards in his projects. Vidar is a Sun certified Java architect. He works as architect, Scrum master, developer and coach in his projects. He likes working with agile methodologies, always working towards more effective software development.

    Comments (2) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    Mrinal 09/29/06 06:35:16 AM EDT

    Or just read from the authors:
    http://edocs.bea.com/platform/docs81/confgwiz/silent.html

    Valerie Pressley 09/13/05 05:24:19 PM EDT

    Where is listing 3?

    @ThingsExpo Stories
    SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
    Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
    SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
    SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
    SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
    SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
    SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
    SYS-CON Events announced today that TidalScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale is the leading provider of Software-Defined Servers that bring flexibility to modern data centers by right-sizing servers on the fly to fit any data set or workload. TidalScale’s award-winning inverse hypervisor technology combines multiple commodity servers (including their ass...
    Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    As popularity of the smart home is growing and continues to go mainstream, technological factors play a greater role. The IoT protocol houses the interoperability battery consumption, security, and configuration of a smart home device, and it can be difficult for companies to choose the right kind for their product. For both DIY and professionally installed smart homes, developers need to consider each of these elements for their product to be successful in the market and current smart homes.
    Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
    With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
    SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
    Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
    Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
    In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
    SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...