Friday, June 29, 2012

Enable Discovery Cache to Avoid Long Delay during Login to EM console – Oracle SOA Suite 11g

Enable Discovery Cache to Avoid Long Delay during Login to EM console in Oracle SOA Suite 11g

Logging into Enterprise Manager of Fusion Middleware Control 11g (fmwctl) takes a long time, the fmwctl discovery is always performed as part of login.  For installations with thousands of targets (e.g. Composites), fmwctl discovery may take 45-60 seconds. This time is expected because EM discovery Mbeans need to be invoked for every target. If the number of fmwctl monitored targets (e.g. Deployed Composites) increases, the login time will go up as well.
Solution is to cache the discovery results in the servlet context and use it for subsequent logins. This discovery result will be shared by all the fmwctl users. This will still require the entire discovery to be done at least once.
New parameters are added to enable/disable and to control the usage of the cached discovery results.  
  • If the caching is enabled, fmwctl will use the cached discovery results.
  • The default setting is "not use the cached results"
We have observed this issue in Oracle SOA Suite version 11.1.1.5.0 and Oracle suggested the patch 13251077 to enable the fmwctl discovery cache.

Steps to enable fmwctl discovery cache:

  1. Upgrade to FMw 11.1.1.6 or apply available patch 13251077 for your version.
    If applying patch 13251077, set ORACLE_HOME to MW_HOME/oracle_common before applying.
  2. Navigate to fmwctl System mBean browser.

Thursday, June 28, 2012

Monitoring the JCA Adapter’s through WLST script – Oracle SOA Suite

Monitoring the JCA Adapter’s through WLST script in Oracle SOA Suite:

Sometimes we may need to monitor the runtime performance of the JCA adapters, the monitoring is possible through EM console for limited details, the below WLST script will help us to monitor the required details of the JCA adapter (the scrip should be extended to monitor more details).

The below script can be used for monitoring only the DBAdapter’s and MQAdapter’s; the same can be extended to monitor other JCA Adapters (like FileAdapter) .

Before executing the script change the below condition according to your server name.

if server.getName().strip().startswith('S') | server.getName().strip().startswith('O')

The Adapters are only available in SOA and OSB servers so that I am filtering the other servers  based on the name(AdminServer or MS servers) .The exception will be thrown if we are trying to cd the MBean related to Adapters in others servers.

ResourceAdapterMonitor.py

def monitorDBAdapter(serverName):
    cd("ServerRuntimes/"+str(serverName)+"/ApplicationRuntimes/DbAdapter/ComponentRuntimes/DbAdapter/ConnectionPools")
    connectionPools = ls(returnMap='true')
    print '--------------------------------------------------------------------------------------'
    print 'DBAdapter Runtime details for '+ serverName
    print '                                                                                      '
    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'

    print '%10s %13s %15s %18s' % ('Connection Pool', 'State', 'Current', 'Created')
    print '%10s %10s %24s %21s' % ('', '', 'Capacity', 'Connections')
    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'
    for connectionPool in connectionPools:
       if connectionPool!='eis/DB/SOADemo':
          cd('/')
          cd("ServerRuntimes/"+str(serverName)+"/ApplicationRuntimes/DbAdapter/ComponentRuntimes/DbAdapter/ConnectionPools/"+str(connectionPool))
          print '%15s %15s %10s %20s' % (cmo.getName(), cmo.getState(), cmo.getCurrentCapacity(), cmo.getConnectionsCreatedTotalCount())

    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'

def monitorMQAdapter(serverName):
    cd("ServerRuntimes/"+str(serverName)+"/ApplicationRuntimes/MQSeriesAdapter/ComponentRuntimes/MQSeriesAdapter/ConnectionPools")
    connectionPoolsMQ = ls(returnMap='true')
    print '--------------------------------------------------------------------------------------'
    print 'MQAdapter Runtime details for '+ serverName
    print '                                                                                      '
    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'

    print '%15s %17s %15s %18s' % ('Connection Pool', 'State', 'Current', 'Created')
    print '%15s %15s %24s %21s' % ('', '', 'Capacity', 'Connections')
    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'
    for connectionPoolMQ in connectionPoolsMQ:
          cd('/')
          cd("ServerRuntimes/"+str(serverName)+"/ApplicationRuntimes/MQSeriesAdapter/ComponentRuntimes/MQSeriesAdapter/ConnectionPools/")
          cd(connectionPoolMQ)
          print '%15s %20s %10s %20s' % (cmo.getName(), cmo.getState(), cmo.getCurrentCapacity(), cmo.getConnectionsCreatedTotalCount())

    print '                                                                                      '
    print '--------------------------------------------------------------------------------------'


def main():
      #connect(username, password, admurl)
      connect('weblogic','reuters123','t3://<SOA Host>:<SOA Port>)
      servers = cmo.getServers()
      domainRuntime()
      for server in servers:
         cd("/ServerLifeCycleRuntimes/" + server.getName())
         if cmo.getState() == 'RUNNING':  
            if server.getName().strip().startswith('S') | server.getName().strip().startswith('O') :
                 monitorDBAdapter(server.getName())
      for server in servers:
         cd('/')
         cd("/ServerLifeCycleRuntimes/" + server.getName())
         if cmo.getState() == 'RUNNING':  
            if server.getName().strip().startswith('S') | server.getName().strip().startswith('O') :
                 monitorMQAdapter(server.getName())   
      disconnect()
     
main()

Copy the script to the soa server and execute the below command

>   wlst.sh ResourceAdapterMonitor.py

O/P:
--------------------------------------------------------------------------------------
DBAdapter Runtime details for SOA1
--------------------------------------------------------------------------------------
Connection Pool         State         Current            Created
                                                    Capacity          Connections
--------------------------------------------------------------------------------------
  eis/DB/SOA             Running         22               1051
      eis/DB/Test           Running           2                  697
    eis/DB/Test1           Running           1                  130
--------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
MQAdapter Runtime details for SOA1
------------------------------------------------------------------------------------------------------
Connection Pool                                       State          Current            Created
                                                                                  Capacity           Connections
------------------------------------------------------------------------------------------------------
eis/MQ/MQAdapter                                 Running          0                    0
eis/MQ/MQSeriesAdapterRemote            Running          2                   84
-------------------------------------------------------------------------------------------------------


DOWNLOAD ResourceAdapterMonitor.py

Thursday, June 21, 2012

Support to Retrieve or set a HTTP header in Oracle SOA Suite 11.1.1.5 version


Oracle SOA Suite 11.1.1.6 version provides the support to retrieve or set a HTTP header from BPEL

The same fix has been applied to the version 11.1.1.4 as a patch 12928372 but the patch was not available for the version 11.1.1.5.

Recently oracle has released the patch 12928372 for the version 11.1.1.5 also.

The patch can be downloaded for the metalink by specifying the patch no as 12928372.


 This functionality is working only with the BPEL version 2.0, make sure the BPEL process version is 2.0 when we are trying to implement this functionality.

Friday, June 8, 2012

Could not find registry for application_JBOServiceRegistry while deploying the composite with Oracle ADF-BC adapter


Could not find registry for application_JBOServiceRegistry while deploying the composite with Oracle ADF-BC adapter

When we are invoking the Oracle ADF-BC service from our Oracle SOA Suite composite, we may receive the error
“Could not find registry for applicationname_JBOServiceRegistry”.

The error is due to the wrong registry name used in the ADF-BC adapter configuration also the missing listener entry in the weblogic-application.xml

Follow the below steps to resolve the issue:

Verify the registry name provided in the ADF-BC adapter used in the composite.



The Registry name should be of form <application name>_ JBOServiceRegistry
The application name can be found on the application deployment profile of the ADF-BC application.


Thursday, June 7, 2012

Invoking a ADF-BC service from the SOA Composite – Oracle SOA Suite


Invoking a ADF-BC service from the SOA Composite – Oracle SOA Suite

This blog explains how to create a sample Oracle ADF-BC service and invoke the same from the Oracle SOA Suite composite.

Creating the ADF-BC application: 

This is a simple ADF-BC application to perform the operations on the Employee table.
  • Create the ADF Model Project and name it as EmpModel
 
  • Select the ADF Business Components in the Project Technologies

  •  Right click on the Project -- >Select ADF Business Components -- >Click on Business Components from Tables

Monday, June 4, 2012

Selective tracing for Oracle SOA Suite


Selective tracing for Oracle SOA Suite:

In a production system, setting the trace at a fine-grained level can result in a large amount of output that must be diagnosed. You can alternately use selective tracing that provides a way to get a detailed, on-disk trace selectively (for example, by user name, thereby eliminating trace output for other users).

In Oracle SOA Suite 11g:

Activate the selective tracing:

  • Right-click the domain under WebLogic Domain and choose Logs > Selective Tracing.

Sunday, June 3, 2012

Restrict the access to SOA Composite Service based on the User Role (Authorization to the SOA Composite Service) – Oracle SOA Suite 11g


Restrict the access to SOA Composite Service based on the User Role (Authorization to the SOA Composite Service) – Oracle SOA Suite 11g

Sometimes we may need to restrict the access to the SOA composite service based on the user role.
HTTP basic authentication and an authorization policy can be used to ensure that access is only granted to users who are members of a particular role.

This blog will explain the steps to enable authorization to our composite service. 

Configure the Users and Group:

  • Login to the Weblogic console ('http://<host>:<port>/console')
  • In the left menu select 'Security Realms'
  • Select the realm where you want to create the users and groups.  The default is 'myrealm'
  • At the top select the 'Users and Groups' tab
  • Select User tab and Click 'New' and enter your user name and pwd.  Here am creating the user albin and albin1, create as many users as you want
  • Select ‘Groups’ tab and create a new group.  Here I am creating  ‘IntegrationGroup’
  • Go back to the users and click on  'Albin'
  • Select the 'Groups' tab and add ‘IntegrationGroup’.  The user albin1 will not be part of this group.

Configure the Application Role:

  • Login to EM console
  • Right Click on WebLogic Domain -- >Select Security and Click on Application Roles

  •  Click on 'Create' to configure a new Application Role

Invoking a web service from the composite with HTTP Basic authentication – Oracle SOA Suite

Invoking a web service from the composite with HTTP Basic authentication  – Oracle SOA Suite 11g

Sometimes we may need to invoke the HTTP Basic authentication enabled web service from the  Oracle SOA Suite composite.
This blog will explain the steps to invoke the web service with the HTTP basic authentication enabled.

Configure the credential store:

The credential should be configured in the credential store to invoke the web service with the HTTP Basic authentication enabled.

If the credential store is not configured already then follow the below steps to do the same.
  • Login to EM
  • Right Click on WebLogic Domain - Select Security and Click on Credentials


The same will work in Oracle SOA Suite 12c but the screens will be little different.

oracle_soa_12c_credential_map


  • Click on Create Map

Saturday, June 2, 2012

Enabling the HTTP Basic authentication to the Composite Service (Invoking a composite with HTTP authentication) – Oracle SOA Suite 11g

Enabling the HTTP Basic authentication to the Composite Service (Invoking a composite with HTTP authentication) – Oracle SOA Suite 11g

Sometimes we may need to enable the security like HTTP basic authentication to the composite service, so that the client can securely invoke our services providing the username/password.
This blog will explain the steps to enable HTTP basic authentication to our composite service. 

Configure the Authentication policy to the Composite Service:

  • Open the composite.xml   
  • Right click on the client service and click on Configure WS Polices


  •  Add the security Policy oracle/wss_http_token_service_policy for authentication in the security section.