rss
SOATUBE
Oracle
Custom Search SOABYTE here

Friday, February 19, 2016

Things to know about BRM JCA Adapter configuration












TransactionMode should be set to Local if automatic BPEL Remote Fault detection/action for connection failures is required. 

Basically it is the fact that JCA throws Retriable Exceptions in Local Transactions for NAP_CONNECT_FAILED (and a few others like DM_CONNECT_FAILED, BAD_READ etc.) that results in BPEL detecting it as remote fault, not the BRM error code itself. However for XA, JCA throws mostly XAException which BPEL cannot detect as Remote Fault so it will be always be a binding fault there so JCA should not be deployed in XA mode if BPEL automatic detection of remote fault is relied upon by customers. Oracle JCA adapters also document some limitations by saying fault policy management will not work for outbound JCA adaptors in XA mode and they should use SOA's JCA retry mechanism instead of fault mechanism.
Section2.21.3.2.3 http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/life_cycle.htm#TKADP224) .Fault management in BPEL using Remote Faults to retry will not work with BRM JCA adaptor in XA mode since JCA will throw XA Exceptions that XA Transaction Manager will expect and take action. Moreover XA transaction should not retried via fault mechanism, but rather based XA specific error codes.

FailoverConnectionString should be kept empty or should not contain invalid entries

Whenever a connection fails it tries to reconnect to the other entries in the FailoverConnectionString and when those entries cannot be accessed we get CM_ADDRESS_LOOKUP_FAILED. We should clear the FailoverConnectionString entry completely or just replace localhost and localhost2 with the same host as the one in the connection string. 

BRMConnectionPoolMaxsize= Max Capacity BRMConnectionPoolMinsize = Initial Capacity 

BRMConnectionPoolMaxsize / BRMConnectionPoolMinsize is where we define the pool size, which is the number of connections from JCA to BRM.Initial Capacity / Max Capacity is the managed pool size from application which defines the total Managed connections from Application Server to JCA.The application server uses a configured resource adapter (BRM adapter in this case) to create physical connections to the underlying EIS with the help of Connection Factory instance. If we have (x-1) number of Managed connections and (x) number of Connection Factory instances (Physical connections), we are actually not utilizing all the physical connections. In the same way, if we have (x) Managed connections and (x-1) physical connections, we are possibly affecting the performance of the overall system as each Managed connection utilizes system resource (memory and disk space etc.).So it is recommended to have the (managed) connection pool and Connection Factory instance to have same values, which allows for 100% utilization overall system

OS level timeout properties

Usage of OS level TCP IP parameters (e.g. keepalive parameters) while working with the BRM JCA Adapter. By default, the effectiveness of the keepalive parameter is enabled in JCA Adapter (if the parameters are defined in OS kernel) and does not need any configuration.
 # cat /proc/sys/net/ipv4/tcp_keepalive_time 
 7200 (default) changed to 240 
 # cat /proc/sys/net/ipv4/tcp_keepalive_intvl 
 75 (default) changed to 60 
 # cat /proc/sys/net/ipv4/tcp_keepalive_probes 
 9 (default) unchanged

Wednesday, November 25, 2015

Adding managed servers to domain/cluster and basic tuning via wlst

Place addNodes.properties file,AddManagedServerToDomain.py and runAddManagedServerToDomain.sh inside a folder and execute ./runAddManagedServerToDomain.sh to run the program.Here we are adding 3rd managed server (myhost2:8001) to cluster.
#*****************************************************
# Environment details
#*****************************************************
ADMIN_USERNAME = weblogic
ADMIN_PASSWORD = welcome1
ADMIN_URL = t3://<hostname>:<port>
CLUSTER_NAME = MyCluster

##*****************************************************
##   Set Log Rotation by Time                         *
##*****************************************************
# How to rotate
RotationType = byTime
# When to roate
RotationTime = 00:00
# For how much time
FileTimeSpan = 24

##*****************************************************
##   Max Message Size Configurations                  *
##*****************************************************

MaxMessageSize = 50000000


##*****************************************************
##  Cluster Address                                   *
##*****************************************************

ClusterAddress = myhost1:8001,myhost1:8002,myhost2:8001

##*****************************************************
#   Machine Names to be added                         *
##*****************************************************

MachineNames = MyMachine_3

##*****************************************************
##  Listen Adresses(repeat twice for 2 servers per VM)*
##*****************************************************

ListenAddresses = myhost2

##*****************************************************
##   Listen Ports (8001/8002 for 2 servers per VM)    *
##*****************************************************

ListenPorts = 8001

##*****************************************************
##   ServerNames(to be created)                       *
##*****************************************************

ServerNames = SoaServer_3

##*****************************************************
##   Server Number(to be added)                      *
##*****************************************************

ServerNumbers = 3

##*****************************************************
##   New SAF Agents to be created                     *
##*****************************************************

SAFAgentsNames = OSM_SAFAgent_03



########################################################################################
# Adding Nodes to domain Automation                                                    #
# @Amiya Kumar                                                                         #
# Restart the servers after running this script.                                       #
#Do not change the discription                                                         #
########################################################################################


#Running the script                                                                    #
#Run runaddNodeAutomationWLST.sh                                                        #
########################################################################################

from java.io import FileInputStream
import java.lang
import string
import sys
import os

#read properties file
propInputStream = FileInputStream("addNodes.properties");
configProps = Properties();
configProps.load(propInputStream);

#Connecting to Server
adminusername = configProps.get('ADMIN_USERNAME');
adminpassword = configProps.get('ADMIN_PASSWORD');
adminurl = configProps.get('ADMIN_URL');
clusterName = configProps.get('CLUSTER_NAME');
connect(adminusername, adminpassword, adminurl);
MachineNames = configProps.get('MachineNames');
MachineNameList = String(MachineNames).split(",");
ListenAddresses = configProps.get('ListenAddresses');
ListenAddressList = String(ListenAddresses).split(",");
ServerNames = configProps.get('ServerNames');
ServerNameList = String(ServerNames).split(",");
ServerNumbers = configProps.get('ServerNumbers');
ServerNumberList = String(ServerNumbers).split(",");
ListenPorts = configProps.get('ListenPorts');
ListenPortList = String(ListenPorts).split(","); 

#Creating Managed servers and related resources
def createManagedServersandResources():
 domainConfig();
 i=0;
 j=0;
 k=0;
 l=0;
 m=0;
 while i<len(MachineNameList) and j<len(ListenAddressList) and k<len(ServerNameList) and l<len(ServerNumberList) and m<len(ListenPortList):
  edit();
  startEdit();
  MachineName = MachineNameList[i]
  ListenAddress = ListenAddressList[j]
  ServerName = ServerNameList[k]
  ServerNumber = ServerNumberList[l]
  ListenPort = ListenPortList[m]
  #####Creating Machine########
  cd('/')
  cmo.createUnixMachine(MachineName)
  cd('/Machines/'+MachineName+'/NodeManager/'+MachineName+'/')
  cmo.setNMType('SSL')
  cmo.setListenAddress(ListenAddress)
  cmo.setListenPort(5556)
  cmo.setDebugEnabled(false)
  ######Creating Managed Server and adding to existing cluster and machine created above######
  cd('/')
  cmo.createServer(ServerName)
  cd('/Servers/'+ServerName+'/')
  cmo.setListenAddress(ListenAddress)
  cmo.setListenPort(int(ListenPort))
  cmo.setCluster(getMBean('/Clusters/'+clusterName+'/'))

  cd('/Servers/'+ServerName+'/SSL/'+ServerName+'/')
  cmo.setExportKeyLifespan(500)
  cmo.setUseServerCerts(false)
  cmo.setSSLRejectionLoggingEnabled(true)
  cmo.setAllowUnencryptedNullCipher(false)
  cmo.setInboundCertificateValidation('BuiltinSSLValidationOnly')
  cmo.setOutboundCertificateValidation('BuiltinSSLValidationOnly')
  cmo.setHostnameVerificationIgnored(true)
  cmo.setHostnameVerifier(None)
  cmo.setTwoWaySSLEnabled(false)
  cmo.setClientCertificateEnforced(false)
  cmo.setJSSEEnabled(false)

  cd('/Servers/'+ServerName+'/')
  cmo.setMachine(getMBean('/Machines/'+MachineName+'/'))

  ######Creating Persistent stores#######
  cd('/')
  cmo.createFileStore('AIADataStore_'+ServerNumber)
  cd('/FileStores/AIADataStore_'+ServerNumber+'/')
  cmo.setDirectory('AIADataStore_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))

  cd('/')
  cmo.createJDBCStore('AIAJDBCDataStore_'+ServerNumber)
  cd('/JDBCStores/AIAJDBCDataStore_'+ServerNumber+'/')
  cmo.setDataSource(getMBean('/SystemResources/AIAJMSDS'))
  cmo.setPrefixName('AIAJDBCDataStore_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('BPMJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/BPMJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('BPMJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('SOAJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/SOAJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('SOAJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('UMSJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/UMSJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('UMSJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName)) 

  ########Creating JMS Servers########
  cd('/')
  cmo.createJMSServer('AIAJDBCJMSServer_'+ServerNumber)
  cd('/Deployments/AIAJDBCJMSServer_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/JDBCStores/AIAJDBCDataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('AIAJMSServer_'+ServerNumber)
  cd('/Deployments/AIAJMSServer_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/AIADataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('BPMJMSServer_auto_'+ServerNumber)
  cd('/Deployments/BPMJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/BPMJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('SOAJMSServer_auto_'+ServerNumber)
  cd('/Deployments/SOAJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/SOAJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('UMSJMSServer_auto_'+ServerNumber)
  cd('/Deployments/UMSJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/UMSJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))

  ##########Creating BPM Subdeployments###########
  cd('/SystemResources/BPMJMSModule')
  cmo.createSubDeployment('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to BPMJMSModules########

  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule')
  cmo.createTopic('MeasurementTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/bpm/MeasurementTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule') 
  cmo.createTopic('PeopleQueryTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/PeopleQueryTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/bpm/PeopleQueryTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber+'/Thresholds/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setMessagesLow(9223372036854775807)
  cmo.setMessagesHigh(9223372036854775807)
  cmo.setBytesHigh(9223372036854775807)
  cmo.setBytesLow(9223372036854775807)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber)
  cmo.setMaximumMessageSize(2147483647)
  cmo.setQuota(getMBean('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Quotas/MeasurementQuota'))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_MeasurementTopic_auto')
  cmo.createDistributedTopicMember('MeasurementTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_MeasurementTopic_auto/DistributedTopicMembers/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_PeopleQueryTopic_auto')
  cmo.createDistributedTopicMember('PeopleQueryTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_PeopleQueryTopic_auto/DistributedTopicMembers/PeopleQueryTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)

  #########Create SOAJMSModule Subdeployment######
  cd('/SystemResources/SOAJMSModule')
  cmo.createSubDeployment('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to SOAJMSModules########
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createTopic('B2BBroadcastTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Topics/B2BBroadcastTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2BBroadcastTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2BEventQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2BEventQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2BEventQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2B_IN_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2B_IN_QUEUE_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2B_IN_QUEUE_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2B_OUT_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2B_OUT_QUEUE_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2B_OUT_QUEUE_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('EDNQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/EDNQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/fabric/EDNQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('NotificationSenderQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/NotificationSenderQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/Queue/NotificationSenderQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('TestFwkQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/TestFwkQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/testfwk/TestFwkQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createTopic('XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Topics/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/fabric/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_B2BBroadcastTopic_auto')
  cmo.createDistributedTopicMember('B2BBroadcastTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_B2BBroadcastTopic_auto/DistributedTopicMembers/B2BBroadcastTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2BEventQueue_auto')
  cmo.createDistributedQueueMember('B2BEventQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2BEventQueue_auto/DistributedQueueMembers/B2BEventQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_IN_QUEUE_auto')
  cmo.createDistributedQueueMember('B2B_IN_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_IN_QUEUE_auto/DistributedQueueMembers/B2B_IN_QUEUE_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_OUT_QUEUE_auto')
  cmo.createDistributedQueueMember('B2B_OUT_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_OUT_QUEUE_auto/DistributedQueueMembers/B2B_OUT_QUEUE_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_EDNQueue_auto')
  cmo.createDistributedQueueMember('EDNQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_EDNQueue_auto/DistributedQueueMembers/EDNQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_NotificationSenderQueue_auto')
  cmo.createDistributedQueueMember('NotificationSenderQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_NotificationSenderQueue_auto/DistributedQueueMembers/NotificationSenderQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_TestFwkQueue_auto')
  cmo.createDistributedQueueMember('TestFwkQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_TestFwkQueue_auto/DistributedQueueMembers/TestFwkQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_XmlSchemaChangeNotificationTopic_auto')
  cmo.createDistributedTopicMember('XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_XmlSchemaChangeNotificationTopic_auto/DistributedTopicMembers/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)

  #########Create SOAJMSModule Subdeployment######
  cd('/SystemResources/UMSJMSSystemResource')
  cmo.createSubDeployment('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to UMSJMSModules######## 
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineCmdQ_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineCmdQ_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineSndQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineSndQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMWSRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMWSRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  activate()
  i=i+1;
  j=j+1;
  k=k+1;
  l=l+1;
  
#Creating new SAF Agents
def createNewSAFAgents():
 domainConfig();
 SAFAgentsNames = configProps.get('SAFAgentsNames');
 SAFAgentsNameList = String(SAFAgentsNames).split(",");
 i=0;
 j=0;
 k=0;
 while i<len(ServerNumberList) and j<len(SAFAgentsNameList) and k<len(ServerNameList):
  edit();
  startEdit();
  ServerNumber = ServerNumberList[i]
  SAFAgentName = SAFAgentsNameList[j]
  ServerName = ServerNameList[k]
  cd('/')
  cmo.createSAFAgent(SAFAgentName)
  cd('/SAFAgents/'+SAFAgentName+'/')
  cmo.setStore(getMBean('/FileStores/AIADataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cmo.setServiceType('Sending-only')
  activate();
  i=i+1;
  j=j+1;
  k=k+1;

  
#Setting Cluster Address
def setClusterAddress():
 ClusterAddress = configProps.get('ClusterAddress');
 domainConfig();
 edit();
 startEdit()
 cd('/Clusters/'+clusterName+'/')
 cmo.setClusterAddress(ClusterAddress)
 activate()
domainName=cmo.getName();
serverList = cmo.getServers();
#Setting Log Rotation
def __changeLogRotationConfigProperties():
 domainConfig();
 RotationType = configProps.get('RotationType')
 RotationTime = configProps.get('RotationTime')
 FileTimeSpan = int(configProps.get('FileTimeSpan'))
 i = 0;
 edit();
 while i<len(serverList):
  startEdit();
  serverName = serverList[i].getName();
  cd('/Servers/'+serverName+'/WebServer/'+serverName+'/WebServerLog/'+serverName+'/')
  print 'Changing   '+serverName+' Log Rotation Parameters --> ' 
  cmo.setRotationType(RotationType)
  cmo.setRotateLogOnStartup(true)
  cmo.setRotationTime(RotationTime)
  cmo.setFileTimeSpan(FileTimeSpan)
  cd('/Servers/'+serverName+'/Log/'+serverName+'/')
  cmo.setRotationType(RotationType)
  cmo.setRotationTime(RotationTime)
  cmo.setFileTimeSpan(FileTimeSpan)
  i = i+1;
  activate();

#Setting MaxMessageSize
def __tuneMaxMessageSizeConfigProperties():
 domainConfig();
 MaxMessageSize = int(configProps.get('MaxMessageSize'))
 i = 0;
 edit();
 while i<len(serverList):
  startEdit();
  serverName = serverList[i].getName();
  cd('/Servers/'+serverName+'/')
  print 'Current   '+serverName+' MaxMessageSize Value --> ' 
  print cmo.getMaxMessageSize()
  cmo.setMaxMessageSize(int(MaxMessageSize))
  print 'Final   '+serverName+' MaxMessageSize Value --> '
  print cmo.getMaxMessageSize()
  i = i+1;
  activate();

  
# MAIN

#****************************************************************************

#

# Calling all the Methods here

print(' ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————')
print ('********************************************* Starting the changes *****************************************************')
print('#########################################################################################################################')
print 'Do you want to add managed servers and related resources'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 createManagedServersandResources()

print 'Do you want to create new SAF Agents.Do not execute for AABC domains'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 createNewSAFAgents() 
print 'Do you want to set Cluster Address'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 setClusterAddress()

print 'Do you want to change Log Rotation Configuration'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 __changeLogRotationConfigProperties() 
print 'Do you want to tune MaxMessageSizeConfig'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 __tuneMaxMessageSizeConfigProperties()  

#!/bin/bash

# ************* Setting the Environment ***********************
echo "Setting the Environment"
source /app/oracle/fmw/wlserver_10.3/server/bin/setWLSEnv.sh

echo "Environment has been set....."

# ************* Changing the directory***********************
cd .

echo "Calling the script....."

# ************* Calling the WLST script  *****************
java weblogic.WLST AddManagedServerToDomain.py

Thursday, December 11, 2014

Oracle BPEL using JMX and MBeans

Oracle BPEL using JMX n MBeans

About JMX:

JMX (Java Management Extension) is part of J2SE 5.0 and meant to programmatically  manage and monitor application resources, Service Oriented Networks and Systems objects.   Refer the Wiki : http://en.wikipedia.org/wiki/Java_Management_Extensions

About MBeans:

MBeans, short  form of MangedBeans are used to represent the resources in jvm, java applications and application servers  through java objects. So, with the combination of JMX (Java programming APIs) and MBeans (java objects that are representing the resources such as Transaction monitors, JDBC Drivers and Printers and many more) we can collect/extract statistics related to performance, resource usages, and many more for the resources running in JVM.  Refer the Wiki: http://en.wikipedia.org/wiki/Java_Management_Extensions#Managed_Bean

This blog is meant to give some pointers/apis to fetch the details of resources (such as BPEL Domains, BPEL Servers, BPEL Composites, BPEL Composite configurations etc) hosted in Weblogic application server.  Have fun …

Topic

1)- Get BPEL Domains and Managed servers (weblogic) using JAVA 
2)- Get BPEL Composites hosted on Weblogic server
3)- Get BPEL Composite revisions
4)- Get all callable services (references) of a given BPEL Composite

1)- How to get BPEL Domains, managed servers, their restart dates and status :

public class PPKBPELExtraction {
    //Make sure to define below properties based on your BPEL Domain/Manged server setups.
    String host;
    String port;
    String userName;
    String pwd;
    String webserverHost;
    String defaultDomain;
    String bpel_listner_port;
    String bpel_listner_host;

            JMXServiceURL jmxServiceURL = null;
       Hashtable<String,String> jmxJNDIProperties = new Hashtable<String, String>();     
       JMXConnector jmxConnector = null;
       MBeanServerConnection mBeanServerConnection = null;    
       Hashtable<String, String> mBeanQueryStrings = new Hashtable<String, String>();
       String uriForDomainConfig = "/jndi/weblogic.management.mbeanservers.domainruntime";
       JMXConnector jmxConnectorForDomainConfig = null;
       MBeanServerConnection mBeanServerConnectionForDomainConfig = null;
       Hashtable<String,String> jmxJNDIPropertiesForDomainConfig = new Hashtable<String, String>();       
       JMXServiceURL jmxServiceURLForDomainConfig = null;
       SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");

public void getDomainDetails() {
       writeToLog(" getDomainDetails() => ");
              try {                                    
                     jmxServiceURLForDomainConfig = new JMXServiceURL("t3",this.host,Integer.parseInt(this.port),uriForDomainConfig);
                     jmxJNDIPropertiesForDomainConfig.put(Context.SECURITY_PRINCIPALthis.userName);
                     jmxJNDIPropertiesForDomainConfig.put(Context.SECURITY_CREDENTIALSthis.pwd);
                     jmxJNDIPropertiesForDomainConfig.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES"weblogic.management.remote");                  
                     jmxConnectorForDomainConfig = JMXConnectorFactory.connect(jmxServiceURLForDomainConfigjmxJNDIPropertiesForDomainConfig);
                     mBeanServerConnectionForDomainConfig = jmxConnectorForDomainConfig.getMBeanServerConnection();
              } catch (Exception expGetDomainDetails) {
                     writeToLog("expGetDomainDetails : " + expGetDomainDetails.toString());
              }
              String queryString = "com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean";
       ObjectName domainObject = null;
       ObjectName domainObjectName = null;
       String domainName = null;
       Date activationDate = null;
              ObjectName[] serverObjects;
              int length = 0;
              String serverName;
              String serverState;
        
       try {
              ObjectName objectName = new ObjectName(queryString);
              Set<ObjectName> objectNameSet =mBeanServerConnectionForDomainConfig.queryNames(objectName, null);
              Iterator<ObjectName> objectNameSetIterator = objectNameSet.iterator();
              while (objectNameSetIterator.hasNext()){
                     domainObject = objectNameSetIterator.next();
                     domainObjectName = (ObjectName) mBeanServerConnectionForDomainConfig.getAttribute(domainObject,"DomainRuntime");
                     domainName = (String) mBeanServerConnectionForDomainConfig.getAttribute(domainObjectName,"Name");
                     activationDate = (Date) mBeanServerConnectionForDomainConfig.getAttribute(domainObjectName, "ActivationTime");
                     serverObjects = (ObjectName[]) mBeanServerConnectionForDomainConfig.getAttribute(domainObject,"ServerRuntimes");
                     length = serverObjects.length;
                     Vector<Server> tmpServer = new Vector<Server>();
                     for (int i = 0; i < length; i++) {
                         serverName = (String) mBeanServerConnectionForDomainConfig.getAttribute(serverObjects[i], "Name");
                         serverState = (String) mBeanServerConnectionForDomainConfig.getAttribute(serverObjects[i],"State");
                         tmpServer.add(new Server(domainName,serverName,null,serverState));
                     }
                     this.domains.add(new Domain(domainName, activationDate,this.type,tmpServer));
                     this.defaultDomain = domainName;
                     tmpServer = null;
                     domainObject = null;
              } 
              objectNameSetIterator = null;
              objectNameSet = null;
       } catch (Exception expDomain) {
              this.domains.add(new Domain(this.defaultDomain, (new Date()) ,"",null)); // Incase admin server is down.
              writeToLog("expDomain : " + expDomain.toString());
              writeToLog("Looks like Adminserver is having issues,  so defaulting Admin server activation date with sysdate");
       }
            try {
                     if (jmxConnectorForDomainConfig != null)
                           jmxConnectorForDomainConfig.close();
                           jmxJNDIPropertiesForDomainConfig = null;
                           jmxConnectorForDomainConfig = null;
                           mBeanServerConnectionForDomainConfig = null;
              } catch (Exception expClose) {
                     writeToLog("expClose : " + expClose.toString());
              }
              writeToLog(" <= getDomainDetails()");
    } 

2)- How to get bpel composites hosted in Weblogic managed server?

    public void fetchBPELComposite() {
        ObjectName compositeObjectName = null;
        String dn = null;
        Iterator<ObjectName> iterator = null;
        Set<ObjectName> queryObjectName = null;
        EndPoint endPoint = null;
        String compositeName = null
        String revision = null;
        String compositeName1 = null;
       try {
            ObjectName queryObject = new ObjectName("oracle.soa.config:j2eeType=SCAComposite,Application=soa-infra,*");
            queryObjectName = mBeanServerConnection.queryNames(queryObject, null);
            iterator = queryObjectName.iterator();

            while (iterator.hasNext()) {
              compositeObjectName = iterator.next();
              dn = (String) mBeanServerConnection.getAttribute(compositeObjectName, "DN");
              compositeName = (String) mBeanServerConnection.getAttribute(compositeObjectName, "Name");
            }
       } catch (Exception expGetBPELComposite) {
              writeToLog("getBPELComposite() " + expGetBPELComposite.toString());
       } finally {
            compositeObjectName = null;
            dn = null;
            iterator = null
            queryObjectName = null;
       }      
     }

3)- How to get the default revision of a BPEL Composite

=> In the below api DN is the Compsoite DN name (which you can obtain from Enterprise manager).
       public boolean defaultRevision(String dn) {
              boolean returnValue= false;
              ObjectName queryObject = null;
              ObjectName soaInfra = null;
              Object[] vInputs = {dn};
              String[] vTypes = {String.class.getName()};
              
              try {
                     queryObject = new ObjectName("oracle.soa.config:name=soa-infra,j2eeType=CompositeLifecycleConfig,Application=soa-infra,*");
                     Set<ObjectName> objectNameSet = mBeanServerConnection.queryNames(queryObject, null);
                     Iterator<ObjectName> iterator = objectNameSet.iterator();
                     while (iterator.hasNext()) {
                           soaInfra = iterator.next();
                           returnValue = (Boolean) mBeanServerConnection.invoke(soaInfra, "isDefaultCompositeRevision", vInputs, vTypes);
                     }
              }catch (Exception expIsDefaultRevision ) {
                     returnValue = false;
                     writeToLog("expIsDefaultRevision : "+ expIsDefaultRevision.toString());
              }
              return returnValue;
       }

4)- How to get the services (references) called from given BPEL Composite :

       public void bPELEndSCAReferences(EndPoint pEndPoint, String pCompositeName, String pRevision) {         
       StringBuffer querySB = newStringBuffer("oracle.soa.config:j2eeType=SCAComposite.SCAReference.SCABinding,wsconfigtype=ServiceRefMappingPortInfoConfig,revision=").append(pRevision).append(",Application=soa-infra,SCAComposite=\"");
       querySB.append(pCompositeName+"\",*");
       String query = querySB.toString().trim();
       ObjectName on = null;
       String referenceName = null;
       String referenceWSDL = null;
       Vector<EndPoint> ref = new Vector<EndPoint>();
       EndPoint reference = null;
       try {
              ObjectName qn = new ObjectName (query);
              Set<ObjectName> objectSet = mBeanServerConnection.queryNames(qn, null);
              Iterator<ObjectName> iterator = null;
              iterator = objectSet.iterator();
            while ((iterator != null) && (iterator.hasNext())) {
                 on = iterator.next();
                 referenceName = (String) mBeanServerConnection.getAttribute(on, "PolicySubjectName");
                 referenceWSDL = (String) mBeanServerConnection.getAttribute(on, "Location");
                 reference = new EndPoint(this.defaultDomain, referenceName,null,true,"http","REFERENCE",referenceName,this.rand.nextLong());
                 reference.monitorURL = referenceWSDL;
                 //writeToLog("Domain " + this.defaultDomain +" Composite " + " Reference:" + referenceName +"; wsdl:"+ referenceWSDL);
                 ref.add(reference);
              }             
       } catch (Exception exp) {
              writeToLog("PPK Exception in displayBPELEndSCAReferences()" + exp.toString());
              writeToLog("query string : " + query);
              writeToLog("composite : " + pCompositeName + pRevision);
       }
       if ((pEndPoint.references != null) && (pEndPoint.references.size() > 0))
              pEndPoint.references.addAll(ref);
       else
           pEndPoint.references = ref;
    }


 
Blogger Profile