Tuesday, April 8, 2014

Dynamic where condition in DB Adapter - Query By Example

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 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

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

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

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

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.

Thursday, March 27, 2014

java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener

java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener

While deploying Oracle ADF application sometimes we may receive the following exception

weblogic.management.DeploymentException:
at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:184)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:112)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:103)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListeners(HeadLifecycleFlow.java:175)
at weblogic.application.internal.flow.HeadLifecycleFlow.prepare(HeadLifecycleFlow.java:281)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at

The issue is due to  missing ADF web Run-time libraries in the war file.This can be resolved by adding the ADF web Runtime libraries into the war file.

Steps to resolve the issue

If you are deploying through JDeveloper then follow the below steps.

Add the ADF Web Runtime to the project libraries.


Include the ADF Web Runtime library as part of the war. 
    Project Properties-->Edit the deployment profile.
    Select the ADF Web Runtime library as part of WEB-INF/lib contributors.