Search This Blog

Friday, September 01, 2017

How to set loggers in SOA/OSB using WLST

How to set loggers in SOA/OSB using WLST
Change the following lines in the script with your variables

## change username , password and AdminServer URL
username ='weblogic'
password = 'Welcome1'
url='t3://localhost:7001'
## Change this String with the list of the loggers you want
loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']
## Change this String with the list of the servers you want to set the loggers
servers_list = ['AdminServer', 'soa_server1']


1. Script For setting runtime logger to TRACE:32


+++ Script For setting runtime logger to TRACE:32  +++



def setRuntimerLogger(serverName,loggerName,loggerLevel):
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')

    mbs.invoke(Mbean1,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def setPersistentLogger(serverName,loggerName,loggerLevel):
    Mbean2 =  ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)

    mbs.invoke(Mbean2,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def printPersistentlogeer(serverName,loggerName):

    Mbean1 = ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


def printRuntimelogeer(serverName,loggerName):

    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


if __name__ == '__main__':
    from wlstModule import *#@UnusedWildImport

print 'Starting the script to set the loggers ....'

# Change these properties as per your environment

username = 'weblogic'
password = 'Welcome1'
url='t3://localhost:7001'


## Change this String with the list of the loggers you want

loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']

## Change this String with the list of the servers you want to set the loggers

servers_list = ['AdminServer', 'soa_server1']

trace_32 = 'TRACE:32'
notification_1 = 'NOTIFICATION:1'

connect(username,password,url)
servers = cmo.getServers()
domainRuntime()

# for setting the runtime loggers

for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setRuntimerLogger(serverlist,logeerlist,"TRACE:32")
        printRuntimelogeer(serverlist,logeerlist)





print 'End of the script'




+++ Script Ends ++++   


2. Script For setting runtime logger to NOTIFICATION:1 (For disabling the loggers you have set previously) 

+++ Script For setting runtime logger to NOTIFICATION:1 (For disabling the loggers you have set previously)  +++



def setRuntimerLogger(serverName,loggerName,loggerLevel):
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')

    mbs.invoke(Mbean1,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def setPersistentLogger(serverName,loggerName,loggerLevel):
    Mbean2 =  ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)

    mbs.invoke(Mbean2,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def printPersistentlogeer(serverName,loggerName):

    Mbean1 = ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


def printRuntimelogeer(serverName,loggerName):

    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


if __name__ == '__main__':
    from wlstModule import *#@UnusedWildImport

print 'Starting the script to set the loggers ....'

# Change these properties as per your environment

username = 'weblogic'
password = 'Welcome1'
url='t3://localhost:7001'


## Change this String with the list of the loggers you want

loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']

## Change this String with the list of the servers you want to set the loggers

servers_list = ['AdminServer', 'soa_server1']

trace_32 = 'TRACE:32'
notification_1 = 'NOTIFICATION:1'

connect(username,password,url)
servers = cmo.getServers()
domainRuntime()

# for setting the runtime loggers

for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setRuntimerLogger(serverlist,logeerlist,"NOTIFICATION:1")
        printRuntimelogeer(serverlist,logeerlist)

print 'End of the script'


+++ Script Ends ++++   

3. Script For setting Persistent logger to TRACE:32

+++ Script For setting Persistent logger to TRACE:32  +++

def setRuntimerLogger(serverName,loggerName,loggerLevel):
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')

    mbs.invoke(Mbean1,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def setPersistentLogger(serverName,loggerName,loggerLevel):
    Mbean2 =  ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)

    mbs.invoke(Mbean2,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def printPersistentlogeer(serverName,loggerName):

    Mbean1 = ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


def printRuntimelogeer(serverName,loggerName):

    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


if __name__ == '__main__':
    from wlstModule import *#@UnusedWildImport

print 'Starting the script to set the loggers ....'

# Change these properties as per your environment

username = 'weblogic'
password = 'Welcome1'
url='t3://localhost:7001'


## Change this String with the list of the loggers you want

loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']

## Change this String with the list of the servers you want to set the loggers

servers_list = ['AdminServer', 'soa_server1']

trace_32 = 'TRACE:32'
notification_1 = 'NOTIFICATION:1'

connect(username,password,url)
servers = cmo.getServers()
domainRuntime()

# for setting the runtime loggers

for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setPersistentLogger(serverlist,logeerlist,"TRACE:32")
        printPersistentlogeer(serverlist,logeerlist)


print 'End of the script'


+++ Script Ends ++++   


4. Script For setting Persistent logger to NOTIFICATION:1 (For disabling the loggers you have set previously) 

+++ Script For setting Persistent logger to NOTIFICATION:1 (For disabling the loggers you have set previously)  +++



def setRuntimerLogger(serverName,loggerName,loggerLevel):
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')

    mbs.invoke(Mbean1,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def setPersistentLogger(serverName,loggerName,loggerLevel):
    Mbean2 =  ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)

    mbs.invoke(Mbean2,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])


def printPersistentlogeer(serverName,loggerName):

    Mbean1 = ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


def printRuntimelogeer(serverName,loggerName):

    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')


    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2


if __name__ == '__main__':
    from wlstModule import *#@UnusedWildImport

print 'Starting the script to set the loggers ....'

# Change these properties as per your environment

username = 'weblogic'
password = 'Welcome1'
url='t3://localhost:7001'


## Change this String with the list of the loggers you want

loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']

## Change this String with the list of the servers you want to set the loggers

servers_list = ['AdminServer', 'soa_server1']

trace_32 = 'TRACE:32'
notification_1 = 'NOTIFICATION:1'

connect(username,password,url)
servers = cmo.getServers()
domainRuntime()

# for setting the runtime loggers

for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setPersistentLogger(serverlist,logeerlist,"NOTIFICATION:1")
        printPersistentlogeer(serverlist,logeerlist)



print 'End of the script'


+++ Script Ends ++++   
   
   

Generic Script contains all four operations

+++ Script Start's ++++
def setRuntimerLogger(serverName,loggerName,loggerLevel):
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')
   
    mbs.invoke(Mbean1,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])
def setPersistentLogger(serverName,loggerName,loggerLevel):
    Mbean2 =  ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)
    
    mbs.invoke(Mbean2,'setLoggerLevel',[loggerName,loggerLevel], ["java.lang.String","java.lang.String"])
   
def printPersistentlogeer(serverName,loggerName):
   
    Mbean1 = ObjectName("oracle.logging:type=LogConfig,ServerName=" + serverName)
   
   
    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2
   
def printRuntimelogeer(serverName,loggerName):
   
    Mbean1 = ObjectName('oracle.logging:Location='+serverName +',name='+serverName+',type=LogRuntime')
   
   
    l2 =  mbs.invoke(Mbean1,'getLoggerLevel',[loggerName], ["java.lang.String"])
    if l2 == None:
        print serverName +  ' --> Logging Level for : ' + loggerName + ' --> None'
    else:
        print  serverName +  ' --> Logging Level for : ' + loggerName + ' --> ' +l2
   
if __name__ == '__main__':
    from wlstModule import *#@UnusedWildImport
print 'Starting the script to set the loggers ....'
# Change these properties as per your environment
username = 'weblogic'
password = 'Welcome1'
url='t3://localhost:7001'
## Change this String with the list of the loggers you want
loggers_list = ['oracle.as.scheduler', 'oracle.as.scheduler.metedata' ,'oracle.as.ess']
## Change this String with the list of the servers you want to set the loggers
servers_list = ['AdminServer', 'soa_server1']
trace_32 = 'TRACE:32'
notification_1 = 'NOTIFICATION:1'
connect(username,password,url)
servers = cmo.getServers()
domainRuntime()
# for setting the runtime loggers
for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setRuntimerLogger(serverlist,logeerlist,"TRACE:32")
        printRuntimelogeer(serverlist,logeerlist)
       
"""
# for setting the runtime loggers
for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setRuntimerLogger(serverlist,logeerlist,"TRACE:32")
        printRuntimelogeer(serverlist,logeerlist)
# for unsetting the runtime loggers you have set in the previos session
for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setRuntimerLogger(serverlist,logeerlist,"NOTIFICATION:1")
        printRuntimelogeer(serverlist,logeerlist)
# Set Persistent loggers
for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setPersistentLogger(serverlist,logeerlist,"TRACE:32")
        printPersistentlogeer(serverlist,logeerlist)
       
# for unsetting the previous presistent loggers
for logeerlist in loggers_list:
    for serverlist in servers_list:
        print 'Setting loggers for ' + serverlist +'  --> ' + logeerlist
        setPersistentLogger(serverlist,logeerlist,"NOTIFICATION:1")
        printPersistentlogeer(serverlist,logeerlist)
"""
print 'End of the script'
   
+++ Script End's ++++
   



Tags: Publish
September 02, 2017 at 11:26AM
Open in Evernote

Wednesday, August 16, 2017

Java Code to Parse SOA Adapter's Plan.xml file

Java Code to Parse SOA Adapter's Plan.xml file
import java.io.File;

import java.util.ArrayList;
import java.util.HashMap;

import java.util.Map;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ParsePlan_XML {

public static void main(String[] args) {
ArrayList<String> jndi_names = new ArrayList<String>();
HashMap<String, String> hm1 = new HashMap<String, String>();

HashMap<String, String> hm = new HashMap<String, String>();



File inputFile = new File(args[0]);

try {

DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(inputFile);
doc.getDocumentElement().normalize();
// System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("variable");

for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);

if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;

hm.put(eElement.getElementsByTagName("name")
.item(0)
.getTextContent(), eElement.getElementsByTagName("value")
.item(0)
.getTextContent());

}
}
for (Map.Entry m : hm.entrySet()) {
// System.out.println(m.getKey() + " " + m.getValue());
}
} catch (Exception e) {
e.printStackTrace();
}

try {

final String regex_name = "(.*jndi-name=\"eis\\/yum\\/sftpAdapter\"](.*)name=)(.*)]\\/name";

final String regex = ".*jndi-name=(.*)]\\/jndi-name";
//final String string = "/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface=\"javax.resource.cci.ConnectionFactory\"]/connection-instance/[jndi-name=\"eis/yum/sftpAdapter\"]/jndi-name";

// File inputFile = new File("E:\\tars-download\\3-14734264081\\Plan.xml");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(inputFile);
doc.getDocumentElement().normalize();
// System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("variable-assignment");

for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
// System.out.println("\nCurrent Element :"
// + nNode.getNodeName());
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;

hm1.put(eElement.getElementsByTagName("name")
.item(0)
.getTextContent(), eElement.getElementsByTagName("xpath")
.item(0)
.getTextContent());

final String string = eElement.getElementsByTagName("xpath")
.item(0)
.getTextContent();

for (Map.Entry m : hm1.entrySet()) {
// System.out.println(m.getKey()+" "+m.getValue());

}
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);

while (matcher.find()) {

for (int i = 1; i <= matcher.groupCount(); i++) {
jndi_names.add(matcher.group(i));
// System.out.println("Group " + i + ": " + matcher.group(i));

}
}

}

}

for (int i = 0; i < jndi_names.size(); i++) {

System.out.println();

for (Map.Entry m : hm1.entrySet()) {

String s1 = jndi_names.get(i).replaceAll("/", "\\\\/");
// System.out.println(s1);
String regex_value1 = "(.*jndi-name=" + s1 + "](.*)name=)(.*)]\\/value";
// regex_value= regex_value.replaceAll("/", "\\/");
// System.out.println(regex_value1);
String string = m.getValue().toString();
// System.out.println(string);
final Pattern pattern = Pattern.compile(regex_value1);
final Matcher matcher = pattern.matcher(string);

while (matcher.find()) {
System.out.println(jndi_names.get(i) + " " + matcher.group(3) + " " + hm.get(m.getKey()));
// System.out.println(hm.get(m.getKey()));

}

}
// System.out.println(jndi_names.size());
// System.out.println(jndi_names.get(i));
// System.out.println(string1);

}
} catch (Exception e) {
e.printStackTrace();
}
}

}


Tags: Publish
August 16, 2017 at 04:57PM
Open in Evernote

Wednesday, July 19, 2017

Script for getting JVM Import Parameters like threadudmp , java flags , command line arguments etc

Script for getting JVM Important Parameters like threadudmp , java flags , command line arguments etc
jcmd -l | grep weblogic.Server | awk '{print $1}' | while read pid; do
   echo 'Java Properties and Thread Dump for pid ' "$pid" 'Start time' `date`
   echo "$pid" Thread.print
   jcmd "$pid" Thread.print
   echo "$pid" VM.system_properties
   jcmd "$pid" VM.system_properties
   echo "$pid" VM.flags
   jcmd "$pid" VM.flags
   echo "$pid" VM.command_line
   jcmd "$pid" VM.command_line
   echo "$pid" VM.version
   jcmd "$pid" VM.version
   echo "$pid" VM.uptime
   jcmd "$pid" VM.uptime
done




Tags: Publish
July 19, 2017 at 12:08PM
Open in Evernote

Wednesday, April 12, 2017

Read File As attachment from a File Adapter in SOA

Read File As attachment from a File Adapter in SOA








Attach a BPEL process to it with the BPEL code as

 <assign name="Assign1">
      <copy>
        <from expression="ora:getAttachmentContent('Receive1_Read_InputVariable','attach','/ns2:attachmentElement')"/>
        <to variable="Variable1"/>
      </copy>
    </assign>

++

Copy the file test1.xml to the directory /tmp/readattach1.

Open EM and go to the flow trace

for variable1 you should see the data as

<Variable1>
<Variable1  xsi:type="ns:string">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8+Cjxwcm9jZXNzIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiCiAgICAgICAgIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL3htbG5zLm9yYWNsZS5jb20vQXBwbGljYXRpb24yL1Byb2plY3QzL0JQRUxQcm9jZXNzMSB4c2QvQlBFTFByb2Nlc3MxLnhzZCIKICAgICAgICAgICAgICAgICAgeG1sbnM9Imh0dHA6Ly94bWxucy5vcmFjbGUuY29tL0FwcGxpY2F0aW9uMi9Qcm9qZWN0My9CUEVMUHJvY2VzczEiPgogICAgICAgICAgICAgICAgICAgIDxpbnB1dD5SQVZJPC9pbnB1dD4KICAgICAgICAgICAgICAgICAgICA8L3Byb2Nlc3M+Cgo=</Variable1>
</Variable1>

This is in base64 encoded format








Tags: Publish
April 12, 2017 at 01:09PM
Open in Evernote

Thursday, April 06, 2017

How to debug OSB server remotely from Jdeveloper

How to debug OSB server remotely from Jdeveloper
For this you need to have a domain created in Development Mode and also if possible create a compact domain.

once this is done identify the DEBUG Port for OSB ,

cd /fmw11g/soa12212/user_projects/domains/osb_domain_cd/bin

find . -name "*" -print | xargs grep -i -l ALSB_DEBUG
./setStartupEnv.sh

find . -name "*" -print | xargs grep -i -l ALSB_DEBUG | xargs cat | grep ALSB_DEBUG

This shows the port as 7453. This is the remote port for the OSB.

Not down the machine name and the above port number.

Open the OSB project in jDeveloper and deploy this project.

Open the pipe line in OSB and set a break point

Right Click on the Project -> Project Properties
Click on Run/Debug 

Create a new Configuration with the name as OSB 




Ensure that remote debugging is set 


Specify the hostname and port


Click on OK and close the dialog boxes.


Click on OSB project 

Now this show's a dialog with debug port and hostname 


Click on OK and invoke the OSB Flow from SOAP UI or from the SB Console.

Now you can do single stepping and watch the variables etc.








Tags: Publish
April 06, 2017 at 12:57PM
Open in Evernote

Monday, April 03, 2017

OSB result Caching support in 11g with external coherence

OSB result Caching support in 11g with external coherence
OSB result Caching support in 11g




Created a simple SOA project with the simple helloworld that displays time+the input parameter you have passed.


for example

concat(xp20:current-dateTime(),bpws:getVariableData('inputVariable','payload','/client:process/client:input'))


Create a OSB project that calls this web service and enable the result cahcing for the business service.
Take this WSDL and import this to OSB and create a business service with this WSDL.

OSB Project 



Create a proxy service based on the business service.

Modify the file

\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-override.xml
======================================================================================================================



<!DOCTYPE coherence SYSTEM "coherence.dtd">
<coherence>
    <cluster-config>
        <!--
            By specifying a well-known-address we disable the mutlicast listener.
            This ensures that the Coherence cluster for OSB will be isolated to this machine only.
        -->
        <unicast-listener>
            <well-known-addresses>
                <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>
                <socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>
            </well-known-addresses>
            <address system-property="OSB.coherence.localhost">xxx.xxx.oracle.com</address>
            <port system-property="OSB.coherence.localport">7890</port>
        </unicast-listener>
        <multicast-listener>
            <time-to-live system-property="OSB.coherence.ttl">0</time-to-live>
        </multicast-listener>
    </cluster-config>
</coherence>

+++++++++++++

Where
 <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>

Is for the stand alone Coherence server

<socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>

Is for the OSB Server

No need to change the file
\\soabde11\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-cache-config.xml

Once it is done , open the setDomainEnv.sh file

EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

The default entries are

#EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

basically you need to remove
-Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778
and replace this with
-Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890


Create a shell script to start the Coherence server

+++++

#!/bin/sh

# Change below to appropriate location
JAVA_HOME="/home/oracle/jdk1.7.0_67"
WLS_HOME="/fmw11g/fmw1117/Middleware"
COHERENCE_HOME="${WLS_HOME}/coherence_3.7/"
OSB_ORACLE_HOME="${WLS_HOME}/Oracle_OSB1"
OSB_COHERENCE_CONFIG="${WLS_HOME}/user_projects/domains/soa_domain/config/osb/coherence"

NEW_SIZE=2048m
HEAP_SIZE=4096m

NODE_NAME="CacheServer"

# Change below to appropriate ip address and port
LOCAL_HOST="xxx.xxx.oracle.com"
LOCAL_PORT="9094"

JAVA_OPTS="-Xloggc:gc_${NODE_NAME}.log -server -XX:NewSize=${NEW_SIZE} -XX:MaxNewSize=${NEW_SIZE} -Xms${HEAP_SIZE} -Xmx${HEAP_SIZE} -XX:PermSize=128m -XX:MaxPermSize=128m -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails"

JMXPROPERTIES="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true "

COHERENCE_OPTS="-Dtangosol.coherence.distributed.localstorage=true -Dtangosol.coherence.override=${OSB_COHERENCE_CONFIG}/osb-coherence-override.xml -Dtangosol.coherence.cacheconfig=${OSB_COHERENCE_CONFIG}/osb-coherence-cache-config.xml -Dtangosol.coherence.log.level=9 -Dtangosol.coherence.cluster=OSB-cluster -Dtangosol.coherence.localhost=${LOCAL_HOST} -Dtangosol.coherence.localport=${LOCAL_PORT}"

CLASSPATH="$COHERENCE_HOME/lib/coherence.jar:$OSB_ORACLE_HOME/lib/osb-coherence-client.jar"

$JAVA_HOME/bin/java -server -showversion $JAVA_OPTS $COHERENCE_OPTS $JMXPROPERTIES -cp "$CLASSPATH" com.tangosol.net.DefaultCacheServer $1

+++++

First start the coherence server using the script
c1.sh

and after this start the OSB Server.





Tags: Publish
April 03, 2017 at 02:22PM
Open in Evernote