Pages

Thursday, August 7, 2014

Create with WLST a SOA Suite, Service Bus 12.1.3 Domain

When you want to create a 12.1.3 SOA Suite, Service Bus Domain, you have to use the WebLogic config.sh utility.  The 12.1.3 config utility is a big improvement when you compare this to WebLogic 11g. With this I can create some complex cluster configuration without any after configuration.
But if you want to automate the domain creation and use it in your own (provisioning) tool/script then you can use the following scripts to create a normal SOA Suite, Service Bus domain together with BPM, BAM & the Enterprise scheduler options.

Off course!!! use this script only for development, do some intensive testing on this domain and don't use this script in production or acceptance ( use the supported config.sh utility).

The second part of this blog we will create a cluster configuration with a WLST offline script.

Before we can start we need to have a FMW database repository.  You can use the RCU utility ( MDW_HOME/oracle_common/bin/rcu) to create one.

Enable the following options



Here you can also see the improvements in the 12c FMW domain creation like

  • ServerGroups, an easy way of assigning libraries,  applications and datasources to managed servers and clusters. It will auto-detect if a managed server is part of a cluster :-)
  • Service Table Datasource together with the getDatabaseDefaults() function, no need to change all the datasources. It will re-use the RCU configuration data.


Use this to start the creation of our domain.
MDW_HOME/oracle_common/common/bin/wlst.sh soa_domain_1213.py

Here we need to do some extra configuration like

  • Change a few datasources so they will use the Oracle XA driver

With this as output.



When you want to create a cluster configuration you can use the following script.



26 comments:

  1. Hi Edwin

    Thanks for your sharing, would you please share a WLST script to create an OSB12c domain only?

    ReplyDelete
    Replies
    1. Hi,

      it is almost the same, you still need to run RCU and remove the BAM, BPM,ESS and SOA Stuff.

      but here you already got a template which I use in puppet
      https://github.com/biemond/biemond-orawls/blob/master/templates/domains/domain_osb.py.erb

      thanks

      Delete
    2. thanks a lot
      I think RCU is for SOA suit, is it necessary for OSB?
      As I follow the linked code, I get an error when excuting "updateDomain"
      for "oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database."
      Could you help me with this?

      Delete
    3. All FMW 12.1.3 software needs a RCU for OPSS but OSB doesn't do much with this database. I think it only uses the reporting table in soa-infra

      Delete
    4. Edwin,

      Can you provide OSB domain script, the below provided URL is not working

      https://github.com/biemond/biemond-orawls/blob/master/templates/domains/domain_osb.py

      Delete
  2. after I simplify your code like this and run it:
    ---------------------------------------------------------------------------------------------

    domainDir='C:\\Oracle\\WebLogic_12.1.3\\user_projects\\domains\\apmaasOSBDomain'
    domainName='apmaasOSBDomain'
    #template=sys.argv[3]
    server='AdminServer'
    port=9001
    user='weblogic'
    password='welcome1'

    #WLHOME = '/opt/oracle/middleware12c/wlserver'

    DOMAIN = 'apmaasOSBDomain'
    DOMAIN_PATH = 'C:/Oracle/WebLogic_12.1.3/user_projects/domains/apmaasOSBDomain'
    APP_PATH = 'C:/Oracle/WebLogic_12.1.3/user_projects/applications/apmaasOSBDomain'

    SERVER_ADDRESS = ''
    #LOG_FOLDER = '/var/log/weblogic/'

    ADMIN_SERVER = 'AdminServer'
    user = 'weblogic'
    password = 'welcome1'

    JAVA_HOME = 'C:/btm/devsw/Java/jdk1.7.0_51'

    OSB_JAVA_ARGUMENTS = '-XX:PermSize=256m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m '

    print('Start...wls domain with template C:\\Oracle\\WebLogic_12.1.3\\wlserver\\common\\templates\\wls\\wls.jar')
    readTemplate('C:\\Oracle\\WebLogic_12.1.3\\wlserver\\common\\templates\\wls\\wls.jar')


    cd('/')

    cd('/Servers/AdminServer')
    # name of adminserver
    set('Name',ADMIN_SERVER )

    cd('/Servers/'+ADMIN_SERVER)

    # address and port
    set('ListenAddress',SERVER_ADDRESS)
    set('ListenPort' ,int(port))

    setOption( "AppDir", APP_PATH )

    create(ADMIN_SERVER,'ServerStart')
    cd('ServerStart/'+ADMIN_SERVER)
    set('JavaHome' , JAVA_HOME)

    print('Set password...')
    cd('/')
    cd('Security/base_domain/User/weblogic')

    # weblogic user name + password
    set('Name',user)
    cmo.setPassword(password)

    setOption('JavaHome', JAVA_HOME)

    print('write domain...')
    # write path + domain name
    writeDomain(DOMAIN_PATH)
    closeTemplate()

    es = encrypt(password,DOMAIN_PATH)

    readDomain(DOMAIN_PATH)

    print('set domain password...')
    cd('/SecurityConfiguration/'+DOMAIN)
    set('CredentialEncrypted',es)

    print('Set nodemanager password')
    set('NodeManagerUsername' ,user )
    set('NodeManagerPasswordEncrypted',es )

    cd('/')

    setOption( "AppDir", APP_PATH )

    print('Extend...osb domain with template /opt/oracle/middleware12c/osb/common/templates/wls/oracle.osb_template_12.1.3.jar')
    addTemplate('C:\\Oracle\\WebLogic_12.1.3\\oracle_common\\common\\templates\\wls\\oracle.wls-webservice-template_12.1.3.jar')
    addTemplate('C:\\Oracle\\WebLogic_12.1.3\\osb\\common\\templates\\wls\\oracle.osb_template_12.1.3.jar')

    dumpStack()

    print 'Change datasources'

    print 'end datasources'

    updateDomain()
    closeDomain();


    print('Exiting...')
    exit()
    -----------------------------------------------------------

    ReplyDelete
  3. Then comes the error:
    ------------------------------------
    Error: updateDomain() failed. Do dumpStack() to see details.
    Problem invoking WLST - Traceback (innermost last):
    File "C:\btm\dev\EMaaS\emcapms\scripts\wlst\createOSBDomain2.py", line 167, in ?
    File "C:\Users\lliyu\AppData\Local\Temp\WLSTOfflineIni1736872721093306179.py", line 103, in updateDomain

    Domain Location: C:\Oracle\WebLogic_12.1.3\user_projects\domains\apmaasOSBDomain

    Reason: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

    Exception:

    oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:56)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2279)
    at com.oracle.cie.domain.script.jython.WLScriptContext.updateDomain(WLScriptContext.java:827)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

    com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: Domain Extension Application Failed!

    Domain Location: C:\Oracle\WebLogic_12.1.3\user_projects\domains\apmaasOSBDomain

    Reason: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

    Exception:

    oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.
    ---------------------------------------------------
    Do you have any idea? Thank you!

    ReplyDelete
    Replies
    1. Hi,

      Can you please let me know how you resolved the issue. I am facing the same issue.

      Thanks
      Harish

      Delete
  4. Frank Vestergaard PedersenOctober 24, 2014 at 9:57 AM

    Hi Edwin

    Nice blog and nice sessions at OOW14 on continuous integration!

    I have a couple of questions about your wlst script.

    Why do you target these groups to the admin server:
    "WSM-CACHE-SVR" , "WSMPM-MAN-SVR" , "JRF-MAN-SVR"

    Why do you change repository datasources to XA

    Frank

    ReplyDelete
    Replies
    1. Thanks Frank,

      these server groups are required for the adminserver. it needs adf for EM etc and WSM for soa,osb

      Somehow the OUI also changes these datasources to XA but when I do it with WLST they don't have XA enabled.

      Thanks

      Delete
    2. Frank Vestergaard PedersenOctober 24, 2014 at 12:27 PM

      Thanks Edwin

      Ok, the OUI changed these datasources to XA, but I was wondering - when will the repository database connection be part of an distribute...!

      /Frank

      Delete
  5. Thanks for sharing the script. Would you please share a WLST script for installing BPM on existing domain

    ReplyDelete
  6. Thank you for this!

    Do you know what determines whether UDDs are created inside JMS modules instead of non-UDDs? When I configured a domain using OUI, it created UDDs in the JMS modules, but only single destinations (queues/topics vs uniform distributed queues/topics) were created when domain was created using scripts.

    ReplyDelete
    Replies
    1. I think OUI does some extra configuration after the domain creation. So it fixes all the problems

      But setting the server groups on the managed servers determines what is created. When the managed server is part of a cluster it will behave differently

      Thanks

      Delete
  7. Ok, some more trial and error later, I've discovered that if you create an empty cluster, then no UDDs are created. But if you create a cluster and add the SOA/BPM/BAM/etc managed server to the cluster, the JMS destinations are converted to UDDs. So in 12c, it seems like they have added a little more intelligence into the templates compared to 11g.

    Thanks for the response.

    ReplyDelete
  8. Getting below error, can you suggest what could be the reason

    Reason: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

    Exception:

    oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:56)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2279)
    at com.oracle.cie.domain.script.jython.WLScriptContext.updateDomain(WLScriptContext.java:827)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

    com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: Domain Extension Application Failed!

    ReplyDelete
    Replies
    1. Hi,

      Did you manage to resolve this error. Am facing the same issue now. Any help much appreciated

      Thanks
      Harish

      Delete
  9. Can the following server groups assigned to managed server during domain creation? If not how can I assigned it to manages server?
    serverGroup = ["WSM-CACHE-SVR" , "WSMPM-MAN-SVR" , "JRF-MAN-SVR"]

    ReplyDelete
  10. Hi Edwin,

    Can you please tell me is rcu utility need to run every time if you re create the same domain again?
    can we use the same schema to run domain creation script every time?
    what is the significance of getDatabaseDefaults() method? in script?

    Thank you for great help.

    ReplyDelete
  11. Edwin,
    Is there anyway to get the datasources created like when you are using the GUI to check the box that says uses RCU Data and it created the datasources for you in the domain? I am getting the opss-data-source is missing error as well when trying to extend with OSB.

    Thanks,
    Don

    ReplyDelete
  12. I need use java weblogic.WLS but when I am trying updateDomain I get this error .. anybody have some idea?

    If I tried execute script with wlst.sh everything works ok.
    --------------------------------------------------------------------------------------------------
    /opt/fmw/oracle_common/bin/wlst.sh osb.py

    If I tried execute script with java weblogic.WLST .. I got shit error
    --------------------------------------------------------------------------------------------------
    . /opt/fmw/wlserver/server/bin/setWLSEnv.sh
    java weblogic.WLST osb.py

    Extend...osb domain with template /opt/fmw/osb/common/templates/wls/oracle.osb_template_12.1.3.jar
    Adding ApplCore Template

    Change datasources
    Change datasource LocalScvTblDataSource
    Call getDatabaseDefaults which reads the service table
    end datasources
    Create machine LocalMachine with type UnixMachine
    Change AdminServer
    end server groups
    Error: updateDomain() failed. Do dumpStack() to see details.
    Problem invoking WLST - Traceback (innermost last):
    File "/var/fmw/domain/osb.py", line 264, in ?
    File "/tmp/WLSTOfflineIni5377022257257389703.py", line 103, in updateDomain

    Domain Location: /var/fmw/domain/osb_domain

    Reason: oracle.security.opss.tools.lifecycle.LifecycleException: Fail to find default JPS Context in /var/fmw/domain/osb_domain/config/fmwconfig/jps-config-jse.xml.

    Exception:

    oracle.security.opss.tools.lifecycle.LifecycleException: Fail to find default JPS Context in /var/fmw/domain/osb_domain/config/fmwconfig/jps-config-jse.xml.

    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:56)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2279)
    at com.oracle.cie.domain.script.jython.WLScriptContext.updateDomain(WLScriptContext.java:827)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)

    com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: Domain Extension Application Failed!

    Domain Location: /var/fmw/domain/osb_domain

    Reason: oracle.security.opss.tools.lifecycle.LifecycleException: Fail to find default JPS Context in /var/fmw/domain/osb_domain/config/fmwconfig/jps-config-jse.xml.

    Exception:

    oracle.security.opss.tools.lifecycle.LifecycleException: Fail to find default JPS Context in /var/fmw/domain/osb_domain/config/fmwconfig/jps-config-jse.xml.

    ReplyDelete
  13. Hi Edwin,

    I'm trying to figure out how to create a simple development domain (SOA+OSB) with Docker...did you make that thing?

    Thanks in advance!

    ReplyDelete
  14. Hi Edwin,
    I tried to use the above script to create the clustered Weblogic domain and I was getting the below error when I was trying to start the weblogic server, could you please let me know how to resolve the below issue?
    Current version: 12.2.1
    Java: 1.8


    Version: WebLogic Server 12.2.1.0.0 Tue Oct 6 10:05:47 PDT 2015 1721936
    Jan 21, 2016 4:24:01 PM IST Critical WebLogicServer BEA-000386 Server subsystem failed. Reason: A MultiException has 5 exceptions. They are:

    1. weblogic.management.provider.internal.RuntimeAccessImpl$ParseException: [Management:141266]Parsing failure in config.xml: weblogic.management.ManagementRuntimeException: Could not create the JMS descriptor. Error encountered in file: /home/oracle/wls_domains/domains/soa_qa_domain/config/jms/bampersistencejmsmodule-jms.xml.

    2. java.lang.IllegalStateException: Unable to perform operation: create on weblogic.management.provider.internal.RuntimeAccessImpl

    3. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.management.provider.internal.RuntimeAccessService

    4. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.t3.srvr.FinalThreadLocalService errors were found

    5. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.t3.srvr.FinalThreadLocalService

    A MultiException has 5 exceptions. They are:

    1. weblogic.management.provider.internal.RuntimeAccessImpl$ParseException: [Management:141266]Parsing failure in config.xml: weblogic.management.ManagementRuntimeException: Could not create the JMS descriptor. Error encountered in file: /home/oracle/wls_domains/domains/soa_qa_domain/config/jms/bampersistencejmsmodule-jms.xml.

    2. java.lang.IllegalStateException: Unable to perform operation: create on weblogic.management.provider.internal.RuntimeAccessImpl

    3. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.management.provider.internal.RuntimeAccessService

    4. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.t3.srvr.FinalThreadLocalService errors were found

    5. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.t3.srvr.FinalThreadLocalService


    Caused By: weblogic.management.provider.internal.RuntimeAccessImpl$ParseException: [Management:141266]Parsing failure in config.xml: weblogic.management.ManagementRuntimeException: Could not create the JMS descriptor. Error encountered in file: /home/oracle/wls_domains/domains/soa_qa_domain/config/jms/bampersistencejmsmodule-jms.xml.

    Caused By: weblogic.descriptor.DescriptorValidateException: The following failures occurred:
    -- Unresolved reference to BamPersistenceErrorQueue_auto_1 by /UniformDistributedQueues[dist_BamPersistenceQueue_auto]/DeliveryFailureParams/ErrorDestination


    Thank you,
    Bharat

    ReplyDelete
  15. Edwin,

    why do my OSB domains fails

    ---- Begin output of /u01/soa12c/oracle/products/fmw1221/wlserver/common/bin/wlst.sh /tmp/kitchen/cache/new_domain-12c.py ----
    STDOUT: WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.

    Initializing WebLogic Scripting Tool (WLST) ...

    Welcome to WebLogic Server Administration Scripting Shell

    Type help() for help on available commands

    Creating Domain
    Adding Templates
    Creating Resources
    Error: runCmd() failed. Do dumpStack() to see details.
    STDERR: Mar 14, 2016 8:12:39 PM com.oracle.cie.domain.script.jython.CommandExceptionHandler handleException
    SEVERE: Error: runCmd() failed.
    com.oracle.cie.domain.script.jython.WLSTException: Error updating domain:
    Domain Extension Application Failed!

    Domain Location: /u01/soa12c/oracle/config/domains/OSBDomain

    Reason: java.lang.IllegalArgumentException: WSM-04602 : A password is required to connect to a database-based MDS repository.

    Exception:

    java.lang.IllegalArgumentException: WSM-04602 : A password is required to connect to a database-based MDS repository.

    java.lang.IllegalArgumentException: WSM-04602 : A password is required to connect to a database-based MDS repository.
    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:69)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2360)
    at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:676)
    at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)

    ReplyDelete
  16. Hi

    Why don't use this scripts in production? It's self-documented, everything in one place, easy to use and perfect when restoring from crash.
    Just curious. :-)

    ReplyDelete