Monday, 22 February 2010

ADF automated deployment: Hudson and WLST

As I told in my previous post on Hudson I had the wish/idea to extend my Hudson build script in a way that it would fully automate the deployment of the ear file to a WebLogic server.

So I gave it a try…

With the help of a blog post of Jay senSharma it actually was quite an easy job.

Step 1:
I copied the MIDDLEWARE_HOME\wlserver_10.3\server\bin\setWLSEnv.cmd to C:\Hudson_Slave_Node\workspace, and renamed it to deployWLS.cmd

Step 2
I created a python script file called and added it to the same directory.

This is the content of the python file
startApplication(' dummy_application1')

Step 3:
I changed the bottom of deployWLS.cmd to look like:

@echo Your environment has been set.

@echo Deploy to WLS
java weblogic.WLST C:\Hudson_Slave_Node\workspace\
@echo Deploy to WLS Finished


Step 4:
I added a new ‘Windows batch command’ Build step in Hudson that executes the deployWLS.cmd file.

Step 5:
Grab a pint of (Belgium) Beer, sit down, relax and see how the job is now done for you... :-)


If you receive the following error:

at weblogic.jdbc.module.JDBCModule.prepare(
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare
Caused by: weblogic.common.ResourceException: weblogic.common.ResourceException: weblogic.common.ResourceException: No credential mapper entry found for password indirection user=cm for data source CM
at weblogic.jdbc.common.internal.DataSourceConnectionPoolConfig.getPoolProperties(
at weblogic.jdbc.module.JDBCModule.prepare(

You have to adjust your application properties in a way that they‘ll not include the weblogic-jdbc.xml. It’s not possible to automatically deploy your ear file with this option. So uncheck this option and add a DataSource with the correct JNDI name via the WLS console.

Jaysensharma's Blog
Forum: WebLogic Server - Upgrade / Install / Environment / Migration
Thread: WLST to deploy ear file
Using the WebLogic Scripting Tool
WLST Command and Variable Reference