Tuesday, 22 November 2016

How to resolve "Self extraction to C:\Users\temp\AppData\Local\Temp\orcl942564381009262456.tmp failed error while installing ODI 12c

While trying to install ODI 12c, When tried invoking the jar file in CMD then got an error
"Self extraction to C:\Users\temp\AppData\Local\Temp\orcl942564381009262456.tmp failed.

For some reason the 2nd file was not detected. So Solution is to keep both disk file installable in same one folder.

Which will resolve the issue.

Tuesday, 8 November 2016

Difference between OSB 11g And OSB 12c

Following below are the difference between OSB 11g and 12c:-

(I) In the new version Oracle Service Bus (OSB) is renamed as Service Bus.
(ii) Eclipse tool is needed to develop an interface in OSB 11g where as JDeveloper tool is needed to develop an interface in OSB 12c. 
(iii) Re-sequencing in OSB, In 11g this feature was available in Mediator, in Oracle SOA 12c this features added to service bus also, with the help of this feature we able to process the request message in proper sequence.
(iv) Pipeline is separated from proxy service and it is separate component in 12c.
(v) MDS support is provided for OSB.
(vi) Because a SB project is more like a SCA Composite (same overview) the Proxy is split from the Pipeline. This means that the Proxy and the Pipeline are two individual things. With this concept multiple Proxies can be wired to one Pipeline. Say you have a "Any XML" Pipeline, you can process the data from both Proxies (i.g. File adapter and JMS Queue).
(vii) One of SOA Suite 12c pillar is Mobile Enablement. You can expose a Pipeline as a REST service. When doing it creates a REST binding just like in a SCA Composite. In the wizard you can assign specific Resource Paths and Operation for the operations of the Pipeline. Downside is that you can only expose Pipelines that have a WSDL interface.
(viii) SB also supports the use of templates. But it works a little different. Templates are Pipeline-based, this means that you can select a template when creating a new Pipeline. There are two types of templates; Unlinked, which is a copy of the template, and Linked, Pipeline stays connected to template. In the template you can use Placeholders so permit changes to that part of the Pipeline. If the Pipeline is linked to a template and the template is changed the linked Pipeline will inherent these changes.

Some more useful link provided by oracle

http://education.oracle.com/pls/web_prod-plq-dad/web_prod.view_pdf?c_id=D94373GC10&c_org_id=32&c_lang=US

http://www.oracle.com/technetwork/middleware/soasuite/overview/wp-soa-suite-whats-new-12c-2217186.pdf

Oracle WebLogic Server on Docker

What is Docker:-

Docker is a virtualization technology that uses containers.  A container is a feature that was added to the Linux kernel recently.  Solaris has had containers (or ‘zones’) for a long time.
Unlike a VM, it does not emulate a processor and run its own copy of the operating system, with its own memory, and virtual devices.  Instead, it shares the host operating system, but has its own file system, and uses a layering technology to overlay sparse file systems on top of each other to create its file system.
When you are ‘in’ the container, it looks like you are on a real machine, just like when you are ‘in’ a VM.  The difference is that the container approach uses a lot less system resources than the VM approach, since it is not running another copy of the operating system.This means that more of your physical memory is available to run the actual application you care about, and less of it is consumed by the virtualization software and the virtualized operating system.

You can use Linux containers without using Docker.  Docker just makes the whole experience a lot more pleasant.  Docker allows you to create a container from an ‘image’, and to save the changes that you make, or to throw them away when you are done with the container.

These images are versioned, and they are layered on top of other images.  So they are reusable.  For example, if you had five demo/training environments you wanted to use, but they all have SOA Suite, WebLogic, JDK, etc., in them – you can put SOA Suite into one image, and then create five more images for each of the five demo/training environments – each of these as a layer on top of the SOA image.  Now if you had one of those five ‘installed’ on your machine and you wanted to fire up one of the others, Docker allows you to just pull down that relatively small demo image and run it right on top of the relatively large SOA image you already have.

If you customize the demo and want to share the customizations with others, you can ‘push’ your image back to a shared registry (repository) of images.  Docker is just going to push the (relatively very small) changes you made, and other people can then use them by running that image on top of the ones they already have.

Running your customized image on top of the others they have will not change the others, so they can still use them any time they need them.  And this is done without the need for the relatively large ‘snapshots’ that you would create in a VM to achieve the same kind of flexibility.

Here are some useful link for establishing Oracle fusion weblogic setupe with docker:-

http://www.oracle.com/technetwork/middleware/weblogic/overview/weblogic-server-docker-containers-2491959.pdf

https://www.linkedin.com/pulse/docker-oracle-fusion-weblogic-setup-vijaya-kumar-reddy-maddela

Friday, 1 July 2016

How to Read JMS Custom Header Properties


Via OSB we have two methods of invocation to JMS queue and topic (i) jms protocol (ii)JCA adapter. But in OSB jms protocol is always preferred.  We usually deals with XML or Non-XML content while working with JMS queue and topic and there are some pre-defined header properties for JMS queue and topic that are used for specific purpose.

Sometime we need to read extra parameters from JMS queue/topic, these extra parameters are custom JMS header properties. We can read custom header property for JMS queue in OSB.

Steps are to create proxy service that will read the message from JMS queue, to create that right click on the folder and click on new and choose proxy service option. Choose “Messaging service” as Service Type.

In Message Type configuration, select “Text” as Request Message Type as we will read simple text message to test this use case and choose “None” as Response Message Type as we are not sending any response back once we read the message from JMS queue.

In Transport tab, choose jms from protocol drop-down as we are dealing with JMS queue i.e. we need to read the message from JMS queue. In Endpoint URI text box fill the required values for JMS endpoint URI, for this use case we use default connection factory and name of JMS queue. Choose default settings for all other tabs and save the business service.

Make sure that “Get All Header” option is set to yes.  If we don’t select this option then we will not be able to read custom header property from JMS queue.

Now to read the JMS custom header property from inbound variable, We can use below syntax via assign activity.

var1 = $inbound/ctx:transport/ctx:request/tp:headers/tp:user-header[@name='QueueDetail']/@value

Here QueueDetail is custom header property name.

Save your proxy service and deploy it to server. Now put message to JMS queue along with custom header property. Proxy picks the message and fetch the custom header property in var1 variable. Which we can print via log activity on server.

Thursday, 28 April 2016

Service Result Caching in OSB


Oracle Service Bus 11g provides built-in cache functionality that utilizes Oracle Coherence, support for many caching strategies.

Oracle Coherence Integration:-

Oracle Service Bus always had some mechanics of caching in order to provide XQuery and XML beans caching, in addition to object caching for Proxy and Business Services classes. But from 11g Release 1 onward, Oracle Service Bus offered an integrated solution for result caching with Oracle Coherence.

The result caching in Oracle Service Bus is available for Business Services. When you enable result caching, the Business Service will not reach the backend service and the response will come from the cache entry. This entry can expire and if the entry is expired, the next service call will indeed reach the backend service and update the cache entry.

 
Activating Cache for Business Service
To enable result caching for our Business Service follow these steps: Open any business service

Expand Advanced Settings and in Result Caching select Supported. Set the Cache Token Expression: fn:data($body/ser:getCustomer/arg0)
 


This will use the customer ID as our unique token for the cache entry. Also, set the Expiration Time for 10 minutes.
Click Last >> and Save to confirm the Business Service modifications. You can activate the change session.
Now test the proxy service

Now the result will show the results immediately, directly from a cache entry in the embedded Oracle Coherence Server running within Oracle Service Bus.  The cache Expiration Time (Time-to-Live) is set to 10 mins, so during this period your calls will not hit the backend Web service.

More complex cache tokens :-
Your desired cache token key may not be as straight forward as selecting the contents of a single, predictably placed node.
 It is worth noting that the Cache Token may be specified as any expression you like, using the XQuery functional programming language.
 XQuery has a rich syntax for constructing queries, including the use of many system libraries with common functions such as numeric operations and string manipulation.
Clear the cache explicitly:-
It might be that you can’t risk the cache becoming stale under certain circumstances. If that is the case, rather than using a time parameter to manage the lifetime of the cached responses, mark critical requests with an additional flag and select XQuery Expression in the expiration time options to test for the existence of this flag.

JCA FTP Adapter limitation in OSB


When we use FTPAdapter with OSB 11g (specifically 11.1.1.6 in our case), Then we can encountered below error in osb_server1.out log file: 

<BEA-000000> <onReject: The resource adapter 'FTP Adapter' requested handling of a malformed inbound message. However, the following activation property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy. Will use the default Rejection Directory file://jca/Get/rejectedMessages for now.>
We were stuck with the problem of handling large file (Specifically 5 MB file) with OSB. Which was continuously getting polled and deleted from the FTP server and OSB logs was showing the rejection handler error.

Solution:

The default properties in the JCA FTP Adapter limits files to 4MB when polling for inbound messages.
Reason is when the FTP Adapter is used as inbound to receive files from an FTP server, it is possible to limit the size of files by using the payloadSizeThreshold property.
E.g. when the following below endpoint property
<property name="payloadSizeThreshold" type="xs:string" many="false" override="may">50000</property>
then files that are larger than 50000 bytes will be rejected.

This is properly working for all files that are smaller than around 4 MB, but for files larger than that a so-called scalable DOM is created and in this case the payload threshold check is not performed.
To ensure that the payloadSizeThreshold is properly recognized for files of all sizes, ensure that the SupportsScalableDOM property for the FTP Adapter is set to false.
1. Edit the FTPAdapter and add the following property inside the JCA file:
<property name="SupportsScalableDOM" value="false"/>

But changing it and making JCA adapter to poll the large files can result into out of memory error as file size depend on various factor such as (System resources, Load on the server and memory) to process the large files.

ODI is the best tool for processing files having size in GB’s.

How Large payload being handled via oracle soa suite 11g


The following below are the option to handle the large payload reading in SOA suit 11g.

 1) Debatching
 2) Integration with ODI


 1) Debatching : We can configure file adaptor to process the data in batches, for example if we have 1000 records then we can limit it to read 300 records at a time by setting publish record in batches of 300 in file adaptor wizard configuration. Which will create multiple instance for configured batch at run time.

 2) Integration with ODI : Oracle Data Integrator can handle large volume of data, ODI uses mechanism called ELT ( Extract, Load and Transfer). If file goes more than 10MB or so then SOA 11g dealing of files completely depends on what hardware, memory and load handling capacity server have. Keeping in mind SOA process still need for communication to external parties, ODI can be used along with SOA. Below is the example to understand it better.
  a) SOA picks up file as attachment without parsing payload and place into ODI box.
  b) SOA deal with ODI box to process large file by invoking ODI job as webservice.
  c) ODI sends acknowledge back to SOA once file processing over by calling SOA as webservice.

At last debatching introduces multiple instance for one end to end exectuion, So it’s difficult to track and monitor the interface execution specially if want the file to execute in single transaction.
SOA and ODI together provide easy way of processing large volume of data.

Tuesday, 12 April 2016

Run Time behaviour of FTP/SFTP Protocol in OSB


1.      The proxy service polls the input directory at regular intervals. 

Note:

A new connection is created for each poll cycle.

2.      If the proxy service finds a file in the input directory, it renames the file with a .stage extension. This renaming ensures that the service does not pick up the same files during the next polling cycle.
The .stage file exists in the input directory until it is delivered. 

Note:

If the file cannot be retrieved from the input directory (due to network failure, for example), the .stage file is processed during a clean-up cycle. The clean-up cycle is performed every 15 minutes or after 15 polling cycles, whichever occurs later. If a .stage file exists during two consecutive clean-up cycles, it is processed again. 

3.      A JMS task is created for the message and added to the domain-wide JMS queue. 

4.      A domain-wide MDB receives the task and processes the message. 

Note:

The task uses a pooled connection for processing the message. If a connection is not available in the pool, a new connection is created. 

5.      The message is delivered to the pipeline and the .stage file is deleted. 

Note:

If an SFTP business service is configured, the service puts the message in the outbound directory through a pooled connection.
 
If the message is not delivered, the transport attempts to transfer it again and repeats the process up to a predefined number of attempts. If the message cannot be delivered, it is moved to the error directory.

Monday, 11 April 2016

No resources currently available in pool SOADataSource to allocate to applications error


Error stack-trace:

java.sql.SQLException: Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool SOADataSource to allocate to applications, please increase the size of the pool and retry..
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:577)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:342)

Error Cause:

Weblogic server throws the below exception when there is not enough database connections in the pool to serve the incoming requests reporting increasing the connection pool count.

The above exception is due to there is not enough connections available in the pool to service the requests.
To identify which datasource / connection pool requires more connection do the following.

  • Go to Weblogic Admin console
  • Go to Environment -> Servers
  • Select the server on which the connection pool needs to be monitored
  • Go to Monitoring -> JDBC
  • Customize the table to add the below two properties
1. ActiveConnectionsAverageCount
2. ActiveConnectionsCurrentCount

Page will list all the datasources/ connection pools targeted to that particular server and how many connections are waiting to get the connection. If more number of connections are waiting, that is not a good which will cause performance impact and also cause stuck threads on the server if the wait time is going to be beyond the thread stuck time.When any data source will not be responding then it's state will be overloaded.

Solution :- Increase the number of connections in the connection pool.

Steps:
  • Go to WLS Console
  • Select Services -> Datasources -> select the datasource you want to change the pool size
  • Go to Configuration -> connection pool
  • Change the Maximum Capacity to the count which is required for your environment.

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

Wednesday, 26 November 2014

OSB MQTransport and MQ queue always publishes the messages in bytes and not in Text

One of the issue I got recently while publishing data from OSB 11g to MQ Queue which always publishes message in Byte format.

Using HermesJMS Queue Browser for MQ queue basically was able to see messages in byte format.
Though My BusinessService(Messaging Service>>Request Message Type (Text)) for publishing the messages on the MQ queue always publishes the messages in bytes and not in Text. Even when I tried to change it to text i still get the messages in the bytes format.

Reason:-
mq transport is not able to parse JMS headers . if u sending message from any jms client like Hermes it would have jms headers with the message and mq transport would fail to validate the payload

Workaround:-
I added the below RFH2 Headers as part of mq Transport Header using Transport Header activity in OSB,so basically Hermes JMS was able to intercept the RFH2 headers and display the payload in text format in Queue Browser.

'<RFH2Header>
<mcd><Msd>jms_text</Msd></mcd>
</RFH2Header>'

Split Join behavior in OSB or FlowN behavior in BPEL

Recently i encountered with one issue while working through split join in OSB. Declared the variable as global and used in for each for parallel processing which started behaving abruptly. Request was splitting abruptly.

Always be sure to declare the variables as local to for-each or FlowN. Which will give you the values specific to thread generated at runtime.

Happy testing parallel flows !!!

Friday, 12 October 2012

How to pass event from ADF page to BPEL process using Java API

Step1:- We can write Java API to publish event in EDN based on JMS or EDN based on AQ. This java API code need to insert in ADF page on Click button action.  By default EDN would be AQ based. For changing it to JMS based need to change one property in SOA server and restart.
Note:- We need to decide if we want to use EDN-AQ or EDN-JMS. The AQ implementation is the default EDN implementation but this requires some datasources to the soa-infra database. This can be Ok in a small server network but it will create dependency to this SOA Suite Server in  WebLogic Server.”    

Step 2:- I will explain here EDN based on JMS.
      Step 2(i):- For using EDN based on JMS we have to do below changes in enterprise manager
1.     Open the enterprise manager application | SOA | soa-infra
2.     Open the Common Properties Menu item of the SOA-Infrastructure menu
3.     Click on More SOA-Infra Advanced Configuration Properties.This will open the System MBean Browser. In this we can change the EdnJmsMode and set this to true. Restart the SOA Server and take a look at the monitoring of the EDN Queue jms/fabric/EDNQueue which by default present on server


SOAJMSModule located at the JMSModules of WebLogic you can see that the module already contains an EDN Queue and an EDN ConnectionFactory.



By default jms/fabric/EDNConnectionFactory, jms/fabric/EDNQueue will be there on server. Create a JMS Connection Factory called xaEDNConnectionFactory with JNDI name jms/fabric/xaEDNConnectionFactory, enable XA and targeted this to your WebLogic server.

Step 2(ii):- Configure a Foreign JNDI Provider to Enable Administration Server Applications to Publish Events to the SOA Server

1.Log in to the Oracle WebLogic Server Administration Console.
2.In the Domain Structure section, expand Services > Data Sources.
You must remove the EDN-DB JNDI sources to use EDN-JMS data sources.
3.Select the following EDN-DB JNDI data sources, and click Remove.
◦jdbc/EDNDataSource
◦jdbc/EDNLocalTxDataSource
If the event publisher is in an application (for example, ADF) running in a different cluster or even in a different domain from the SOA server for EDN, you must configure a foreign JNDI provider with the local JNDI names for the cluster mapping to JNDI names targeted to the SOA Infrastructure. Local and remote JNDI names are the same in the links.
4.In the Domain Structure section, expand Services > Foreign JNDI Providers.
5.Click New.
6.In the Name field, enter a name for the foreign JNDI provider.
7.Select targets for the new JNDI provider, and click Finish.
8.In the Name field, click the new JNDI provider.
9.Specify provider settings (the initial context factory, provider URL, and so on), and click Save.
Initial Context Factory:- weblogic.jndi.WLInitialContextFactory.
Provider URL:-  t3://hostname:soa_server_port.
User:- Enter the Oracle WebLogic Server user name.
Password and Confirm Password:- Enter the password for the Oracle WebLogic Server user name.
10.Click the Links tab.
11.Click New to create a foreign JNDI link.
12.Enter a name, then specify the local and remote JNDI name of jms/fabric/EDNConnectionFactory.
13.Repeat Step 12, and specify a name and the local and remote JNDI name of jms/fabric/xaEDNConnectionFactory.Repeat Step 12, and specify a name and the local and remote JNDI name of jms/fabric/EDNQueue.
Once complete, three links are created.
14.Restart the targeted servers.
15.Confirm the new JNDI provider links in the JNDI tree view.

Step 2(iii):- ADF page will take two input parameter and will pass to xsd in API code and one create Event button .Java API code along with backing bean in ADF page:-
Need to add Libraries in View Controller to avoid any compilation error(i)SOA runtime (ii) Weblogic Remote Client (iii) JSF etc

package viewControler.backing;

import oracle.adf.view.rich.component.rich.RichDocument;
import oracle.adf.view.rich.component.rich.RichForm;
import oracle.adf.view.rich.component.rich.nav.RichCommandButton;

import java.util.Properties;


import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import javax.transaction.UserTransaction;

import javax.xml.namespace.QName;

import oracle.adf.view.rich.component.rich.input.RichInputText;

import oracle.fabric.blocks.event.BusinessEventConnection;
import oracle.fabric.blocks.event.BusinessEventConnectionFactory;

import oracle.integration.platform.blocks.event.BusinessEventBuilder;
import oracle.integration.platform.blocks.event.jms.JmsRemoteBusinessEventConnectionFactory;

import oracle.soa.common.util.XMLUtil;


import org.w3c.dom.Element;
public class CallEventApI {
    public String cb1_action() {
        // Add event code here...
        // My SOA WebLogic variables
        // the business Event
//Enter name of business event
        String EmployeeEvent = "Event1";
//Enter target namespace of business event
        String NameSpace =
            "http://xmlns.oracle.com/SubscribedEventProject/EventDefinition1";
       
        String name = getIt1().getValue().toString();
        String id = getIt2().getValue().toString();
       //Enter the XSD payload
        String EmployeeEventBody =
            "<Employee xmlns=\"http://www.example.org\">" +
            "<Name>"+name+"</Name>" +
            "<Id>"+id+"</Id>" +
            "</Employee>";
       
        Element eventBody = null;
        try {
            eventBody =
                    XMLUtil.parseDocumentFromXMLString(
                        EmployeeEventBody.toString()).getDocumentElement();
        } catch (Exception e) {
            e.printStackTrace();
        }
       
        // EDN JMS environment
        String connFactName = "jms/fabric/EDNConnectionFactory";
        String xaConnFactName = "jms/fabric/xaEDNConnectionFactory";
        String queueName = "jms/fabric/EDNQueue";
       
        try {
            InitialContext context = new InitialContext();
            
                        // do a jndi lookup on the Server
                        UserTransaction userTransaction = (UserTransaction)context.lookup("javax.transaction.UserTransaction");
                        QueueConnectionFactory queueConnectionFactory = ((QueueConnectionFactory)context.lookup(connFactName));
                        QueueConnectionFactory xaQueueConnectionFactory = ((QueueConnectionFactory)context.lookup(xaConnFactName));
                        Queue jmsQueue = ((Queue)context.lookup(queueName));
            
       
            BusinessEventConnectionFactory factory =
                new JmsRemoteBusinessEventConnectionFactory(queueConnectionFactory,
                                                            xaQueueConnectionFactory,
                                                            jmsQueue,
                                                            userTransaction);
       
            BusinessEventConnection conn =
                factory.createBusinessEventConnection();
            
            // Create an event
            BusinessEventBuilder builder = BusinessEventBuilder.newInstance();
            builder.setEventName(new QName(NameSpace, EmployeeEvent));
            builder.setBody(eventBody);
            System.out.println("here called");
       
            // publish
            conn.publishEvent(builder.createEvent(), 4);
            conn.close();
       
        } catch (NamingException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Step 3:- Deploy the ADF page as war file then open the page url and click the button.
Once event will be triggered from ADF page will put the message in jms/fabric/EDNQueue queue. Once message will reached to queue then it will automatically invoke Subscribed mediator as in Java API we are passing the Event name and namespace of EDL file and Input payload.

Hope this would be helpful.

Saturday, 22 September 2012

How to call Shell Script in BPEL process using Java Embeed

Step 1:- Write Shell Script For addition of two number.
Step 2:- Create XSD which will contain two numbers.













<?xml version= '1.0' encoding= 'UTF-8' ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.oracle.com/ns/Numeric"
     xmlns:num="http://xmlns.oracle.com/ns/Numeric" attributeFormDefault="qualified" elementFormDefault="qualified">
    <element name="Numeric" type="num:NumericType"/>
    <complexType name="NumericType">
        <sequence>
            <element name="Num1" type="int"/>
            <element name="Num2" type="int"/>
                    </sequence>
    </complexType>
</schema>

Step 3:-Write a Java code to call shell script along with passing variable to script. Below code is written to open the script created in cygwin.

package com.test;

import java.io.*;
public class MyTest1 {
       
          public String ShellScript(int i, int j) throws IOException
          {

               String Var=null;
          try{
                Process P;
                System.out.println(i);
                System.out.println(j);
              String strParam = "D:\\cygwin\\bin\\bash -c '/cygdrive/d/testShell/SumOfTwoNumber.sh "
                                                     + i +" + "+ j+" '";
                                     P = Runtime.getRuntime().exec(strParam);

                          System.out.println("here " + strParam);
             BufferedReader br = new BufferedReader(new InputStreamReader(P.getInputStream()));
            String line=null;
            
              while ( (line = br.readLine()) != null){
                        System.out.println("Output" + ">" + line);
                  Var=line;
                        }
                System.out.println(line);
                System.out.println("Output of Var:-"  +Var);
             
            int wait = P.waitFor();
            System.out.println("exit code: "+wait);
               
            }
            catch (InterruptedException ie)
            {
              System.out.println("exception caught");
            }
            catch (Throwable t)
                  {
                    t.printStackTrace();
                  }
               return Var;
              
           }
For Script available in Bash or Corn Shell then need to modify line.
 String strParam = "bin\bash -c \SumOfTwoNumber.sh + i +" + "+ j+" ";
 String strParam ="bin\ksh -c \SumOfTwoNumber.sh + i +" + "+ j+" ";


Step4:- Create BPEL process to contain java embeed.

Modify BPEL source code to containg following below class
<bpelx:exec import="YourFullyQualifiedClassName(example com.oracle.shellscript)"/>

Java Embeed will contain following below code
MyTest1 pocob = new MyTest1();               
try{         
addAuditTrailEntry("Started From This Place");        
String i = ((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/ns1:Numeric/ns1:Num1")).getFirstChild().getNodeValue();   
int k = Integer.parseInt(i);        
addAuditTrailEntry("k Variable " +k);        
String j = ((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/ns1:Numeric/ns1:Num2")).getFirstChild().getNodeValue();           
int n = Integer.parseInt(j);        
addAuditTrailEntry("n Variable " +n);        
addAuditTrailEntry("Before Variable");        
String greetings = pocob.ShellScript(k,n);       
addAuditTrailEntry("After Variable");        
addAuditTrailEntry("Value:- " +greetings);        
setVariableData("Var1",greetings);     //Var1 is a variable created in BPEL process to contain result     
addAuditTrailEntry("After Assignment");        
}        catch(Exception io){                                                                         
      addAuditTrailEntry("Exception occured:"+io.getMessage());                                                          
      javax.xml.namespace.QName qName=new javax.xml.namespace.QName("http://schemas.oracle.com/bpel/extension","remoteFault");                                                                               
      com.oracle.bpel.client.BPELFault bpelFault=new com.oracle.bpel.client.BPELFault(qName);               
      throw bpelFault;                                
    }       
finally{        
pocob=null;   
  
}

Add following libraries in classpath.

Assign Var1 Variable to BPEL output variable.


Enjoy the testing.