Fixing Silent Domain Builds with WebCenter Portal

Automating domain creation is important for enterprises to minimize maintenance cost and be prepared for efficient disaster recovery. One enterprise I worked with was struggling with the domains they were building through scripts as the Enterprise Manager was not working properly in the completed domains and the managed servers would come up in Admin mode.

After comparing the scripted domain to a manually created domain that worked correctly it was found that the paths for the libraries did not match. The paths in config.xml were missing the beginning of the path where the libraries were actually located. While the installation paths chosen were not the default paths, this did not entirely explain the issue, and internal processes made the custom paths highly desirable.

The correction for this issue was to add a function to the offline WLST script run on completion of the domain creation to correct the library paths:

def fixApplicationSourcePaths():
  appPathPrefix = os.getenv('DOMAIN_HOME')+'/applications/'
  cd('/AppDeployments/')
  deployed_apps = ls(returnMap='true')
  for app in deployed_apps:
    cd('/AppDeployments/'+app)
    apppath = get('SourcePath')
    if apppath.find('/app/')!=0:
      apppath = apppath.split('/')
      apppath = apppath[-1]
      set('SourcePath',appPathPrefix+apppath)
  cd('/Libraries/')
  deployed_libs = ls(returnMap='true')
  for lib in deployed_libs:
    cd('/Libraries/'+lib)
    apppath = get('SourcePath')
    if apppath.find('/app/')!=0:
      set('SourcePath',appPathPrefix+apppath)

With this change, domains were created consistently as desired.

Facebooktwitterredditlinkedinmail
© Scott S. Nelson

2 thoughts on “Fixing Silent Domain Builds with WebCenter Portal

  1. nikf January 12, 2015 / 8:07 am

    Hello

    Are you able to share a complete (sanitised) script?

    Regards

    Nik

    • Scott Nelson Scott Nelson January 12, 2015 / 11:21 am

      The complete script requires a template that is enterprise/application specific.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.