Gerald Nunn's Blog
« Federated versus Local Portal Development | Main | WebLogic Portal and JSF »WLST and Templates Glitch
Wednesday, March 18, 2009
The WebLogic Scripting Tool (WLST) is a great tool for creating pre-configured domains quickly and easily. The tool allows you to define a script in Python that automates the creation of the domain by working with the object model defined in WebLogic. For those unfamiliar with WLST, a great summary can be found here.
Recently I was working with a client to automate the creation of their domains and ran across two issues as follows:
- The username and password for node manager was not taking after it was changed, it was always using the default generated username/password when it was written; and
- A JMS subdeployment could not be targetted to a JMS Server, it always defaulted to the target of the JMS Resource the subdeployment belonged to.
After investigating both issues, it turned out that these operations were getting overwritten by the defaults in the template JAR when the domain was being written. When the code was debugged it was evident that things had been set correctly, however when the domain was written these changes were ignored. The issue was that the directives in the template were overriding what was being done in WLST code. While annoying, an easy workaround exists. All that needed to be changed was to move these operations after the write operation, at this point they could be performed successfully. Here is an example with some pseudo-code:
readTemplate(path) #Update domain config settings #... writeDomain(workingDirectory) closeTemplate() readDomain(workingDirectory) #Perform tasks here that only work if done after domain is written #... #Write new changes back out again updateDomain(workingDirectory)
A small issue with an easy fix, just one thing to keep in mind when working with WLST.
Posted by Gerald Nunn at 3:42 PM | Categories: WebLogic | Permalink
