Showing posts with label OC4J. Show all posts
Showing posts with label OC4J. Show all posts

Wednesday, September 3, 2008

Oracle Support on VMWare / Virtualized environment

Oracle does not support Oracle Products installed on VMware as Oracle has not certified any of its products on VMware virtualized environments.

If the issue does not occur in a non-virtual deployment, you will be referred to work with VM Product Company.

For details, look on oracle metalink (https://metalink.oracle.com) for the following document:

Support Position for Oracle Products Running on VMWare Virtualized Environments

Doc ID: Note:249212.1 Type: ANNOUNCEMENT
Last Revision Date: 16-NOV-2007 Status: PUBLISHED

Friday, July 11, 2008

Monitoring OIM Apps / Listeners - Automatic Startups

The code here checks the Peoplesoft listener in OC4J environment that keep crashing unexpectedly in OIM 903 for some reason. The XML messages sent from PeopleSoft gets queued and won't reach OIM. The listener servlet throws the HTTP 500 Internal Server error. So, to restart the listener automatically, we can use the following code. You can set this code to execute at specific intervals to recheck and recycle the app, if in case it is down.

==========================================
PSFTListenerUtility.java
==========================================
import java.io.*;
import java.net.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;

public class PSFTListenerUtility extends SchedulerBaseTask {

private boolean stop;

public PSFTListenerUtility() {
super("PSFTListenerUtility");
stop = false;
}

@Override
public void execute() {

HashMap myMap = new HashMap();
myMap.put("http://idmdev.bhatiacorp.com:7777/peopleSoftUsrHRM/do/peopleSoftAction", "peopleSoftUsrHRM");
myMap.put("http://idmdev.bhatiacorp.com:7777/peopleSoftUsrCRM/do/peopleSoftAction", "peopleSoftUsrCRM");
myMap.put("http://idmdev.bhatiacorp.com:7777/peopleSoftUsrPRT/do/peopleSoftAction", "peopleSoftUsrPRT");


Iterator iterator = myMap.keySet().iterator();
while (iterator.hasNext()) {
Object key = iterator.next();
String temp = key.toString();
try {
URL url = new URL(temp);
boolean isAlive = getURLOutput(url);
if (!isAlive) {
try {
//restart
String applicationName = (String) myMap.get(key);
logger.debug(" --- REBOOTING PEOPLESOFT LISTENER --- ");
logger.debug(" --- LISTENER NAME: " + applicationName +" --- ");
Runtime.getRuntime().exec("/opt/oracle/product/t01idm_app/opmn/bin/opmnctl startproc application="+applicationName);
} catch (IOException ex) {
Logger.getLogger(PSFTListenerUtility.class.getName()).log(Level.SEVERE, null, ex);
}
}
// Object val = myMap.get(URL);
} catch (MalformedURLException ex) {
Logger.getLogger(PSFTListenerUtility.class.getName()).log(Level.SEVERE, null, ex);
}
}
}

public boolean getURLOutput(URL url) {
BufferedReader in = null;
String inputLine;
boolean isAlive = true;
try {
in = new BufferedReader(new InputStreamReader(url.openStream()));
//for 500 Internal Server error, an exception will be caught.
in.close();
} catch (IOException ex) {
isAlive = false;
logger.debug("PEOPLESOFT LISTENER NOT RUNNING!");
Logger.getLogger(PSFTListenerUtility.class.getName()).log(Level.SEVERE, null, ex);

}

return isAlive;
}

@Override
public boolean stop() {
logger.debug("Entering PSFTListenerUtility.stop()");
logger.warn(" ---- Stopping current task ---- ");
stop = true;
logger.debug("Exiting PSFTListenerUtility.stop()");
return stop;
}
}


courtesy:Askar Zaidi