Raj Varanasi

Greenhorn
+ Follow
since Nov 20, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Raj Varanasi

Hi,
Usually hostname will be node name for websphere in a clustered environment.You can use the following code(jsp code) to get the hostname in ur java application.This is for solaris environment.

<%@ page import="java.io.*"%>
<%
String command = "hostname";
Process p = Runtime.getRuntime().exec(command);
String s =null;
DataInputStream in = new DataInputStream(p.getInputStream());
while ((s = in.readLine()) != null) {
out.println("Hostname is: " + s);
}
%>
22 years ago
Hi,
Is your application server is getting restarted when the problem occurs ? The same thing happend to us once when we debugged ,we found the application server is getting restarted frequently .Because of the restarts connectionpool keep on increasing with out releasing the old connections.
22 years ago
Hi,
Are you giving complete command like "adminclient.sh remotehostname bootstrapport" while invoking admin client from remote machine ?
22 years ago
You can $APP_ROOT/bin/EARExpander.sh shell script to deploy your ear and war file.You need to supply all the neccessary parameters to this script to expand the ear file.
22 years ago
We are POST ing form data .When it reaches App Server POSTed data got corrupted and we are facing problems in the application.We will try applying th fixpack 4.0.3 .Thanks for the updates
22 years ago
Hi ,
Did anybody found the problem with HTTP POST size limit.We are getting the same problem,POST data is getting truncated. Is it helps if we use Apache instead of IHS ??? Any help appreciated ...
22 years ago
You need to have cm.jar (which will be there in $APP_SERVER_ROOT/lib ) in your classpath to access connectionpool related classes.
22 years ago
You need to configure this new hostname and dns as alias in the virtualhost you are using for your application server.Then regenerate the plugin information by going to the advanced tab of any one of the Servlet Engines of the app servers.This should change the timestamp of vhosts.properties in $WAS_ROOT/temp/ directory.Restart your web server and try to access thru browser with the new host name.
22 years ago
We are also got the same problem but in a different environment(Solaris,was3.5.4).What we found out later is there is a infinite loop in that class.Because of that it is using lot of %CPU. We have modified that class and then it is working fine.
22 years ago
Hi ,
Anybody got the source code for GCStats.java compatible with jdk1.2.2,I have an older version which works fine with jdk1.1.8.When i am trying to use this with WebsphereV3.5.4(jdk1.2.2) for analyzing verbosegc output in stderr.
Here is the source code i got

// GCStats.java
// This utility tabulates data generated from a verbose garbage collection trace.
// To run this utility type:
// java GCStats inputfile [total_time]
//
// Gennaro (Jerry) Cuomo - IBM Corp. 03/2000
// Carmine F. Greco 3/17/00 - JDK1.2.2 compatibility
//
import java.io.*;
import java.util.*;
public class GCStats {
static int total_time=-1; // total time of run in ms
static long total_gctime=0, total_gctime1=0; // total time spent in GCs
static long total_bytes=0, total_bytes1=0; // total bytes collected
static long total_free=0, total_free1=0; // total
static int total_gc=0; // total number of GCs
static boolean verbose=false; // debug trace on/off
public static void parseLine(String line) {
// parsing a string that looks like this...
// <GC(31): freed 16407744 bytes in 107 ms, 97% free (16417112/16777208)>
if (isGCStatsLine(line)) { // First test if line starts with "<GC..."<br /> if (verbose) System.out.println("GOT a GC - "+line);<br /> long temp=numberBefore(line, " bytes")/1024; // get total memory collected<br /> total_bytes+=temp; total_bytes1+=(temp*temp);<br /> temp=numberBefore(line, " ms"); // get time in GC<br /> total_gctime+=temp; total_gctime1+=(temp*temp);<br /> temp=numberBefore(line, "% free"); // get time % free<br /> total_free+=temp; total_free1+=(temp*temp);<br /> if (temp!=0) {<br /> total_gc++; // total number of GCs<br /> }<br /> }<br /> }<br /> public static int numberBefore( String line, String s) {<br /> int ret = 0;<br /> int idx = line.indexOf(s);<br /> int idx1= idx-1;<br /> if (idx>0) {
// the string was found, now walk backwards until we find the blank
while (idx1!=0 && line.charAt(idx1)!=' ') idx1--;
if (idx1>0) {
String temp=line.substring(idx1+1,idx);
if (temp!=null) {
ret=Integer.parseInt(temp); // convert from string to number
}
} else {
if (verbose) System.out.println("ERROR: numberBefore() - Parse Error looking for "+s);
}
}
return ret;
}
public static boolean isGCStatsLine(String line) {
return ( (line.indexOf("<GC") > -1) && (line.indexOf(" freed")>0) && (line.indexOf(" bytes")>0));
}
public static void main (String args[]) {
String filename=null;
BufferedReader foS=null;
boolean keepgoing=true;
if (args.length==0) {
System.out.println("GCStats - ");
System.out.println(" - ");
System.out.println(" - Syntax: GCStats filename [run_duration(ms)]");
System.out.println(" - filename = file containing -verbosegc data");
System.out.println(" - run_duration(ms) = duration of fixed work run in which GCs took place");
return;
}
if (args.length>0) {
filename=args[0];
}
if (args.length>1) {
total_time=Integer.parseInt(args[1]);
}
if (verbose) System.out.println("Filename="+filename);
try {
foS = new BufferedReader(new FileReader(filename));
} catch (Throwable e) {
System.out.println("Error opening file="+filename);
return;
}
while (keepgoing) {
String nextLine;
try {
nextLine=foS.readLine();
} catch (Throwable e) {
System.out.println("Cannot read file="+filename);
return;
}
if (nextLine!=null) {
parseLine(nextLine);
} else {
keepgoing=false;
}
}
try {
foS.close();
} catch (Throwable e) {
System.out.println("Cannot close file="+filename);
return;
}
System.out.println("-------------------------------------------------");
System.out.println("- GC Statistics for file - "+filename);
System.out.println("-------------------------------------------------");
System.out.println("-**** Totals ***");
System.out.println("- "+total_gc+" Total number of GCs");
System.out.println("- "+total_gctime+" ms. Total time in GCs");
System.out.println("- "+total_bytes+" Kbytes. Total memory collected during GCs");
System.out.println("- ");
System.out.println("-**** Averages ***");
double mean=total_gctime/total_gc,
stddev=Math.sqrt((total_gctime1-2*mean*total_gctime+total_gc*mean*mean)/total_gc);
int imean=new Double(mean).intValue(), istddev=new Double(stddev).intValue();
System.out.println("- "+imean+" ms. Average time per GC. (stddev="+istddev+" ms.)");
mean=total_bytes/total_gc; stddev=Math.sqrt((total_bytes1-2*mean*total_bytes+total_gc*mean*mean)/total_gc);
imean=new Double(mean).intValue(); istddev=new Double(stddev).intValue();
System.out.println("- "+imean+" Kbytes. Average memory collected per GC. (stddev="+istddev+" Kbytes)");
mean=total_free/total_gc; stddev=Math.sqrt((total_free1-2*mean*total_free+total_gc*mean*mean)/total_gc);
imean=new Double(mean).intValue(); istddev=new Double(stddev).intValue();
System.out.println("- "+imean+"%. Free memory after each GC. (stddev="+istddev+"%)");
if (total_time>0 && total_gctime>0) {
System.out.println("- "+((total_gctime*1.0)/(total_time*1.0))*100.0+"% of total time ("+total_time+"ms.) spentin GC.");
}
System.out.println("___________________________ "+new Date());
System.out.println("");
}
}
Thanks in Advance
Raj Varanasi
23 years ago
Hi Madhu,
I am using WASv3.5 and IBM Http Server on Solaris.I am getting the same error message in trace.log.ibmhttp.* .If anybody have clue about this please reply back.
Thanks in advance,
Raj Varanasi
23 years ago