Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Automate resource configuration on WebLogic Server

Resource configuration using WLST and Ant on WebLogic Server

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Every deployable J2EE component must be specifically configured on the application server to function. For WebLogic Server, developers generally complete this configuration manually by using the console, by using WebLogic Ant tasks wlconfig and wldeploy, or by using the command line tool weblogic.deployer. The Ant tasks and the command line tools need much environment-specific information for correct configuration, and WebLogic 9.0 recommends limited use of these tools.

Applications don't have a uniform way for maintaining and communicating configuration information to application deployers, which can result in custom scripts or manual configuration. As custom scripts are difficult to maintain and manual configuration may lead to errors, achieving a smooth propagation and release mechanism for J2EE artifacts proves difficult. This complexity increases when the application must be deployed on multiple environments (development, test, and production) as it is difficult to achieve complete environment independence. Also, when the information is not maintained uniformly across applications, changing application targets on the fly becomes tedious. Hence, every application should consistently maintain its configuration information in a way that is environment-independent. In addition, a tool that can automatically read and perform configuration on the required servers—which should be part of application deployment—would add convenience. Such a tool can also be leveraged to enforce standards and guidelines.

This article provides a sample format in which configuration information should be maintained by the application. It also provides tools in the form of Ant tasks that can read the configuration and deploy it on WebLogic Server. The code samples featured with this article have been compiled and tested on J2SE 1.4.2_03 and WebLogic 8.1., and are valid for WebLogic 7.0, 8.1, and 9.0.

Types of WebLogic Server configuration

J2EE applications generally use connection pools, datasources, Java Message Service (JMS) stores (file store or Java Database Connectivity store), JMS servers, JMS destinations (queues and topics), and distributed JMS destinations. Some of these resources are created on the domain level. Sometimes applications share configuration, sometimes not. The shared configuration should not be deleted when the application is undeployed. This article's sample Ant task and configuration take care to ensure that shared configuration is not deleted. They also do not overwrite the configuration that already exists.

Resource configuration and WLST

WebLogic creates management beans (MBeans) for every configuration. It uses Java Management Extensions (JMX) to manage and manipulate the MBeans. So, for every configuration, an MBean must be created and deployed. The parameters required for creating the MBean are its name, type, and a set of attributes.

WLST (WebLogic Scripting Tool) is a scripting tool that allows its users to access and manipulate MBeans similar to how they would navigate files on a filesystem. It is a scripting interface that developers can use to configure and interact with WebLogic Server. WLST, which has been incorporated with WebLogic 9.0, can work online as well as offline. When working online, WLST can work in three modes:

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Archived Discussions (Read only)
Subject
. Forum migration complete By AthenAdministrator
. Forum migration update By AthenAdministrator
. fBAfbisMzPmwkMOSdH By pexzouep
. MlhcxHcnrTRtwO By lrrrfily
. Chenaanah By Chenaanah
. Eutychus By Eutychus
. Shinab By Shinab
. Apphia By Apphia
. Achmetha By Achmetha
. Rissah By Rissah
. DtYhDuoIBVMxdzC By pjxfxoyt
. lJibCydabMiw By dgaaxbr
. Hezekiah By Hezekiah
. Bozez By Bozez
. Nana By Nana
Resources