Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, April 07, 2010

Exception in thread "main" java.lang.NoClassDefFoundError: oracle/bi/analytics/management/StandardConsoleAgent

Hi Friends,

This is my newest experiment going on with OBIEE Management Pack in Oracle Enterprise Manager (OEM) Tool (Oracle Management Server (OMS)) & OBIEE Application.

OBIEE Management Pack needs to read the performance values exposed over JMX. In order to start this utility, we need to configure the runagent.sh or runagent.cmd under /$OBIEE_ROOT/systemsmanagement/

Following is the sample runagent.sh file setup for a OBIEE Setup on Unix Platform:

#!/bin/sh
# this is a template of runagent.sh to be used on Unix.
# The installer will fill in JAVA_HOME, SAROOTDIR, and SATEMPDIR

export JAVA_HOME="/usr/java/jdk1.5.0_19"
export SAROOTDIR=/$OBIEE_ROOT/
export SADATADIR=/$OBIEE_DATA/
export SATEMPDIR=/$OBIEE_DATA/tmp
export UNIXPERFDIR=${SATEMPDIR}

java_cmd="${JAVA_HOME}/bin/java -Djava.library.path=${SAROOTDIR}/server/Bin -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9980 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -classpath analytics-jmx.jar:lib/xmlparserv2.jar oracle.bi.analytics.management.StandardConsoleAgent"

${java_cmd}


Now if you carefully observe, if you invoke the script from your home directory, the classpath will fail to resolve & give error like:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/bi/analytics/management/StandardConsoleAgent

Above issue is purely due to the way classpath parameter is given in java_cmd: -classpath analytics-jmx.jar:lib/xmlparserv2.jar oracle.bi.analytics.management.StandardConsoleAgent

The analytics-jmx.jar & xmlparsev2.jar are not resolved as absolute path locations are not given here. So you need to manually change your directory till /$OBIEE_ROOT/systemsmanagement/ & then invoke runagent.sh file to start the JMX Performance counters successfully.

The JMX Performance Counters needs to be exposed constantly so that OBIEE Management Pack reads correct values. To achieve this, you need to start the runagent.sh file in background mode. e.g.-bash-3.00$ runagent.sh &  or-bash-3.00$ nohup runagent.sh & so even after you logoff your session, the utility keeps running & gathers correct values.

Enjoy!

Keywords:
OBIEE, Siebel Analytics, Business Intelligence, Oracle Enterprise Manager Grid Control, OMS, Oracle Management Server, OEM, Grid Control, JMX, JAVA, OBIEE Performance, etc

Monday, April 05, 2010

Installshield Installer JRE issue

Hi Friends,

Java based installshield installer comes with its own bundled JRE. If this bundled JRE gets corrupted, then you will be in a great pain to start the installer as it will report errors like:

This application requires a Java Run Time Environment (JRE)
         to run. Searching for one on your computer was not successful.
          Please use the command line switch -is:javahome to specify
          a valid JRE.  For more help use the option -is:help.


Even though you try to specify a valid JAVA HOME using -is:javahome option, still the installer will fail to start & keep giving me the same error, the reason being installshield needs a very specific JRE & it wont accept any JRE passed as an -is:javahome option!

Such particular issue is encountered with Siebel Uninstallers on Linux/Unix platform.
Siebel product uninstallers exist in /$SIEBEL_ROOT/_uninst/uninstall.ksh

You need to start the uninstaller by passing the product name as an option:
E.g. If we need to uninstall Siebel Web Server Extensions (SWSE), then we would invoke the uninstaller as:
./uninstall.ksh eappweb

Now, if you receive the JRE issue, then there is pre-extracted Installshield JRE which is corrupted.
Such JRE exists in the Product directory which you are trying to uninstall:
e.g. /$SIEBEL_ROOT/_uninst/eappweb/_jvm

In order to fix this issue, the only option you have is to restore the _jvm directory from backup or copy the contents of _jvm from a different machine having similar Siebel Setup & overwrite the contents in the corrupted JRE directory.

While i was researching on this issue, i came across solution for IBM Product Installshield Installers, was to setup the below Environment variable to successfully bypass this error:
set JAVA_COMPILER=NONE
or
export JAVA_COMPILER=NONE

Hope this info helps if you come across installshield issues.

Keywords:
siebel crm,siebel customer relationship management,siebel solutions,siebel support,siebel supportweb,siebel systems, Installshield, JAVA, JRE, JVM, Uninstaller, JAVA_COMPILER, etc.

Monday, March 24, 2008

Oracle Apps - Java Concurrent Program

Writing a Java Concurrent Program

Concurrent Processing provides an interface JavaConcurrentProgram with abstract method runProgram() which passes the concurrent processing context CpContext. The concurrent program developer will implement all of their business logic for a concurrent program in runProgram().
CpContext will have the request specific log and output file input methods. The class name with the runProgram() method will be registered as the java executable file name in the register executable form.

Follow the following generic format to write a Java Concurrent Program…

package oracle.apps.yourpackage.subpackage;

import oracle.apps.fnd.common.Context;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.cp.request.*;
import oracle.apps.fnd.util.*;

public class HelloWorldApp
implements JavaConcurrentProgram{
public void runProgram(CpContext ctx){

//Obtain the reference to the Output file for Concurrent Prog
OutFile out = ctx.getOutFile();

//Obtain the reference to the Log file for Concurrent Prog
LogFile log = ctx.getLogFile();

try{

//To read parameters passed via Concurrent Program
String myName = null;
ParameterList lPara = ctx.getParameterList();
while (lPara.hasMoreElements())
{
NameValueType aNVT = lPara.nextParameter();
if ( aNVT.getName().equalsIgnoreCase("My Name") )
myName = aNVT.getValue(););
}

//Write your logic here

out.writeln("This will be printed to the Output File");

log.writeln("This will be printed to the Log File", 0);

//Request the completion of this Concurrent Prog
//This step will signal the end of execution of your Concurrent Prog
ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL,  "Completed.");
}
//Handle any exceptional conditions
catch(Exception e){
StackTraceElement ste[] = e.getStackTrace();
for(int i=0; i<ste.length; i++){
log.writeln(ste[i].toString(), 0);
}
}
}
}


Best Practice

As a best practice, use Oracle JDeveloper patched with the following patch number: 6012619. You can download it from Metalink. This patched release of JDeveloper includes all the FND packages and other requisite packages commonly used while writing Java Concurrent Programs. You may use Eclipse, but you will have to manually copy all the packages from Oracle Apps Server to your local machine and give its reference to the project.

Porting Third-Party Libraries

Ask the DBA to place all the requisite third-party libraries under $JAVA_TOP. To make the third-party libraries available to your JCP, follow the steps outlined below to create your Concurrent Program Executable and to create the actual Concurrent Program.

Create Concurrent Program Executable

Path: Concurrent -> Program -> Executable
Create the concurrent program executable, details of which are as follows:
Executable   : HelloWorld
Short Name   : HelloWorld
Application   : Custom Applications
Execution Method  : Java Concurrent Program
Execution File Name         : HelloWorldApp This is your main class file
Execution File Path  : oracle.apps.yourpackage.subpackage

Create the Concurrent Program

Path: Concurrent -> Program -> Define
We are having one concurrent program.
Program  : HelloWorld Java Concurrent Program
Short Name : HELLOWORLDJCP
Application : Custom Applications
Description : Hello World Program
Executable Name : HelloWorld
Executable Method : Java Concurrent Program
Options  : -classpath  /dv00/oracle/product/DEV1110/java:/dv00/oracle/apps/DEV1110/11.5/au/11.5.0/java/appsborg.zip:/dv00/oracle/product/DEV1110/java/thirdParty1.jar:/dv00/oracle/product/DEV1110/java/thirdParty2.jar
Note:- If your JCP does not make use of any Third-Party libraries, then please DO NOT put any entry in the Options.
The Options to be specified must be fully qualified. Use of environment variables will fail the execution of the Java Concurrent Program.
/dv00/oracle/product/DEV1110/java - This is the path to my $JAVA_TOP
/dv00/oracle/apps/DEV1110/11.5/au/11.5.0/java/appsborg.zip - This is the path to my $AU_TOP/java/appsborg.zip
/dv00/oracle/product/DEV1110/java/thirdParty1.jar - This is the JAR reference to my first Third Party Library dependency.
/dv00/oracle/product/DEV1110/java/thirdParty2.jar - This is the JAR reference to my second Third Party Library dependency.
The paths must be set for appropriate environment as specified above and must be separated using a colon “:” without any new-line characters.

Keywords: apps software,concurrent application,concurrent applications,concurrent tutorial,java application,java concurrent program,java concurrent programming,java example,java examples,
java programming,java sample,java sample code,java source code,java tutorial,java tutorial program,oracle resume