Sunday, May 4, 2014

SOA-INFRA Application is in unknown Type - Oracle SOA Suite 11g

SOA-INFRA Application is in unknown Type - Oracle SOA Suite 11g:

I was facing a strange issue,the Type of the soa-infra application was unknown but the state and the health of the application is looking fine(Active and OK) in admin console.
Because of this the SOA node is not displayed in the em console.




Tried restarting the server without any luck and also updated(redeployed) the soa-infra application but still the type of the application is unknown.

I could not able to find any exception related to this issue in the log files and also there is no issue related to the database schema's.

Steps to resolve the issue

Delete the soa-infra application from the admin console deployments.
Install the soa-infra application(soa-infra-wls.ear) from the location SOA_HOME\soa\applications as Enterprise Application.


Saturday, May 3, 2014

WLST script to enable Backup/Archive configurations in weblogic server

WLST script to enable Backup/Archive configurations in weblogic server


By enabling the backup/archiving in Weblogic, the administration Server can automatically backups the domain configuration (the entire domain-name/config directory) during the server boot to DOMAIN_HOME\config-original.jar and config-booted.jar.

Also multiple versions of the domain config will be archived by the Administration Server, each time the domain configuration is modified into the DOMAIN_CONFIG\configArchive folder.

The configuration archives can be used for system restoration in cases where accidental configuration changes need to be reversed.

This tutorial explains how to use WLST script to enable backup/archive configurations.


WLST Script


The below WLST script will help us to enable the backup/archive configurations

EnableArchiving.py

adminURL='t3://localhost:7001'
adminUserName='weblogic'
adminPassword='weblogic1'
connect(adminUserName, adminPassword, adminURL)
domainRuntime()
edit()
startEdit()
cmo.setConfigBackupEnabled(true)
cmo.setArchiveConfigurationCount(5)
save()
activate()



Script
https://github.com/techforum-repo/youttubedata/blob/master/scripts/wlst/EnableArchiving.py

Execute the script

<<Oracle_Home>>\oracle_common\common\bin\wlst.cmd EnableArchiving.py



Verify the configuration


To verify the configuration- Login to admin console →Click on Domain in the left panel →Expand the Advanced in General Configuration section



When the Admin Server starts up it automatically makes a backup of DOMAIN_HOME/config directory and stores it in DOMAIN_HOME/config-original.jar(original configuration file while restarting the server) and once the start up completed(booted) successfully it makes a backup of DOMAIN_HOME/config directory and stores it in DOMAIN_HOME/config-booted.jar(the config file on which the server is booted successfully) .

Most of the cases both of the file contents will be same. If the server fails to boot successfully the config-booted.jar will not be generated and the old config-booted.jar file will be left as it is.



Also whenever the domain configuration is modified, the admin server archive the previous configurations to the DOMAN_HOME\configArchive folder.The files use the naming convention as config-number.jar, where number is the sequential number of the archive.After it reaches the maximum number of archive files specified in the configuration(ArchiveConfigurationCount — 5), older archive files will be discarded



Recover the configurations


Follow the below steps to recover the configurations from archive

Stop the servers

Rename the current <<DOMAIN-HOME>>/config folder to config-bkp

Create a folder with name config under <<DOMAIN-HOME>>

cd to <<DOMAIN-HOME>>/configArchive in a command prompt

Execute the below command(change the archive file name as required)

tar -xf config-1.jar -C <<DOMAIN-HOME>>\config



Start the server — now the configurations are restored from the archive.


Friday, May 2, 2014

Transforming the REST XML message to SOAP message - OSB

Transforming the REST XML message to SOAP message - OSB

This post will explain how to Transform the REST XML message to SOAP message in OSB

While receiving the response from REST interface  with the content type as application\xml, the input XML will be plain without the target namespace specified.
But if you are invoking the BPEL with this message the BPEL cant perform any xpath operations on this message without target namespace.The target namespace should be added to the message.

The XSLT can be used to add the name space to the XML message but before performing this operation the SOAP envelope of the body variable should be removed
After removing the namespace the XML should be assigned to the body variable to send to target system.

Follow the below steps to achieve the same:

Remove SOAP Envelope:

The below XSLT will help as to remove the namespace from the XML.

Create a XSLT resource from SB console.
Add a Assign activity with the XSLT resource
Assign the output to a temp variable - var1.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()" />
        </xsl:copy>
      </xsl:template>

      <xsl:template match="soapenv:*">
        <xsl:apply-templates select="@* | node()" />
  </xsl:template>
</xsl:stylesheet>




Transforming the SOAP message to REST XML message- OSB

Transforming the SOAP message to REST XML message- OSB

While invoking the REST interface from OSB with the content type defined as application\xml, the target system will expect the simple XML message without the target namespace specified.

The XSLT can be used to remove the name space from SOAP message but before performing this operation the SOAP envelope of the body variable should be removed
After removing the namespace the XML should be assigned to the body variable to send to target system.

Follow the below steps to achieve the same:

Remove SOAP Envelope:

The below XSLT will help as to remove the namespace from the XML.

Create a XSLT resource from SB console.
Add a Assign activity with the XSLT resource
Assign the output to a temp variable - var1.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()" />
        </xsl:copy>
      </xsl:template>

      <xsl:template match="soapenv:*">
        <xsl:apply-templates select="@* | node()" />
  </xsl:template>
</xsl:stylesheet>

Removing Namespace:

The below XSLT will help as to add the target namespace to the XML.

Create a XSLT resource from SB console.
Add a Assign activity with the XSLT resouce  to remove the namespace from the variable var1
Assign the ouput to a temp variable - var2

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@* | node()" />
        </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
            <xsl:value-of select="." />
        </xsl:attribute>
    </xsl:template>
    <xsl:template match="text() | comment() | processing-instruction()">
        <xsl:copy />
    </xsl:template>
</xsl:stylesheet>

Assign the content of var2 to body:

Add replace activity to replace the node contents of body with var2




Unable to post the message to MQ through MQ adapter - Oracle SOA Suite

Unable to post the message to MQ through MQ adapter - Oracle SOA Suite

Sometimes we will be getting the below exception while posting the message to MQ  through MQ adapter in Oracle SOA Suite.

"Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Enqueue' failed due to: A webSphere MQ Error occurrred[while putting the message]. A webSphere MQ Error occurrred[while putting the message]. A webSphere MQ Error occurrred while putting the message in Queue: "EAI_ORD_RPLY_Q ". Please make sure that the Queue is Put enabled, not full, message do not exceeds maximum message length and QueueManger is up and running. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution."


Mainly this exception can occur if there is any issue with the MQ Adapter configuration or issue with the MQ server components.

The following steps can be followed to identify the issue.

MQ Adapter perspective:

Verify the MQSeriesAdapter health and state is fine


Verify the connection factory used in the Adapter is configured in weblogic server