Monday, August 19, 2013

Issues while executiing the WLST script to customize the OSB

You may be receiving some of the below issues while executing the WLST script to customize the OSB projects.

ImportError: no module named wli: Make sure $OSBHOME/lib/sb-kernel-api.jar is added into the CLASSPATH.

ImportError: no module named customization: Make sure $OSBHOME/modules /com.bea.common.configfwk_1.5.0.0.jar added into the CLASSPATH.

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Make sure $OSBHOME/lib/sb-kernel-impl.jar added into the CLASSPATH.

 CLASSPATH=$CLASSPATH:$OSBHOME/modules/com.bea.common.configfwk_1.5.0.0.jar:$OSBHOME/lib/sb-kernel-api.jar:$OSBHOME/lib/sb-kernel-impl.jar;export CLASSPATH

Customizing the OSB Service through WLST script

This post will explain how to Customize the OSB Service through WLST script

The below WLST script will help us to run the OSB customization file.

import sys
from import FileInputStream
from com.bea.wli.config.customization import Customization
from import ALSBImportOperation
from import ALSBConfigurationMBean
from import SessionManagementMBean

def customizeOSBService(customizationFile):
    SessionMBean = None
        connect('weblogic', 'welcome1', 't3://localhost:8000')
        sessionName = String("Customization"+Long(System.currentTimeMillis()).toString())
        SessionMBean = findService("SessionManagement", "")
        OSBConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "")
        print 'Loading customization File', customizationFile
        iStream = FileInputStream(customizationFile)
        customizationList = Customization.fromXML(iStream)       
        SessionMBean.activateSession(sessionName, "Complete customization using wlst")

        print "Unexpected error:", sys.exc_info()[0]
        if SessionMBean != None:

def main():
        print 'Successfully Completed customization'   

Customization File:

Customization file will help us to modify the environment specific values for a OSB project.
The previous post can be referred for more details on customization file.

Modify the  environment specific values in the customization file.

Running the Script:
Login to the server and copy the wlst script and the Customization file to some location.
Execute the below two commands

CLASSPATH=$CLASSPATH:$OSBHOME/modules/com.bea.common.configfwk_1.5.0.0.jar:$OSBHOME/lib/sb-kernel-api.jar:$OSBHOME/lib/sb-kernel-impl.jar;export CLASSPATH /home/eaiapp/Albin/OSBCustomization.wlst

Before executing the first command change the com.bea.common.configfwk_1.5.0.0.jar file version according to your environment.

After successful execution verify the service from OSB Console

  DOWNLOAD OSBCustomization.wlst

Saturday, August 17, 2013

OSB Service customization through console

This post will explain how to perform OSB customization through console

OSB customization will help us to change the environment specific properties for OSB resources.
There are multiple options to customize the OSB resources.

 Find & Replace:

Find And Replace option help us to find and replace the environment specific values. For example replacing the service URI of the service.
Login to OSB console (http ://<< host name>> :<< port>>/sbconsole) and Create the session
Click on System Administration and Find & Replace under Customization

Enter the find value also provide Find in variable type, Located in project if required and click on Find button. This will display the find results in the bottom.

Enter the value to be replaced and click on Replace All.

Activate the session and verify the service for the replaced value

Customization File:

Customization file will help us to change the environment properties of a multiple resources at the same time.
Creation of customization file – Click on system Administration and Create Customization File under customization.
Select the projects to which the customization file need to be generated (if we select all the projects the same customization file will have the configuration for all the projects) and click on Create File.

The generated Customization file will have the environment properties configuration for the selected projects.

Modify the Customization file properties according to the environment.
Execution of Customization File
Login to OSB console and create a session.
Click on System Administration and Execute Customization File under Customization
Browse the Customization file from the local and Click On Next

Click on Execute button and Activate the session after successful Execution.
Verify the changes applied for the projects.

Contact Form


Email *

Message *