Showing posts with label SOA Server Administration. Show all posts
Showing posts with label SOA Server Administration. Show all posts

Thursday, August 1, 2013

Cook book on Oracle SOA Suite 11g Performance Tuning


Currently reading a cook book on Oracle SOA Suite 11g Performance Tuning by Matt Brasier, Nicholas Wright. Interesting read as it brings together all the performance tuning/monitoring options under one roof. You can get it @ http://bit.ly/12lrajU

Thursday, March 29, 2012

B2B performance issues due to large payloads

My customer was having performance issues while processing big payloads in B2B.  The problem was that the B2B server was hanging whenever a large payload was getting processed at B2B gateway.  The customer wanted a resolution to this problem..
Analysis
-------------------
Whenever Oracle B2B is processing an EDI file, it stores EDI payload and XML file in lob segment in B2B_DATA_STORAGE table. For big files this log segment grows significantly and create b2b runtime problem.The server hangs due to this background process.

Solution
----------------------
Oracle B2B has largepayload support, in which payload will not get persisted in DB.’

Please refer B2B Documentation for more details


Inbound Setup
-----------------
 Large Payload Size is the property that needs to be set for inbound cases. 
Go to Administration > Configuration.

Description of Figure A-1 follows

If a composite is deployed to handle the large payload, this is the only configuration needed. If B2B is not delivering the payload to a composite, set Use JMS Queue as default to true
 Go to Administration > Configuration.

Description of Figure A-2 follows

With Use JMS Queue as default set to true, the payload is delivered to B2B_IN_QUEUE, a JMS-based queue.


Hope this helps

Friday, September 16, 2011

Weblogic:Classloading and Classloader Analysis Tool


There is a Classloading Analysis Tool(CAT) provided in Weblogic server(PS3) which helps you to monitor the class loading pattern that happens with an application. It helps you in identifying any class loading issues that can happen due to different java classes that are duplicated with different libraries. To understand the use of CAT, you should first know the class loading pattern in Weblogic.
Classloading in Weblogic happens in different levels.The below image shows the hierarchy in which the class loading happens
System classloader is the top-level classloader that loads the WebLogic implementation classes and supporting libraries defined on the classpath (those added to setDomanEnv and commEnv) 
Domain level classloader is a child to the SYSTEM classloader and loads libraries that are included in the domain lib directory.
Application level classloader is the next in order.  WebLogic Server automatically creates a hierarchy of classloaders when an application is deployed. The root classloader in this hierarchy is the APPLICATION classloader and it loads modules defined in the application, including EJBs, as well as java EE shared libraries and libraries included in the configured library directories for the application.
For each web application, a child class loader is created and it loads the shared Java EE libraries as well as the libraries and compiled classes in the WEB-INF folder.

What happens if the CAT find issues in the class loading pattern of the application
WebLogic has  a feature called the Filtering ClassLoader which overrides the TOP-DOWN classloading and essentially enables child-first classloading.  When filter is enabled, priority is given to the resources from the child of the FilteringClassLoader (an application classloader) before the ones from the system classloader . This will be mainly used when the version used by systme class loader or top level class loaders are different from the one required by the application.
Usage(in weblogic.xml)
<prefer-application-packages>
          <package-name>geo.*</package-name>
</prefer-application-packages>


How to use  CAT?
Login to http://host:port/wls-cat/ and enter your credentials.


- Analyze classloading conflicts
- View the system and application classloaders
- Generate reports



CAT will suggest you solutions to overcome the conflicts which is also a good feature.
Below references give you detailed explanation on weblogic class loading as well as fetures involved in CAT tool.
References: 
  1. CAT tool
  2. Class Loading by Jeff West






Tuesday, August 23, 2011

Advanced Weblogic Scripting(WLST) with Record functionality


            Weblogic Console has been a really good tool for administrating all server related configurations. One of the innovative features I liked in weblogic console was the Record option. It’s an amazing utility that allows us to capture the steps involved in server configuration. The recording gets stored as a collection of WLST commands that got executed behind the scenes in a python script file.
The Recording option can be made automatic based on the Preferences. It starts recording when you obtain a lock on the domain configuration and stops recording when you activate your changes, undo your changes, release the lock, or lose the lock. This feature is not available when "Automatically Acquire Lock and Activate Changes" (under "User Preferences") is enabled. When this is disabled we can have the manual Record option.


Here I will show you the WLST script that gets generated when we create a datasource.
Recorded Script
cd('/')
cmo.createJDBCSystemResource('TestDS1')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1')
cmo.setName('TestDS1')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCDataSourceParams/TestDS1')
set('JNDINames',jarray.array([String('jdbc/TestDS1')], String))

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCDriverParams/TestDS1')
cmo.setUrl('jdbc:oracle:thin:@localhost:1521:XE')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
setEncrypted('Password', 'Password_1314091630125', 'C:/ Oracle/Middleware/SOA11gPS3/user_projects/domains/soa_domain/Script1314091383906Config', 'C:/Oracle/Middleware/SOA11gPS3/user_projects/domains/soa_domain/Script1314091383906Secret')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCConnectionPoolParams/TestDS1')
cmo.setTestTableName('SQL SELECT 1 FROM DUAL\r\n\r\n')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCDriverParams/TestDS1/Properties/TestDS1')
cmo.createProperty('user')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCDriverParams/TestDS1/Properties/TestDS1/Properties/user')
cmo.setValue('DEV_TestDB')

cd('/JDBCSystemResources/TestDS1/JDBCResource/TestDS1/JDBCDataSourceParams/TestDS1')
cmo.setGlobalTransactionsProtocol('TwoPhaseCommit')

cd('/SystemResources/TestDS1')
set('Targets',jarray.array([], ObjectName))

activate()

Modified  Script - Parameterized

wlURL = raw_input('Enter server URL:')
wlUserName = raw_input('Enter weblogic username:')
wlPassword = raw_input('Enter weblogic password:')
dsName = raw_input('Enter JDBC resource name:')
jndiName = raw_input('Enter JDBC JNDI name:')
dbURL = raw_input('Enter JDBC DB url:')
dsUsername= raw_input('Enter DB username:')
dsPassword=raw_input('Enter DB password:')

connect(wlUserName, wlPassword, wlURL)
edit()
startEdit()

cd('/')
cmo.createJDBCSystemResource(dsName)

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName)
cmo.setName(dsName)

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDataSourceParams/'+dsName)
set('JNDINames',jarray.array([String(jndiName)], String))

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName)
cmo.setUrl(dbURL)
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setPassword(dsPassword)

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
cmo.setTestTableName('SQL SELECT 1 FROM DUAL\r\n\r\n')

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName)
cmo.createProperty('user')

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/user')
cmo.setValue(dsUsername)

cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDataSourceParams/'+dsName)
cmo.setGlobalTransactionsProtocol('TwoPhaseCommit')

cd('/SystemResources/'+dsName)
set('Targets',jarray.array([], ObjectName))

activate()

How to run the script
  1. Go to the Domain bin folder and run setDomainEnv.sh script
  2. Run  >> java weblogic.WLST  /tmp/geo/CreateDataSourceScript.py

Execution StackTrace
>>>java weblogic.WLST D:\CreateDataSourceScript.py

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Enter server URL:t3://localhost:7001
Enter weblogic username:weblogic
Enter weblogic password:welcome1
Enter JDBC resource name:TestDS4
Enter JDBC JNDI name:jdbc/TestDS4
Enter JDBC DB url:jdbc:oracle:thin:@localhost:1521:XE
Enter DB username:DEV_TestDB
Enter DB password:welcome1
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'soa_domain'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().

For more help, use help(edit)
You already have an edit session in progress and hence WLST will
continue with your edit session.

Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed

That’s it for today. thanks to below references.
References:
  1. Advanced WebLogic Scripting with WLST: Recording, Editing and Reusing
  2. Using the Console to Create Repeatable Configuration Scripts