Tuesday, February 25, 2014

SOA-INFRA app is not starting up - Oracle SOA Suite 11g

SOA-INFRA app is not starting up - Oracle SOA Suite 11g:

When we restarted the soa server, the soa server came up properly except the SOA-INFRA app.
The status of the SOA-INFRA app in weblogic console is failed and also the SOA node in the em console is not displayed.



We could not able to find any particular error from log files including diagnostic log except schema mismatch error with some of the composites.It  seems due to some reason the status of the soa-infra application is failed and the server is restarted without fixing the actual issue then even after fixing the issue and restarting the server the soa-infra app is not Active.

We have tried deleting the following folders from $DOMAIN_HOME/servers/AdminServer
data
temp 
cache 

Unfortunately even after deleting the above folders the SOA-INFRA app did not come up. 

Tried starting the SOA-INFRA app manually from weblogic console, this time the SOA-INFRA app came up and we could able to see the SOA in em console.





Tuesday, January 28, 2014

ODL handler configuration through WLST script - Oracle SOA Suite

ODL handler configuration through WLST script - Oracle SOA Suite:

Oracle Fusion Middleware components write diagnostic log files in the Oracle Diagnostic Logging (ODL) format. Log file naming and the format of the contents of log files conforms to an Oracle standard. By default, the diagnostic messages are written in text format.

ODL provides the following benefits:

The capability to limit the total amount of diagnostic information saved. You can set the level of information saved and you can specify the maximum size of the log file and the log file directory.

When you reach the specified size, older segment files are removed and newer segment files are saved in chronological fashion.

Components can remain active, and do not need to be shutdown, when older diagnostic logging files are deleted.

The ODL configuration can be changed from EM console or WLST script.

Below is the WLST script help us to change the ODL handler setting.

Configureodlloghandlers.py

folderPath="/oracle/product/soa/11g/fmw/fmwlogs/SOACoreDomain"
domainAdminUserName = "weblogic"
domainAdminPassword = "welcome1"
connect(domainAdminUserName, domainAdminPassword, "t3://localhost:7001")
servers = adminHome.getMBeansByType('Server')
for s in servers:
edit()
startEdit()
serverName1 = s.getName()
path = '/Servers/' + serverName1
cd(path)
lh = listLogHandlers()
for l in lh:
lname = l.get('name')
odlfile = folderPath + '/logs/' + serverName1 + '/' + serverName1 + '-' + lname + '-diagnostic.log'
print 'Diagnostic path===>',odlfile
configureLogHandler(target=serverName1,name=lname, path=odlfile)
save()
activate()

The other details like maxFileSize,rotationFrequency and retentionPeriod  etc can also be changed through configureLogHandler method.

Executing the script:

$MIDDLEWARE_HOME/Oracle_SOA/common/bin/wlst.sh Configureodlloghandlers.py



Tuesday, January 14, 2014

Polling the Message from WebSphere MQ using MQ Transport in OSB

Polling the Message from WebSphere MQ using MQ Transport in OSB

OSB MQ transport help us to post/receive message from the WebSphere MQ. The MQ transport can be configured to poll the queue for the new messages.


This blog explains how to configure the OSB Proxy Service to poll the Queue for new messages.

Steps to configure the OSB Proxy Service to poll the Queue for new messages

Create a OSB Project and Create a Resource of  type MQ Connection.


Provide the MQ Connection details like host name,port number,Queue Manager Name, Channel Name and also provide Connection Pool Size, Connection Timeout and Connection Max Wait. Provide the Static Service Account if User Name/Password is required to connect to MQ and leave the Connection type as default value(tcp mode). Save the connection details.





Monday, January 13, 2014

Remote Java Client to Post the Message to IBM MQ

Remote Java Client to Post the Message to IBM MQ

The below java code will help us to post the message to remote IBM MQ.

package mqclient;
import com.ibm.mq.jms.*;
import javax.jms.*;

public class MQJavaClient {
 
    public static void main(String[] args)
     {
      try {
       MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
       cf.setHostName("10.130.134.178");        
       cf.setPort(2022);    
       cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);  
       cf.setQueueManager("EAI1");
       cf.setChannel("T_CRM_FUSION_CLIENT");
       
       MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();
       MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
       MQQueue queue = (MQQueue) session.createQueue("queue:///DUMMY_Q?targetClient=1");    
       MQQueueSender sender =  (MQQueueSender) session.createSender(queue);
     
     
      String message="<ns1:EmployeeRequest xmlns:ns1=\"http://xmlns.oracle.com/JEJBSample/EmployeeDetailService/EmployeeDetailService\">\n" +
      "<ns1:empNo>987654</ns1:empNo>\n" +
      "</ns1:EmployeeRequest>";
     
       TextMessage textMessage = (TextMessage) session.createTextMessage(message);  
       connection.start();
       sender.send(textMessage);    
     
       sender.close();
       session.close();
       connection.close();
   
      }catch (Exception e) {
          e.printStackTrace();
     
      }
     }
}

Jar Files Required:

com.ibm.mq.jar
com.ibm.mqjms.jar
javax.jms.jar
com.ibm.dhbcore.jar
javax.resource.jar
javax.transaction.jar



Friday, January 10, 2014

Initiating an OSB Service with Email

Initiating an OSB Service with Email

Email transport will help us to send/receive emails in OSB. Some cases we may required to initiate the external service based on the email in the user inbox.


The Proxy service polls the Mail Inbox for the new messages and invokes the Business service whenever there is a new message in the Inbox.The polling interval can be specified in the Proxy Service configuration.Here i will explain about invoking the service with the XML message received from the email body.

Invoking the service with the XML message received from the email body

Create a XSD message structure that will be used by Proxy Service to receive the message

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/JEJBSample/EmployeeDetailService/EmployeeDetailService"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="EmployeeRequest">
<complexType>
<sequence>
<element name="empNo" type="string"/>
</sequence>
</complexType>
</element>
</schema>

Create a OSB project and create a Business service that needs to be invoked based on the Email content - Here i am invoking a sample BPEL service with the same XSD structure as input.

Create a Service Account with Static username/password of email user.