Tuesday, April 29, 2014

Unable to get schema information for source - JDeveloper

I was getting the error "Unable to get schema information for source" while generating the XSL mapper file in the BPEL Transform activity through JDeveloper. The same error was coming while editing the existing mapper file in a transform activity with the same source variable.


But the component is getting deployed successfully and also the flows are working fine without any issue.

After the analysis i found that there is two schema's imported with the same name space into the wsdl and one of the them is used to create the message type for the source variable in the transformation.


To resolve the issue you can follow any one of the below approaches

  •  Make sure the schema's are imported with different name space or create a consolidated schema and import the same 
  • Include the schema's that has the same names instead of importing them into the wsdl.



Setting the XA Transaction timeout values for a datasource in weblogic server through WLST script

This post explain the approach to set some of the important timeout properties for XA datasources in weblogic server through WLST script.

Set XA Transaction Timeout:
Enables WebLogic Server to set a transaction branch timeout based on the value for XaTransactionTimeout.

When enabled, the WebLogic Server Transaction Manager calls XAResource.setTransactionTimeout() before calling XAResource.start, and passes either the XA Transaction Timeout value or the global transaction timeout.

XA Transaction Timeout:
The number of seconds to set as the transaction branch timeout.
If set, this value is passed as the transaction timeout value in the XAResource.setTransactionTimeout() call on the XA resource manager, typically the JDBC driver.

When this value is set to 0, the WebLogic Server Transaction Manager passes the global WebLogic Server transaction timeout in seconds in the method.

If set, this value should be greater than or equal to the global WebLogic Server transaction timeout.

XA Retry Duration:
Determines the duration in seconds for which the transaction manager will perform recover operations on the resource. A value of zero indicates that no retries will be performed.

XA Retry Interval:

The number of seconds between XA retry operations if XARetryDurationSeconds is set to a positive value.

SetXATimeoutProperties.py

def setXATimeoutProperties():
   dsName='SOADataSource'
   edit()
   startEdit()
       
   server='AdminServer'
   cd("Servers/"+server)
   target=cmo
 
   print '========================================='
   print 'Setting the timeout properties for DataSource....'
   print '========================================='  
           
   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaSetTransactionTimeout(true)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaTransactionTimeout(3000)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaRetryDurationSeconds(300)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaRetryIntervalSeconds(60)

   save()
   activate()

   print 'Timeout settings for the datasource '+dsName+' has been completed'
 
 
def main():
     
    adminURL='t3://10.30.34.216:8000'
    adminUserName='weblogic'
    adminPassword='reuters123'
    connect(adminUserName, adminPassword, adminURL)
    setXATimeoutProperties()
    disconnect()

     

main()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh SetJDBCTimeoutProperties.py

Restart the server after successful execution.




Monday, April 28, 2014

Setting the JDBC Connection timeout properties in weblogic server through WLST

There are different timeout properties in JDBC connection, this post explain the approach to set some of the important JDBC Connection timeout properties in weblogic server through WLST script.

Inactive Connection Timeout:
The number of inactive seconds on a reserved connection before WebLogic Server reclaims the connection and releases it back into the connection pool.
You can use the Inactive Connection Timeout feature to reclaim leaked connections - connections that were not explicitly closed by the application.

Connection Reserve Timeout:
The number of seconds after which a call to reserve a connection from the connection pool will timeout.
When set to 0, a call will never timeout.
When set to -1, a call will timeout immediately.

Statement Timeout:
The time after which a statement currently being executed will time out.
A value of -1 disables this feature.
A value of 0 means that statements will not time out.

oracle.jdbc.ReadTimeout:
The property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. 
oracle.net.READ_TIMEOUT for jdbc versions < 10.1.0.5 oracle.jdbc.ReadTimeout for jdbc versions >=10.1.0.5

oracle.net.CONNECT_TIMEOUT:
The property oracle.net.CONNECT_TIMEOUT helps to set the login time out in Oracle.

SetJDBCTimeoutProperties.py
def setJDBCTimeoutProperties():
   dsName='CRM6EAIReference'
   edit()
   startEdit()
       
   server='AdminServer'
   cd("Servers/"+server)
   target=cmo
 
   print '========================================='
   print 'Setting the timeout properties for DataSource....'
   print '========================================='  
           
   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName)
   #cmo.destroyProperty(getMBean('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.net.CONNECT_TIMEOUT'))
   cmo.createProperty('oracle.net.CONNECT_TIMEOUT')

   #cmo.destroyProperty(getMBean('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.jdbc.ReadTimeout'))
   cmo.createProperty('oracle.jdbc.ReadTimeout')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.net.CONNECT_TIMEOUT')
   cmo.setValue('10000')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.jdbc.ReadTimeout')
   cmo.setValue('20000')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setInactiveConnectionTimeoutSeconds(120)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setConnectionReserveTimeoutSeconds(30)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setStatementTimeout(120)

   save()
   activate()

   print 'Timeout settings for the datasource '+dsName+' has been completed'
 
 
def main():
     
    adminURL='t3://localhost:8000'
    adminUserName='weblogic'
    adminPassword='welcome1'
    connect(adminUserName, adminPassword, adminURL)
    setJDBCTimeoutProperties()
    disconnect()

     

main()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh SetJDBCTimeoutProperties.py



Sunday, April 27, 2014

Purging the OSB Alerts

The History of  Alerts in OSB can be purged through OSB console.

Make sure you are purging the alerts regularly otherwise you may face some of the  the issues like

  • The server will take more time to start
  • The alert dashboard will become very slow.

Login to sbconsole and click on Operations-->Monitoring-->Dashboard
Click on Extended Alert History


Click on "Purge SLA Alerts History"




Saturday, April 26, 2014

A timeout occurred while interacting with sever. Limited information is available - Weblogic

 We were getting the error "A timeout occurred while interacting with Server. Limited information is available" while accessing the Server Page from the admin console in clustered weblogic environment and the health of the server is shown as empty but the state is shown as running.
Login to the admin console and accessing the Server page also was taking more time
But the individual servers and the node managers are running fine in all the nodes.


The issue seems to be because of the delay in the communication between the node manager and the managed servers.

To Resolve the issue:

  • Stop all the managed servers from all the nodes.
  • Kill the node managers from all the nodes.
  • Stop the Admin server.
  • Start the node manager in all the nodes.
  • Start the Admin server.
  • Start all the managed server.



Purging Application Not Available - Oracle OSB

While we are trying to purge the reports from OSB sbconsole we may get the following message in the console.

"Purging Application Not Available.Message Reporting Purger is not deployed, or it is not active"





The issue is due to the the application "Message Reporting Purger" might not be deployed or not in active state.

Verify the application is active from the admin console. If the application is not deployed then deploy the application 
from the following location oracle/product/soa/11g/fmw/Oracle_OSB/lib/common/msgpurger. ear with the application name 
"Message Reporting Purger"





Configuring Proxy Sever for OSB

Sometimes we may required to use the Proxy server in OSB for outbound communication.

The Proxy Server can be configured to the Business Service as below.

Configure the Proxy Server:

The first step is we have to configure the Proxy server in the OSB global resources.

Login to OSB an click on System Administration and Proxy Servers in the Global resources section.
Click on Add button

Enter the Proxy server details and click on Add button in the Host-Port Parameters section.
If the the authentication is required then provide the username/password.
Save the configurations.


Wednesday, April 23, 2014

Error while creating datasource using WLST - java.lang.ClassCastException

When we are creating the datasource through WLST script in weblogic server may may receive the following exception in create method.

Creating DataSource:  EAISOAMetadataSource  ....
Problem invoking WLST - Traceback (innermost last):
  File "/reuters/oracle/as01/wlst/GridLinkDatasourceCreation.py", line 115, in ?
  File "/reuters/oracle/as01/wlst/GridLinkDatasourceCreation.py", line 108, in main
  File "/reuters/oracle/as01/wlst/GridLinkDatasourceCreation.py", line 39, in createGridLinkJDBCResources
  File "<iostream>", line 528, in create
        at weblogic.management.scripting.EditHandler.create(EditHandler.java:531)
        at weblogic.management.scripting.WLScriptContext.create(WLScriptContext.java:332)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.ClassCastException: java.lang.ClassCastException: java.lang.reflect.InvocationTargetException cannot be cast to weblogic.management.scripting.ScriptException

I colud not able to find the exact root cause but able to resolve the issue "Undo All Changes" from weblogic console and re-exectiong the script.

Login to weblogic admin console
Verify whether any changes are pending to be activated.
Perform Activate Changes or Undo All Changes


Re-execute the script, this time script will create the datasource successfully.


Different approaches for connecting Weblogic Server to RAC database

Oracle Real Application Clusters (RAC) is a software component you can add to a high-availability solution that enables users on multiple machines to access a single database with increased performance. RAC comprises two or more Oracle database instances running on two or more clustered machines and accessing a shared storage device via cluster technology.


If your application requires load balancing across RAC nodes, WebLogic Server supports this capability through use of Using Connect-Time Load Balancing/Failover with Oracle RAC(JDBC URL based Load Balancing/Failover), JDBC Multi Data sources with Oracle RAC nodes and Gridlink Data Source.

Multi Data Source:

Refer the below URL's for details on Multi Data Source.

http://www.albinsblog.com/2012/02/jdbc-multi-data-sources-in-weblogic.html#.U1YNuvmukdQ
http://www.albinsblog.com/2012/02/creating-jdbc-multi-data-source-through.html

Connect-Time Load Balancing/Failover with Oracle RAC(JDBC URL based Load Balancing/Failover):

The JDBC connection string can be configure with single data source to support the load balancing and failover with RAC data source nodes.
Create a Generic Data source in weblogic server and provide the JDBC URL as below.Enable and disable the load balancing and failover accordingly.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS=(PROTOCOL=tcp)(HOST=RAC node1)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=RAC node2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=servicename)))

There are some limitation using this approach like the Global XA transactions are not supported.



Creating the Gridlink data source through WLST script

The below WLST script will help as to create a GridLink datasource in weblogic server.

GridLinkDataSource.properties

dbURL=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)HOST=dbhost1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SERVICENAME)))

connectionpool.test.query=SQL SELECT * FROM DUAL
connectionpool.driver.class=oracle.jdbc.OracleDriver
connectionpool.username=SOA_EAIOWNER
connectionpool.password=orasoa11g
connectionpool.initCapacity=10
connectionpool.maxCapacity=60
datasource.name=EAISOAMetadataSource
datasource.jndi.name=eai/ds/EAISOAMetadataSource
datasource.target=Servers/AdminServer

domain.AdminIP=localhost
domain.AdminPort=8000

domain.AdminPasswd=welcome1

GridLinkDatasourceCreation.py

from java.io import FileInputStream

def createGridLinkJDBCResources(configProps):
   edit()
   startEdit()
       
   server='AdminServer'
   cd("Servers/"+server)
   target=cmo
   cd("../..")
   print '========================================='
   print 'Creating GridLink DataSource....'
   print '========================================='
   dsTestQuery=configProps.get("connectionpool.test.query")
   dsDriverName=configProps.get("connectionpool.driver.class")
 
           
   cd('/')
   dsURL= configProps.get("dsURL")          
   dsUserName = configProps.get("connectionpool.username")
   dsPassword = configProps.get("connectionpool.password")
   initCapacity = configProps.get("connectionpool.initCapacity")
   maxCapacity = configProps.get("connectionpool.maxCapacity")
   dsName = configProps.get("datasource.name")
   jndiname = configProps.get("datasource.jndi.name")
   datasourceTargets = configProps.get("datasource.target").split(",")

   print 'dsUserName',dsUserName
   print 'dsPassword',dsPassword
   print 'initCapacity',initCapacity
   print 'maxCapacity',maxCapacity
   print 'dsName',dsName
   print 'jndiname',jndiname
   print 'datasourceTargets',datasourceTargets

   print 'Creating DataSource: ',dsName,' ....'
 
   myResourceName = dsName  
   jdbcSystemResource = create(myResourceName,"JDBCSystemResource")    
   myFile = jdbcSystemResource.getDescriptorFileName()    
   jdbcResource = jdbcSystemResource.getJDBCResource()    
   jdbcResource.setName(myResourceName)  
 
 

   # Create the DataSource Params    
   dpBean = jdbcResource.getJDBCDataSourceParams()    
   myName=jndiname
   dpBean.setJNDINames([myName])
   dpBean.setGlobalTransactionsProtocol('TwoPhaseCommit')
   
   # Create the Driver Params    
   drBean = jdbcResource.getJDBCDriverParams()    
   drBean.setPassword(dsPassword)    
   drBean.setUrl(dsURL)    
   drBean.setDriverName(dsDriverName)

   #Create the Oracle params
   orapr=jdbcResource.getJDBCOracleParams()
   orapr.setFanEnabled(true)
   orapr.setOnsNodeList('node1:6200,node2:6200')
   propBean = drBean.getProperties()
   driverProps = Properties()    
   driverProps.setProperty("user",dsUserName)    
   e = driverProps.propertyNames()    
   while e.hasMoreElements() :            
  propName = e.nextElement()            
  myBean = propBean.createProperty(propName)          
  myBean.setValue(driverProps.getProperty(propName))  
 
   # Create the ConnectionPool Params    
   ppBean = jdbcResource.getJDBCConnectionPoolParams()    
   ppBean.setInitialCapacity(int(initCapacity))    
   ppBean.setMaxCapacity(int(maxCapacity))    
   ppBean.setTestConnectionsOnReserve(true)    
   ppBean.setTestTableName('SQL SELECT 1 FROM DUAL')

   xaParams = jdbcResource.getJDBCXAParams()    
   xaParams.setKeepXaConnTillTxComplete(1)  

   # Add Target
   for datasourceTarget in datasourceTargets:
print 'DataSourceTargets',datasourceTargets
print 'DataSourceTarget',datasourceTarget
if datasourceTarget=='':
  print ''
else:
  jdbcSystemResource.addTarget(getMBean(datasourceTarget))  
 

   print 'DataSource: ',dsName,', has been created Successfully !!!'
   print '========================================='  
       
 
   save()
   activate()  


 
def main():
    propInputStream1 = FileInputStream("GridLinkDataSource.properties")
    configProps = util.Properties()
    configProps.load(propInputStream1)
 
    adminURL='t3://'+configProps.get('domain.AdminIP')+':'+configProps.get('domain.AdminPort')
    adminUserName='weblogic'
    adminPassword=configProps.get("domain.AdminPasswd")
    connect(adminUserName, adminPassword, adminURL)

 
    createGridLinkJDBCResources(configProps);
 
    print 'Successfully created JDBC resources for SOACoreDomain'

    disconnect()

     
main()



Monday, April 21, 2014

Oracle SOA Suite 11g – Getting the payload from the Composite instance - Part2

In the previous post Oracle SOA 11g – Getting the payload from the Composite instance - Part1 - Through Java API i explained how to get the Oracle SOA Suite composite instance payload through JAVA API. In the previous approach we are getting the full audit trail of the instance and the required input payloads are retrieved using DOM parser and XPath expressions.For the larger payloads this approach fails to retrieve the payload.

In this post i am explaining the approach to get the Binary payload data from the database by executing the SQL statement and parsing the same to string message.

In Oracle SOA 11g the input payload related to the composite instances(input  to the composite and all the input payload send to the references) are stored in INSTANCE_PAYLOAD(the actual XML payload is kept in XML_DOCUMENT table) table.

By querying the INSTANCE_PAYLOAD, XML_DOCUMENT and COMPOSITE_INSTANCE we can retrieve the binary input payload for a particular composite instance.After receiving the XML payload as binary we can use the java code to transform the same to string format.

import java.io.StringWriter;
import java.sql.*;
import java.util.Hashtable;
import javax.naming.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import oracle.xml.binxml.*;
import oracle.xml.parser.v2.*;
import oracle.xml.scalable.InfosetReader;

public class GetPayload {
    public static Connection getConnection() throws Exception {
        Context ctx = null;
        Hashtable ht = new Hashtable();
        ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
        ht.put(Context.PROVIDER_URL, "t3://localhost:8000");
        ctx = new InitialContext(ht);
        javax.sql.DataSource ds =(javax.sql.DataSource)ctx.lookup("jdbc/SOADataSource");
        return ds.getConnection();
    }

    public static String getPayload() {
        Statement stmt = null;
        Connection connection = null;
        ResultSet rs = null;
        String query =
            "select xmldoc.document DOC " + "from xml_document xmldoc,instance_payload inspay,composite_instance cmpins " +
            "where xmldoc.document_id = inspay.payload_key " +
            "and inspay.instance_id = cmpins.id " +
            "and inspay.instance_type='composite' " +
            "and xmldoc.DOCUMENT_TYPE = 2 " +
            "and inspay.instance_id = 7648669";      
   
        String payload = "";
        XMLDocument doc = null;
        try {
            connection = getConnection();
            stmt = connection.createStatement();
            rs = stmt.executeQuery(query);
            XMLDOMImplementation xmldomimpl = new XMLDOMImplementation();
            while (rs.next()) {                    
                BinXMLProcessor xmlprocessor =BinXMLProcessorFactory.createProcessor();
                BinXMLStream xmlstream =xmlprocessor.createBinXMLStream(rs.getBlob("DOC"));
                BinXMLDecoder xmldecoder = xmlstream.getDecoder();
                InfosetReader xmlreader = xmldecoder.getReader();
                doc = (XMLDocument)xmldomimpl.createDocument(xmlreader);
                TransformerFactory tf = TransformerFactory.newInstance();
                Transformer transformer;
                transformer = tf.newTransformer();
                transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"yes");
                StringWriter writer = new StringWriter();
                transformer.transform(new DOMSource(doc),new StreamResult(writer));
                payload =writer.getBuffer().toString().replaceAll("<", "&lt;").replaceAll(">","&gt;");      
           }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (rs != null)
                    rs.close();
                if (stmt != null)
                    stmt.close();
                if (connection != null)
                    connection.close();
            } catch (Exception e) {

            }
        }
        return payload;

    }
}

Use the xmlparserv2.jar file from the following location $MIDDLE_HOME/oracle_common/modules/oracle.xdk_11.1.0(the xmlparserv2.jar downloaded from Google may not have some of the class files included)


Enable the ClusterConstraints in weblogic server - Oracle SOA Suite 11g

Enable the ClusterConstraints in weblogic server - Oracle SOA Suite 11g :

It is possible to change WebLogic Server’s default deployment behavior for clusters by setting the ClusterConstraintsEnabled option when starting the WebLogic Server domain. The ClusterConstraintsEnabled option enforces strict deployment for all servers configured in a cluster. A deployment to a cluster succeeds only if all members of the cluster are reachable and all can deploy the specified files.

This post will explain the different approaches to change Cluster Constraint.

Through EM console:
Login to EM console 
Right click on soa-infra-->Admiistration-->System MBean browser
Enter com.bea:Name=SOACoreDomain,Type=Domain in the MBean browser filter and click ok


Change the ClusterConstraintEnabled attribute accordingly and click on Apply button




Getting the XML form AUDIT_DETAILS table through Java- Oracle SOA Suite 11g

In Oracle SOA Suite 11g when the Audit trail sizeof the BPEL instance is more then the configured Threshold value then the audit trails are stored in AUDIT_DETAILS table.The single instance will have multiple audit details.


The XML documents in the AUDIT_DETAILS are compressed, this post will explain how to retrieve the XML documents from AUDIT_DETAILS through java.

package getpayloadweb;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;

public class GetPayload {
    public GetPayload() {
        super();
    }

    public static Connection getConnection() throws Exception {
        Context ctx = null;
        Hashtable ht = new Hashtable();
        ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
        ht.put(Context.PROVIDER_URL, "t3://localhost:8000");
        ctx = new InitialContext(ht);
        javax.sql.DataSource ds =(javax.sql.DataSource)ctx.lookup("jdbc/SOADataSource");
        return ds.getConnection();
    }

    public static String getPayload() {
        Statement stmt = null;
        Connection connection = null;
        ResultSet rs = null;
     
     String query="select  UTL_COMPRESS.LZ_UNCOMPRESS(b.bin) DOC from audit_details b where cikey='5148077' and rownum<2";
     
        String payload = "";
        try {
            connection = getConnection();
            stmt = connection.createStatement();
            rs = stmt.executeQuery(query);
           while (rs.next()) {
                 
                 Blob blob=rs.getBlob("DOC");
                  byte[] sdata = blob.getBytes(1, (int) blob.length());;
                  payload = new String(sdata);
         
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (rs != null)
                    rs.close();
                if (stmt != null)
                    stmt.close();
                if (connection != null)
                    connection.close();
            } catch (Exception e) {

            }
        }
        return payload;

    }
}



Friday, April 18, 2014

Increasing the performance of EM console in Oracle SOA Suite 11g - Part2

The post https://www.albinsblog.com/2012/04/increasing-performance-of-em-console-in.html#.U1D_JvmukdQ explains some of the steps to improve the EM console performance in Oracle SOA Suite 11g  .

Here some more additional steps to improve the EM console performance.

The EM conolse uses the Dynamic  Monitoring System(DMS) module to collect the metrics from all the DMS enabled targets.
If the frequency of the DMS collection is to fast then the EM console will become slow.

To increase the frequency of the DMS collection, increase the value of intervalSeconds in the $MIDDLEWARE_HOME/oracle_common/modules/oracle.dms_11.1.1/server_config.xml file to higher value.

 <collectorConfiguration>
    <prefetch intervalSeconds="15" removeCycle="2" isDefault="true"/>
    <prefetch intervalSeconds="300" removeCycle="3"/>
    <discover intervalSeconds="180"/>
  </collectorConfiguration>

to

 <collectorConfiguration>
    <prefetch intervalSeconds="15" removeCycle="2" isDefault="true"/>
    <prefetch intervalSeconds="300" removeCycle="3"/>
    <discover intervalSeconds="600"/>
  </collectorConfiguration>


Target the DMS application only to the SOA servers.




DMS Spy Servlet - Monitoring Oracle Fusion Middleware

This post will explain how to monitor Oracle Fusion Middleware through DMS Spy Servlet

The DMS Spy servlet provides access to DMS metric data from a web browser. Data that is created and updated by DMS-enabled applications and components is accessible through the DMS Spy Servlet.

The DMS Spy Servlet is part of the DMS web application. The DMS web application's web archive file is dms.war, and can be found in the same directory as dms.jar: <ORACLE_HOME>/modules/oracle.dms_11.1.1/dms.war.

The DMS web application is deployed by default as part of a JRF-enabled server instance. The URL is: http://host:port/dms/Spy.

Only users who have Administrator role access can view this URL as access is controlled by standard Java EE elements in web.xml.

This can be used to monitor SOA Composites, SOA Components, JVM, Datasources and MDS etc..




SOAWorkManager - Tuning the SOA Engine


While installing Oracle SOA Suite into weblogic server a work manager wm/SOAWorkManager of type Global Work Manager will be created.


SOAWorkManager is a empty workmanager created and targeted to the all the servers in the SOA cluster.




  • Request Classes - A request class expresses a scheduling guideline that WebLogic Server uses to allocate threads to requests. Request classes help ensure that high priority work is scheduled before less important work, even if the high priority work is submitted after the lower priority work.Request classes define a best effort. 
  • max-threads-constraint—Limits the number of concurrent threads executing requests from the constrained work set. The default is unlimited. We can define a max-threads-constraint in terms of a the availability of the resource that requests depend upon, such as a connection pool.Once the constraint is reached the server does not schedule requests of this type until the number of concurrent executions falls below the limit. The server then schedules work based on the fair share or response time goal.
  • min-threads-constraint—Guarantees the number of threads the server will allocate to affected requests to avoid deadlocks. 
  • capacity—Causes the server to reject requests only when it has reached its capacity. The default is -1. Note that the capacity includes all requests, queued or executing, from the constrained work set. Work is rejected either when an individual capacity threshold is exceeded or if the global capacity is exceeded. 

To tune the SOA engine the parameters of the SOAWorkManager has to be set based on the server capacity and connection pool capacity.


Configuring the DefaultFileStore for TLOGS in weblogic server through WLST script

The below script will help us to set the shared location to the tlogs for the weblogic servers in a domain.

import sys

print "@@@ Starting the script ..."

from java.util import *
from javax.management import *
from java.io import FileInputStream

print "@@@ Starting the script ..."
global props
 
#The directory of the domain configuration
#/app/oracle/products/11g/admin/domains
wlsDomain=os.environ["WLSDOMAIN"]
print "WLSDOMAIN="+wlsDomain


adminURL='t3://'+domainProps.get('domain1.AdminIP')+':'+domainProps.get('domain1.AdminPort')
adminUserName='weblogic'
adminPassword=domainProps.get("domain1.AdminPasswd")
connect(adminUserName, adminPassword, adminURL)

edit()
startEdit()

adminserverDir = File(wlsDomain+'/SOACoreDomain/soa_cluster/tlogs')
bool = adminserverDir.mkdirs()

cd('/Servers/SOA1/DefaultFileStore/SOA1')
cmo.setDirectory(wlsDomain+'/SOACoreDomain/soa_cluster/tlogs')

cd('/Servers/SOA2/DefaultFileStore/SOA2')
cmo.setDirectory(wlsDomain+'/SOACoreDomain/soa_cluster/tlogs')

cd('/Servers/SOA3/DefaultFileStore/SOA3')
cmo.setDirectory(wlsDomain+'/SOACoreDomain/soa_cluster/tlogs')

save()
activate()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh DomainLogConfigurtionChange.py




Thursday, April 17, 2014

Migrating the JMS file store to DB store through WLST script in weblogic server- Oracle SOA Suite 11g

The below script will help us to migrate the JMS file store to DB store through WLST script  in weblogic server- Oracle SOA Suite 11g. Before executing this script the required data source here EAIJMSDataSource should be created pointing to the database schema created for JMS.
For clustered environment the same should be executed for all the servers in the cluster with unique JDBC store name(e.g WseeJaxwsJDBCStore1 for server 1 and WseeJaxwsJDBCStore2 for server 2).

import sys

print "@@@ Starting the script ..."

from java.util import *
from javax.management import *

#The directory of the domain configuration
#/app/oracle/products/11g/admin/domains
wlsDomain=os.environ["WLSDOMAIN"]
print "WLSDOMAIN="+wlsDomain


adminURL='t3://'+domainProps.get('domain1.AdminIP')+':'+domainProps.get('domain1.AdminPort')
adminUserName='weblogic'
adminPassword=domainProps.get("domain1.AdminPasswd")
connect(adminUserName, adminPassword, adminURL)
edit()
startEdit()
############# JDBC stores for STANDALONE ADMINSERVER
cd('/')

cmo.createJDBCStore('WseeJaxwsJDBCStore')
cd('/JDBCStores/WseeJaxwsJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('WseeJaxws')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJDBCStore('UMSJMSJDBCStore')
cd('/JDBCStores/UMSJMSJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('UMSJMS')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJDBCStore('SOAJMSJDBCStore')
cd('/JDBCStores/SOAJMSJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('SOAJMS')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJDBCStore('JDBCStore')
cd('/JDBCStores/JDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('rmjdbcstore')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJDBCStore('WseeJDBCStore')
cd('/JDBCStores/WseeJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('Wsee')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJDBCStore('BPMJMSJDBCStore')
cd('/JDBCStores/BPMJMSJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/EAIJMSDataSource'))
cmo.setPrefixName('BPMJMS')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

#### end of creating jdbc stores

############Set Persistent Stores for all the JMS Servers

cd('/Deployments/WseeJaxwsJmsServer')
cmo.setPersistentStore(getMBean('/JDBCStores/WseeJaxwsJDBCStore'))


cd('/Deployments/UMSJMSServer')
cmo.setPersistentStore(getMBean('/JDBCStores/UMSJMSJDBCStore'))


cd('/Deployments/BPMJMSServer')
cmo.setPersistentStore(getMBean('/JDBCStores/JDBCStore-0'))


cd('/Deployments/SOAJMSServer')
cmo.setPersistentStore(getMBean('/JDBCStores/SOAJMSJDBCStore'))


cd('/Deployments/wlsbJMSServer')
cmo.setPersistentStore(getMBean('/JDBCStores/JDBCStore'))


cd('/Deployments/WseeJmsServer')
cmo.setPersistentStore(getMBean('/JDBCStores/WseeJDBCStore'))

##### Set the persistent stores for all SAF agents
cd('/SAFAgents/ReliableWseeJaxwsSAFAgent')
cmo.setStore(getMBean('/JDBCStores/WseeJaxwsJDBCStore'))

cd('/SAFAgents/ReliableWseeSAFAgent')
cmo.setStore(getMBean('/JDBCStores/WseeJDBCStore'))

#################DESTROY ALL THE FILE STORES

cd('/')
cmo.destroyFileStore(getMBean('/FileStores/WseeJaxwsFileStore'))
cmo.destroyFileStore(getMBean('/FileStores/UMSJMSFileStore'))
cmo.destroyFileStore(getMBean('/FileStores/SOAJMSFileStore'))
cmo.destroyFileStore(getMBean('/FileStores/BPMJMSFileStore'))
cmo.destroyFileStore(getMBean('/FileStores/WseeFileStore'))
cmo.destroyFileStore(getMBean('/FileStores/FileStore'))

save()
activate()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh MigrateJMSFiletoJDBCStore.py

Restart the servers, the required tables({PrefixName}WLStore) will be created if the tables are not created already.



Updating the Graceful Shutdown parameters in weblogic server through WLST script.

The script will help us to update the Graceful Shutdown parameter for the servers in the weblogic domain.

UpdateGracefulShutdownParameters.py

def conn():

    try:              
            adminURL='t3://'+domainProps.get('domain1.AdminIP')+':'+domainProps.get('domain1.AdminPort')
            adminUserName='weblogic'
            adminPassword=domainProps.get("domain1.AdminPasswd")
            connect(adminUserName, adminPassword, adminURL)
    except ConnectionException,e:
        print 'Unable to find admin server...'
        exit()

   
def updateGraceFulShutdownTimings():
    edit()
    startEdit()
    print
    print '##############'
    print '# Update Graceful Shutdown to 300 Seconds and ignore session true#'
    print '##############'
    print
    for name in serverNames:
        try:
            print 'Updating Server==>'+ name.getName()
            cd("/Servers/" + name.getName())
            cmo.setGracefulShutdownTimeout(300)
            cmo.setIgnoreSessionsDuringShutdown(true)
        except WLSTException,e:
            # this typically means the server is not active, just ignore
            print 'Exception While Update the attribute'
    print '========================================='
    save()
    activate()  

def quit():
        disconnect()
        exit()

if __name__== "main":
    conn()
    serverNames = cmo.getServers()
    updateGraceFulShutdownTimings()
    quit()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh UpdateGracefulShutdownParameters.py





Wednesday, April 16, 2014

oracle.webservices.preemptiveBasicAuth for invoking the webservices with Basic Authentication- Oracle SOA Suite 11g

oracle.webservices.preemptiveBasicAuth for invoking the webservices with Basic Authentication- Oracle SOA Suite 11g

HTTP basic authentication can have two types of authentication handshake methods, one is Reactive another one is Preemptive,

Reactive:
  • The client makes a request for a resource which needs authentication;
  • The server returns an HTTP 401 Authorization required response (indicating the authentication scheme and realm) with WWW-Authenticate header.
  • The client re-submits the request with an Authentication header;
  • The server verifies client credentials and returns the resource if authenticated successfully..

Preemptive:

The client can preemptively pass the credentials on the first request. The server returns immediately the resource if authenticated successfully.

Not all the authentication server accepts the Preemptive authentication mode, The NTLM authentication will not support the Preemptive handshake method it should be Reactive.

In Oracle SOA 11g the parnerlink binding property oracle.webservices.preemptiveBasicAuth will help us to set the handshake method accordingly.
  • oracle.webservices.preemptiveBasicAuth=false - Reactive mode
  • oracle.webservices.preemptiveBasicAuth=true - Preemptive mode


Tuesday, April 15, 2014

Response is displayed in compressed form while testing the Siebel webservices from SOAP UI

When i am trying to test the Siebel web services from SOAP UI the response is displayed in compressed form, seems the response is return in compressed for(i am not sure this is part of some Siebel configuration)


To display the response in decompressed form, make sure the option "Accept compressed responses from hosts" option in SOAP UI preference.





Monday, April 14, 2014

Backing up the MDS Repository Artifacts - Oracle SOA Suite 11g

In Oracle SOA Suite 11g, all the common artifacts , the deployed composites and the common configurations are stored in the MDS database schema. Sometimes there is a possibility of MDS schema getting corrupted (the best example is the composites getting corrupted frequently)those scenario we will not be able to bring up the soa-infra and also we may loose all the deployments.

Backing up the MDS artifacts is the the solution for these kind of issues.

In this post i will be explaining some of the different options to back up the MDS artifacts.

The best approach is do a full back up of MDS repository schema using database backup utilities(dbexp).The backup can be restored if there is any issue with the MDS schema.

EM console - MDS configuration Page :
Right click on soa-infra and click on Administration and MDS Configuration.
Click Export on MDS Configuration page.


This will export the MDS artifacts to local machine as zip file.




Wednesday, April 9, 2014

BINDING.JCA-11822 JPublisher error occurred in JDeveloper

Sometimes you may receive the following exception in DBAdapter wizard while regenerating the adapter configuration for the option "Call a Stored Procedure or Function through JDeveloper in Oracle SOA Suite 11g".

BINDING.JCA-11822
JPublisher error occurred.
An error occurred while running JPublisher.
An error occurred when JPublisher was invoked: ERROR: missing method.
Analyze the error and correct if possible. Contact oracle support if error is not fixable.

at oracle.tip.adapter.db.sp.xsd.oracle.JPublisher.findWrapperProcedureName(JPublisher.java:222)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.ProcedureObject.setWrapperInfo(ProcedureObject.java:256)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.oracle.DBAdapterStoredProcPage.loadProcedureBrowseDialog(DBAdapterStoredProcPage.java:213)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.AbstractStoredProcPage.browseProcButton_actionPerformed(AbstractStoredProcPage.java:369)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.AbstractStoredProcPage$1.actionPerformed(AbstractStoredProcPage.java:197)


The exception will be thrown while browsing the procedure in the wizard and the procedure has one of the following RECORD, TABLE, or BOOLEAN as input/output type.



Tuesday, April 8, 2014

Dynamic where condition in DB Adapter - Query By Example

Sometime we may have the scenario to query the data in a table with dynamic where condition through DB Adapter in Oracle SOA Suite 11g.
The Query by Example option in the DB Adapter provides the option to construct the where condition dynamically based on the input data provided.Query-by-example uses the AND operator to tie the input attributes together to form the where condition.



For example when we are defining the Query By Example option for the Employee table the adapter will consider the Employee object as input and returns the Employee Object list.



Saturday, April 5, 2014

Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite

Oracle introduces the Cloud Adapter for Salesforce.com as the extension of Oracle SOA Suite and this is certified only with the version 11.1.1.7.0.This will help the customers to integrate with the the Salesforce.com cloud easily.

When integrating the Salesforce.com via web service integration the main concerns are the Security management and the Session management.The web service integration requires more manual configurations, we have to connect to the Enterprise login with the authentication details to get the token values then using the token we have to do a API call to perform the operations in Salesforce.Oracle Cloud Adapter for Salesforce.com provides Intelligent Session management and security management and also provides a GUI to perform all the configurations.





Thursday, April 3, 2014

Getting the Messaging Bridge Runtime Details through Java - Weblogic

The below java jmx code will help us to get the run time details of the messaging bridge in weblogic server.

import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;

public class GetMessageBridgeStatus {
    private static MBeanServerConnection connection;
    private static JMXConnector connector;
    public static void  getMessageBridgeStatus() {
        try
        {
                getRuntimeMBeanServerConnection();
                String son = "com.bea:ServerRuntime=AdminServer,Name=Bridge-0,Location=AdminServer,Type=MessagingBridgeRuntime";
                ObjectName service = new ObjectName(son);
                String status = connection.getAttribute(service,"State").toString();
                System.out.println("Status: "+status);
         
                String description = connection.getAttribute(service,"Description").toString();
                System.out.println("Descrption: "+description);
       
        }catch(Exception e) {
           e.printStackTrace();
        }
         
    }
    public static void getRuntimeMBeanServerConnection()  throws Exception{
          String jndiroot = "/jndi/";
          String mserver = "weblogic.management.mbeanservers.domainruntime";
          JMXServiceURL serviceURL = new JMXServiceURL("t3", "localhost", 8000,jndiroot + mserver);
          Hashtable h = new Hashtable();
          h.put(Context.SECURITY_PRINCIPAL, "weblogic");
          h.put(Context.SECURITY_CREDENTIALS, "welcome1");
          h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,"weblogic.management.remote");
          connector = JMXConnectorFactory.connect(serviceURL, h);
          connection = connector.getMBeanServerConnection();
    }
 
    public static void main(String[] args) {
        getMessageBridgeStatus();
    }
 
}


Include the wlfullclient.jar file in the class path(Refer the following post https://www.albinsblog.com/2012/07/creating-wlfullclientjar-weblogic.html to generate the wlfullclient.jar )


Re-Targeting the singleton Applications to a single OSB node through WLST script

While setting up a OSB cluster environment some of the singleton applications should be targeted to a single node in the cluster.Also we have to make sure these applications are targeted to the active OSB node in the cluster.

The below WLST script will help us to re-target the singleton applications to a single active OSB node.

ReTargetSingletontoActiveNode.py

adminURL='t3://localhost:8080
adminUserName='weblogic'
adminPassword=welcome1
connect(adminUserName, adminPassword, adminURL)

runtime()
edit()
startEdit()

print "Targeting Intiated..."

cd('/AppDeployments/ALSB Domain Singleton Marker Application')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Domain Singleton Marker Application to OSB2..."

cd('/AppDeployments/ALSB Cluster Singleton Marker Application')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Cluster Singleton Marker Application to OSB2..."

cd('/AppDeployments/Message Reporting Purger')
set('Targets',jarray.array([], ObjectName))
set('Targets',jarray.array([ObjectName('com.bea:Name=OSB2,Type=Server')], ObjectName))
print "Targeted the Message Reporting Purger to OSB2..."

activate()
exit()


Unable to obtain metrics data from the server - Oracle OSB Non Clustered Environment

In Oracle OSB Monitoring Dashboard page we were receiving the warning message "Unable to obtain metrics data from the server" and not able to see any of the collected metrics.


This is a single node non clustered Dev setup, the OSB is running part of the AdminServer.
After analysis the issue is with the configuration of the singleton applications - ALSB Cluster Singleton Marker Application and ALSB Domain Singleton Marker Application.

Unfortunately the ALSB Domain Singleton Marker Application got undeployed and ALSB Cluster Singleton Marker Application was deployed as library instead of Enterprise Application.



Tuesday, April 1, 2014

Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part2

We were receiving the following exception while trying to invoke a composite(A) from other composite(B) in Oracle SOA Suite.

Error(284): part "payload" of variable "SFDCIN" is defined as XML element "{http://trm.com:I100:OrderProcessing:orderToQuote_Recieve}MT_BackfillStatus" whose definition cannot be resolved because "Global Type declaration/definition of name '{http://trm.com:I100:OrderProcessing:orderToQuote_Recieve}DT_BackfillStatus' are duplicated at the following locations: http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [line#: 4] http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/sfdcomqt_eventmanager_client_ep?XSD=xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [line#: 5] There are at least two of them looking different: http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [difference starting at line#:6] http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/sfdcomqt_eventmanager_client_ep?XSD=xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [difference starting at line#:7] ".

But the deployment of the composite(A) is success and we were able to test the composite(A) successfully from SOAP UI but while trying to invoke from other composite(B), the deployment of the invoking composite(B) failed with the above exception.

The both the differences pointing to the same xsd in the same component, one is design time xsd and another one is run time xsd.

While comparing, we were able to see some small differences between these two xsd's but unfortunately we could not able to correct it because both are pointing to the same xsd.

After a long struggle i was able to find out the root cause, the actual root cause is the annotations defined in the xsd.


After removing the annotation sections from the specified schema and redeploying the composite(A), i was able to invoke successfully from other composite(B).

It seems to be when the xsd's have the annotation defined , the BPEL run time generated xsd has difference compare to the original local schema.