Monday, 11 April 2016

Transaction timeout/JTA Timeout Setting at weblogic console

For the BPEL timeout set property SyncMaxWaitTime (value in seconds) in the SOA Suite console (Oracle Fusion Middleware Control): In the navigation menu on the left expand the “SOA” folder and select item “soa-infra (soa_server1)” just below it. Then in the top of the details screen on the right expand the drop down menu “SOA Infrastructure” and select “SOA Administration” -> “BPEL Properties” . The “BPEL Service Engine Properties” screen opens. Click on link “More BPEL Configuration Properties…” at the bottom of this screen. Now the “Application Defined MBeans: BPELConfig:bpel” screen opens and finally you can edit the setting SyncMaxWaitTime (scroll down, setting #32 in list).

Set timeouts in the soa EJB’s: Open the Weblogic console and click in the navigation menu on the left on “Deployments”. Expand “soa-infra” by clicking on [+] and expand node “EJBs” in the same way. Increase the “Transaction Timeout” (value in seconds) in the “Configuration” tab for the following EJB’s by clicking on them:

1. BPELEngineBean
2. BPELDeliveryBean
3. BPELActivityManagerBean
4. BPELServerManagerBean
5. BPELProcessManagerBean
6. BPELInstanceManagerBean
7. BPELFinderBean


Increase the JTA timeout in the Weblogic console by selecting “soa_domain” in the navigation menu (top item) on the left. Then select tab “Configuration” and subtab “JTA”. The first setting is the “Timeout Seconds” (value in seconds).

To solve “HeuristicMixedException” timeouts, set the “XA Transaction Timeout” of the soa jdbc connection to 0 seconds (means inherit) by expanding “Services” -> “JDBC” and select “Data Sources”. In the screen on the right select “SOADataSource” from the list and select tab “Configuration” and subtab “Transaction”. Enable setting “Use XA Datasource Interface” and setting “Set XA Transaction Timeout” and set setting “XA Transaction Timeout:” to 0 (inherit globale Weblogic transaction timeout).

Monday, 19 October 2015

Poll the new or changed records use DB2 Adapter in OSB Cluster


For polling records from DB2 database in OSB 11 g. We can have below setting to poll records via one server at a time.

(i) <serviceName>_or-mappings.xml Change:-


Change from <lock-mode>none</lock-mode> to <lock-mode>lock</lock-mode>
Which means we are enabling distributed polling. Which will set lock for one server at a time

(ii) Add Dynamic EndPoint Properties as below Under JCA Transport Tab:-

useSkipLocking = false


(iii)Enable Transaction Required check box under Message Handling Tab:-

Enabled check box

Enjoy the poller testing now.

ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2/LINUXX8664

I create a connection to DB2 server in weblogic admin console and tried to test one of my process and i go the error below


ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is DB2/LINUXX8664.  Please validate your platformClassName setting.  This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to.  This exception is considered not retriable, likely due to a modelling mistake.  To classify it as retriable instead add property nonRetriableErrorCodes with value "--104" to your deployment descriptor (i.e. weblogic-ra.xml).  This polling process will shut down, unless the fault is related to processing a particular row, in which case polling will continue but the row will be rejected (faulted).
 
The reason for this issue was that by default when we create a jndi it takes org.eclipse.persistence.platform.database.oracle.Oracle10Platform as platformClassName

I changed it to
org.eclipse.persistence.platform.database.DB2Platform

and save the chnages + update the DB plan. You will not see the error again.
 
List of the platformClassName used for different database:-

Oracle10+ (including 11g)

org.eclipse.persistence.platform.database.Oracle10Platform
Oracle9+ (optional)

org.eclipse.persistence.platform.database.Oracle9Platform
Oracle8

org.eclipse.persistence.platform.database.Oracle8Platform
Oracle7

org.eclipse.persistence.platform.database.OraclePlatform

DB2

org.eclipse.persistence.platform.database.DB2Platform

DB2 on AS400e

oracle.tip.adapter.db.toplinkext.DB2AS400Platform
Informix

org.eclipse.persistence.platform.database.InformixPlatform
SQLServer
 
org.eclipse.persistence.platform.database.SQLServerPlatform
MySQL

org.eclipse.persistence.platform.database.MySQLPlatform
Any other database

org.eclipse.persistence.platform.database.DatabasePlatform

Tuesday, 22 September 2015

SOA Suite 11g: Unable to start domain



If you have recently installed

Created a domain and then tried to start it only to find it fails with the error:
 
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
then edit the file




<domain home>\bin\setSOADomainEnv.cmd or sh (depending on your platform) and modify the line:
 
set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m


 
to something like:



set DEFAULT_MEM_ARGS=-Xms512m -Xmx768m
 
Start the weblogic server again. It should work.

Thursday, 11 December 2014

Disabling/Enabling the Oracle Service Bus Proxy or Business Services using Java code

When to use disable/enable using Java code:-

(i)the endpoint becomes unreachable
(ii)the endpoint still alive but the response becomes slow and results in SLA violation

If the problem on the endpoint persists and cannot be resolved quickly, a possible action can be to stop the Proxy Service for not receiving requests anymore until the problem is sorted out. We can manually disable the Proxy Service via OSB console or WLST to achieve this.  There is alternative approach available to disable Proxy Service automatically via OSB's Java API due to endpoint abnormalities.

Create a java code:-

package com.oracle.demo;


import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;

import com.bea.wli.sb.management.configuration.SessionManagementMBean;
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;
import weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean;
import weblogic.management.jmx.MBeanServerInvocationHandler;

import com.bea.wli.config.Ref;
import com.bea.wli.sb.management.configuration.ProxyServiceConfigurationMBean;

public class ServiceManager {

    private static JMXConnector initConnection(String hostname, int port,
            String username, String password)
    throws IOException,MalformedURLException
    {
        JMXServiceURL serviceURL =
        new JMXServiceURL("t3", hostname, port,
        "/jndi/" + DomainRuntimeServiceMBean.MBEANSERVER_JNDI_NAME);

        Hashtable<String, String> h = new Hashtable<String, String>();
        h.put(Context.SECURITY_PRINCIPAL, username);
        h.put(Context.SECURITY_CREDENTIALS, password);
        h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");

        return JMXConnectorFactory.connect(serviceURL, h);
    }

    private static Ref convertServiceURI2Ref(String resType,String serviceuri){
        Ref ref = null;
        if((serviceuri.equals(""))||(serviceuri==null))
                return ref;

        String[] uriData = serviceuri.split("/");
        ref = new Ref(resType,uriData);
        return ref;
    }

    public static void changeProxyServiceStatus(String serviceref,boolean status)throws Exception{
        JMXConnector conn = null;
        SessionManagementMBean sm = null;
        String sessionName = "Session.ByApp." + System.currentTimeMillis();

        try{

            conn = initConnection("localhost", 7001, "weblogic", "welcome1");
            MBeanServerConnection mbconn = conn.getMBeanServerConnection();
            DomainRuntimeServiceMBean domainService = (DomainRuntimeServiceMBean) MBeanServerInvocationHandler.
                 newProxyInstance(mbconn, new ObjectName(DomainRuntimeServiceMBean.OBJECT_NAME));

            sm = (SessionManagementMBean) domainService.
                 findService(SessionManagementMBean.NAME,
                             SessionManagementMBean.TYPE, null);

            sm.createSession(sessionName);

            ProxyServiceConfigurationMBean proxyConfigMBean = (ProxyServiceConfigurationMBean) domainService.
             findService(ProxyServiceConfigurationMBean.NAME + "." + sessionName,
                     ProxyServiceConfigurationMBean.TYPE, null);
            Ref ref = convertServiceURI2Ref("ProxyService",serviceref);
            String msg = "";
            if(!status){
               proxyConfigMBean.disableService(ref);
               msg="Disabled the Proxy Service : " + serviceref;
            }
            else {          
                proxyConfigMBean.enableService(ref);  
                msg="enabled the Proxy Service : " + serviceref;
            }                              

            sm.activateSession(sessionName, msg);
            System.out.println(msg);
            conn.close();
        }catch(Exception ex){
            if(null != sm) {
                try{
                    sm.discardSession(sessionName);
                }catch(Exception e) {
                    System.out.println("discard session error");
                }
            }
            throw ex;
        }finally{
            if(null != conn)
                try{
                    conn.close();
                }catch(Exception e) {
                    e.printStackTrace();
                }
        }
    }
}

Use the below Jar files in libraries and classpath:-


















These jar files can be attached from following locations
$MW_Home/Oracle_OSB1/modules/com.bea.common.configfwk_1.7.0.0.jar
$MW_Home/Oracle_OSB1/lib/sb-kernel-api.jar

$MW_Home\wlserver_10.3\server\lib\weblogic.jar

Create a Jar file of this java code and then create a OSB proxy service to Use it using javacallout as below



















Provide the name of proxy service in Java.lang.String parameter and set the boolean as false. As we need to disable the proxy right now.

Here we have the result after running above proxy















The above Java code can be modified to enable/disable Business service as well.

Monday, 8 December 2014

java.sql.SQLException: JDBC LLR, table verify failed for table 'DEV_SOAINFRA.WL_LLR_ADMINSERVER'

After Creating two domain I encountered following issue while starting weblogic server for the second domain created

Error:-

javax.transaction.SystemException: Failed to call registerLoggingResourceTransac
tions() weblogic.transaction.loggingresource.LoggingResourceException: weblogic.
transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDB
C LLR, table verify failed for table 'DEV_SOAINFRA.WL_LLR_ADMINSERVER', row 'JDB
C LLR Domain//Server' record had unexpected value 'soa_domain//AdminServer' expe
cted 'base_domain//AdminServer'*** ONLY the original domain and server that crea
tes an LLR table may access it ***

Solution 1:-

If the Domain name was changed and do not want to change database properties then an update to the table WL_LLR_ADMINSERVER can be done:

i.e.
Start sqlplus
then run the below Update query
update DEV_SOAINFRA.WL_LLR_ADMINSERVER
set    RECORDSTR = 'base_domain//AdminServer'
where  XIDSTR    = 'JDBC LLR Domain//Server';
commit;

Solution 2:-

Reconfigure the Point base database information differently for each domain if you have more than one domain. This involves changing the database port and name in below two files in domain

In setDomainEnv.cmd (or .sh) file inside DOMAIN_HOME/bin directory change Point base port number and DB name.

set POINTBASE_PORT=9094
set POINTBASE_DBNAME=weblogic_2



jdbc:pointbase:server://localhost:9094/weblogic_2


In wlsbjmsrpDataSource-jdbc.xml file inside DOMAIN_HOME/config/jdbc directory change below entries with updated pointbase database port and name (this will be in two places in the file)



Saturday, 6 December 2014

Could not find the specific JMSServer requested with the JMS adapter Error [JMSExceptions:045103]

Error:

Getting the following fault when invoking a SOA Suite 11g composite that uses a JMS adapter to produce message:
<fault>
  <bpelFault>
    <faultType>0</faultType>
    <bindingFault>
      <part  name="summary">
        <summary>
          Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_message' failed due to: ERRJMS_ERR_CR_QUEUE_PROD.ERRJMS_ERR_CR_QUEUE_PROD. Unable to create Queue producer due to JMSException. Please examine the log file to determine the problem. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
        </summary>
      </part>
      <part  name="detail">
        <detail>
          [JMSExceptions:045103]While trying to find a topic or a queue we could not find the specific JMSServer requested. The linked exception may contain more information about the reason for failure.
        </detail>
      </part>
      <part  name="code">
        <code>null</code>
      </part>
    </bindingFault>
  </bpelFault>
</fault>

Solution:

The subdeployment on which the queue is associate with is target to an invalid JMS Server. In this case, the JMS Server was referencing a persistent file store that did not exist.

After parsing log files, you may find the following error:
<Dec 25, 2011 7:30:41 PM EST> <Warning> <Management> <BEA-141197> <The deployment of TestJMSServer failed.
weblogic.management.DeploymentException: Internal error activating the JMS Server TestJMSServer: weblogic.management.DeploymentException: The persistent store "TestFileStore" does not exist at weblogic.jms.deployer.BEAdminHandler.activate(BEAdminHandler.java:215)
        at weblogic.management.utils.GenericManagedService.activateDeployment(GenericManagedService.java:239)
1. Navigate to the WebLogic Server Administration Console.

2. Expand soa_domain -> Services -> Messaging -> JMS Modules

3. Click on your JMS module name

4. Click on the Subdeployments tab

5. Click on the subdeployment name

6. Target the subdeployment to a valid JMS Server