Technical

Deploying to OSB

So far we’ve seen the basics of WLST and created an OSB domain. The final step is to deploy an application using WLST. Normally in WLST you use the deployApplication method, but for OSB we have to do a little bit more.

The full code is up at GitHub: https://github.com/Joelith/wlst/blob/master/OSB/osb_deploy.py

The contents of this post were be discussed at the Oracle Middleware Forum in Canberra. These are hosted every month and are a great opportunity to skill up in middleware and to meet fellow middleware-enthusiasts in Canberra.

Continue reading

Advertisements
Technical

Starting servers with WLST

Starting a server

You can start a server in WLST using the startServer() command, but it’s recommended to use the NodeManager to start and stop servers. This is mainly because the NodeManager can manage servers on multiple machines at once, whereas the startServer() can only work on local servers. The process to start a server is:

startNodeManager(NodeManagerHome='/oracle/product/middleware/wlserver_10.3/common/nodemanager')
nmConnect('weblogic', 'welcome1', 'localhost', 5556, 'osb_domain', '/oracle/config/domains/osb_domain', 'plain')
nmStart('AdminServer')

Continue reading

Technical

Creating an OSB domain using WLST

One of the main use cases of WLST is to automate the creation of your domains. Using WLST you can add all the configuration you need for your domain and ensure that it will be created exactly the same each time you build it (as opposed to relying on your infrastructure team member to remember to configure everything through the weblogic console). Also, you can add your WLST script into your version control repository to ensure that all changes are tracked and that everyone can always have the most up-to-date configuration.

To give you an idea of how to create a domain in WLST let’s create a simple OSB domain. We’ve created a script ‘osb_domain.py’ that will create the domain and configure the JDBC data sources (among other things). This will create a fully working OSB domain for us to work with. In our next post we will create a WLST script to start up this domain, but for the time being we can start it the old fashioned way (./startWebLogic.sh)

The full code is up at GitHub: https://github.com/Joelith/wlst/blob/master/OSB/osb_domain.py

The contents of this post will be discussed at the upcoming Oracle Middleware Forum in Canberra. Why not come along and pick up some more WLST tips?

Continue reading

Technical

Sublime WLST Syntax Highlighting

To make life easier when writing WLST scripts you should use a text editor that has syntax highlighting and auto-complete support for the WLST language. My favourite text editor is Sublime Text, but WLST is not one of the language it supports out of the box. So I’ve created a plugin that adds WLST support into Sublime. To install:

  1. Install Package Control (Instructions here: https://sublime.wbond.net/installation)
  2. Activate your Command Palette and choose “Package Control: Install Package”
  3. Search for WLST and install the package from me (Joelith)
  4. Once you’ve done that you can select ‘WLST’ from the language selection drop down.

This will add syntax-highlighting auto-complete for most of the WLST commands. The auto-complete will also show mandatory parameters for commands that require them (useful when you forget the order of params). It’s still a work in progress, but any changes I make will be uploaded to https://github.com/Joelith/sublime-wlst/. Package Control will update your plugin automatically so you don’t need to do anything. If you notice any issues with the plugin just post on GitHub and I’ll fix it.

Technical

WLST 101

WebLogic Scripting Tool (WLST) is the scripting tool for administering WebLogic domains. Based on Jython (a Java implementation of the Python programming language) it allows users to automate repetitive tasks when building and maintaining their WebLogic deployments. Instead of having to install the domain manually, remembering all the configuration items you need to modify on the console and starting and restarting the servers you can automate this through the use of WLST scripts.

The contents of this post will be discussed at the Canberra Oracle Middleware Forum event. Come along to learn about this topic and others every month.

Continue reading