Browsing Your ADF Application Module Pooling Params with WLST

Posted by Duncan Mills on Oracle Blogs See other posts from Oracle Blogs or by Duncan Mills
Published on Tue, 08 Jun 2010 11:02:31 -0800 Indexed on 2010/06/08 20:53 UTC
Read the original article Hit count: 676

Filed under: Error when finding categories...
In ADF 11g you can of course use Enterprise Manager (EM) to browse and configure the settings used by ADF Business Components  Application Modules, as shown here for one of my sample deployed applications.
em_adfpooling.png
This screen you can access from the EM homepage by pulling down the Application Deployment menu, and then ADF > Configure ADF Business Components. Then select the profile that you are actually using (Hint: look in the DataBindings.cpx file to work this out - probably the "Local" version unless you've explicitly changed it. )
So, from this screen you can change the pooling parameters and the world is good. But what if you don't have EM installed? In that case you can use the WebLogic scripting capabilities to view (and Update) the MBean Properties.
Explanation
The pooling parameters and many others are handled through Message Driven Beans that are created for the deployed application in the server. In the case of the ADF BC pooling parameters, this MBean will combine the configuration deployed as part of the application, along with any overrides defined as -D environement commands on the JVM startup for the application server instance.
 
Using WLST to Browse the Bean Values
For our purposes here I'm doing this interactively, although you can also write a script or write Java to achieve the same thing.

Step 0: Before You Start
You will need the following
  1. Access to the console on the machine that is running the server
  2. The WebLogic Admin username and password (I'll use weblogic/password as my example here - yours will be different)
  3. The name of the deployed application (in this example FMWdh_application1)
  4. The package path to the bc4j.xcfg file (in this example oracle.demo.fmwdh.model.service.common.bc4j.xcfg) This is based on the default path for your model project so it shoudl be fairly easy to work out.
  5. The BC configuration your AM is actually running with (look in the DataBindings.cpx for that. In this example DealHelpServiceDeployed is the profile being used..)
Step 1: Start the WLST console
To start at the beginning, you need to run the WLST command but that needs a little setup:
  1. Change to the wlserver_10.3/server/bin directory e.g. under your Fusion Middleware Home
    [oracle@mymachine] cd /home/oracle/FMW_R1/wlserver_10.3/server/bin
  2. Set your environment using the setWLSEnv script. e.g. on Oracle Enterprise Linux:
    [oracle@mymachine bin] source setWLSEnv.sh
  3. Start the WLST interactive console
    [oracle@mymachine bin] java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands

wls:/offline>

 
Step 2:Enter the WLST commands
  1. Connect to the server
    wls:> connect('weblogic','password')
  2. Change to the Custom root, this is where the AMPooling MBeans are registered
    wls:> custom()
  3. Change to the b4j MBean directory
    wls:> cd ('oracle.bc4j.mbean.config')
  4. Work out the correct directory for the AM configuration you need. This is the difficult bit, not because it's hard to do, but because the names are long. The structure here is such that every child MBean is displayed at the same level as the parent, so for each deployed application there will be many directories shown. In fact, do an ls() command here and you'll see what I mean. Each application will have one MBean for the app as a whole, and then for each deployed configuration in the .xcfg file you'll see: One for the config entry itself, and then one each for Security, DB Connection and AM Pooling. So if you deploy an app with just one configuration you'll see 5 directories, if it has two configurations in the .xcfg you'll see 9 and so on.
    The directory you are looking for will contain those bits of information you gathered in Step 0, specifically the Application Name, the configuration you are using and the xcfg name:
    First of all narrow your list to just those directories returned from the ls() command that begin oracle.bc4j.mbean.config:name=AMPool. These identify the AM pooling MBeans for all the deployed applications.
    Now look for the correct application name e.g. Application=FMWdh_application1
    The config setting in that sub-list should already be correct and match what you expect e.g. oracle.bc4j.mbean.config=oracle.demo.fmwdh.model.service.common.bc4j.xcfg
    Finally look for the correct value for the AppModuleConfigType e.g. oracle.bc4j.mbean.config.AppModuleConfigType=DealHelpServiceDeployed
  5. Now you have identified the correct directory name, change to that (keep the name on one line of course - I've had to split it across lines here for clarity:
    wls:> cd ('oracle.bc4j.mbean.config:name=AMPool,
        type=oracle.bc4j.mbean.config.AppModuleConfigType.AMPoolType,
        oracle.bc4j.mbean.config=oracle.demo.fmwdh.model.service.common.bc4j.xcfg,
        Application=FMWdh_application1,
        oracle.bc4j.mbean.config.AppModuleConfigType=DealHelpServiceDeployed')
  6. Now you can actually view the parameter values with a simple ls() command
    wls:> ls()
    And here's the output in which you can view the realtime values of the various pool settings:

-rw- AmpoolConnectionstrategyclass oracle.jbo.common.ampool.DefaultConnectionStrategy
-rw- AmpoolDoampooling true
-rw- AmpoolDynamicjdbccredentials false
-rw- AmpoolInitpoolsize 2
-rw- AmpoolIsuseexclusive true
-rw- AmpoolMaxavailablesize 40
-rw- AmpoolMaxinactiveage 600000
-rw- AmpoolMaxpoolsize 4096
-rw- AmpoolMinavailablesize 2
-rw- AmpoolMonitorsleepinterval 600000
-rw- AmpoolResetnontransactionalstate true
-rw- AmpoolSessioncookiefactoryclass oracle.jbo.common.ampool.DefaultSessionCookieFactory
-rw- AmpoolTimetolive 3600000
-rw- AmpoolWritecookietoclient false
-r-- ConfigMBean true
-rw- ConnectionPoolManager oracle.jbo.server.ConnectionPoolManagerImpl
-rw- Doconnectionpooling false
-rw- Dofailover false
-rw- Initpoolsize 0
-rw- Maxpoolcookieage -1
-rw- Maxpoolsize 4096
-rw- Poolmaxavailablesize 25
-rw- Poolmaxinactiveage 600000
-rw- Poolminavailablesize 5
-rw- Poolmonitorsleepinterval 600000
-rw- Poolrequesttimeout 30000
-rw- Pooltimetolive -1
-r-- ReadOnly false
-rw- Recyclethreshold 10
-r-- RestartNeeded false
-r-- SystemMBean false
-r-- eventProvider true
-r-- eventTypes java.lang.String[jmx.attribute.change]
-r-- objectName oracle.bc4j.mbean.config:name=AMPool,type=oracle.bc4j.mbean.config.AppModuleConfigType.AMPoolType,oracle.bc4j.mbean.config=oracle.demo.fmwdh.model.service.common.bc4j.xcfg,Application=FMWdh_application1,oracle.bc4j.mbean.config.AppModuleConfigType=DealHelpServiceDeployed
-rw- poolClassName oracle.jbo.common.ampool.ApplicationPoolImpl
Thanks to Brian Fry on the JDeveloper PM Team who did most of the work to put this sequence of steps together with me badgering him over his shoulder.

© Oracle Blogs or respective owner