Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Ashok Reddy

Greenhorn
+ Follow
since Feb 27, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ashok Reddy

Hi,

I am unable to setup environement, here are the steps I did...

1. installed Web Sphere portal 6.1 trial version.(Downloaded trial version from IBM web site)
2. Installed RAD 7.0.(trial Version)
3. Created simple portlet application (followed the steps given in the attached pdf.)
4. Configured new server as said in page 14 in the pdf.
5. when i start the server as said, it is in Starting Server state for long period and not started.
6. Not able to get the Output. do i have to configure anything?


So I could not able to start it through RAD, So I started server from Programs(Start->Programs->IBM WebSphere->Portal Express6.1->Start the server).This time I could able to start the server but
(a) unable to login to the Admin Console- It is showing some certification error(Find the attached image-WebSphereError) and
(b) also I don't know how to access the Sample Portal Application that I have written(mentioned in the step 3 above) -please give steps to access my portal App.

It is urgent ..Please help me out..thanks in advance...


thank you.

Ashok

[ November 24, 2008: Message edited by: ashok kumar reddy R ]
[ November 24, 2008: Message edited by: Ashok Reddy ]
11 years ago
Hi Ulf Dittmer ,Nitesh

I am thinking that as long as I run any number of applications in the same machine then they all be under control of same JVM.can you give more info on Java Management Extension (JMX).
Hi shariff,

Thanks much for the response.

I have created two java files of which one is threads generating program (some user threads) and other program has the code that you have sent(call as threads monitoring program).I ran them at the same time in two individual command prompts.but both programs running on the same machine(same JVM) and so the generated threads count should be shown in thread monitoring program, but that is not happening.what could be the reason.I am adding those two programs:

Threads Monitoring Program:

class DeamonThread{

private void getDeamonsStatus(){
ThreadGroup tg = getThreadGroup(Thread.currentThread().getThreadGroup());
// Get the count of active threads in the system
int num = tg.activeCount();
System.out.println("Total threads found ->"+num);
// Get all of the active threads in the system
Thread list[] = new Thread[num];
int x = tg.enumerate(list);
for (int i = 0; i < x; i++)
{
if (list[i] == null) continue;
String threadName = list[i].getName();
String groupName = list[i].getThreadGroup().getName();
System.out.println("GroupName----"+groupName);
System.out.println("ThreadName --- " + threadName);
System.out.println("Priority --- " + list[i].getPriority());
System.out.println("Interrupted --- " + list[i].isInterrupted());
System.out.println("Is Deamon thread --- " + (list[i].isDaemon() ? "Yes" : "No") );
System.out.println("Is thread Alive --- " + (list[i].isAlive() ? "Yes" : "No"));

}

}

// Recursively calls itself to find the top level thread group

private ThreadGroup getThreadGroup (ThreadGroup tg) {
ThreadGroup parent = tg.getParent();
if (parent == null)
return tg;
return getThreadGroup(parent);

}

public static void main(String[] args){

DeamonThread dt=new DeamonThread();
dt.getDeamonsStatus();

}

}



Threads Generation Program as follows:


class ThreadsGeneration{
public static void main(String[] args){
ThreadGroup tg1=new ThreadGroup("ThreadGroup1");
Thread1 g1t1=new Thread1();
Thread t1=new Thread(tg1,g1t1,"Group1Thread1");
t1.setDaemon(true);
t1.start();
Thread1 g1t2=new Thread1();
Thread t2=new Thread(tg1,g1t2,"Group1Thread2");
t2.setDaemon(true);
t2.start();
Thread1 g1t3=new Thread1();
Thread t3=new Thread(tg1,g1t3,"Group1Thread3");
t3.setDaemon(true);
t3.start();


ThreadGroup tg2=new ThreadGroup("ThreadGroup2");
Thread2 g2t1=new Thread2();
Thread t21=new Thread(tg2,g2t1,"Group2Thread1");
t21.setDaemon(true);
t21.start();
Thread2 g2t2=new Thread2();
Thread t22=new Thread(tg2,g2t2,"Group2Thread2");
t22.setDaemon(true);
t22.start();
Thread2 g2t3=new Thread2();
Thread t23=new Thread(tg2,g2t3,"Group2Thread3");
t23.start();


ThreadGroup tg3=new ThreadGroup("ThreadGroup3");
Thread3 g3t1=new Thread3();
Thread t31=new Thread(tg3,g3t1,"Group3Thread1");
t31.start();
Thread3 g3t2=new Thread3();
Thread t32=new Thread(tg3,g3t2,"Group3Thread2");
t32.start();
Thread3 g3t3=new Thread3();
Thread t33=new Thread(tg3,g3t3,"Group3Thread3");
t33.start();
try{
Thread.currentThread().sleep(60000);
}catch(InterruptedException ie){
System.out.println("Some one disturbed me while I was sleeping");
}


}
}

class Thread1 implements Runnable{

public void run(){
for(int i=1;i<=10;i++){
System.out.println("Thread1->"+i);
try{
Thread.sleep(3000);
}catch(InterruptedException ie){
System.out.println("Exception in thread 1");
}
}
}
}

class Thread2 implements Runnable{
public void run(){
for(int i=101;i<=110;i++){
System.out.println("Thread2->"+i);
try{
Thread.sleep(1000);
}catch(InterruptedException ie){
System.out.println("Exception in thread 2");
}
}
}
}

class Thread3 implements Runnable{
public void run(){
for(int i=201;i<=210;i++){
System.out.println("Thread3->"+i);
try{
Thread.sleep(1000);
}catch(InterruptedException ie){
System.out.println("Exception in thread 3");
}
}
}
}



thank you so much.
Hi Nitesh,

Thank you much for the response.

It would be great if it is writing code where external JVM accesses actual application-JVM and getting the deatils of deamon threads and their current state.I think that may not be possible.It is okay even if we write some code in the same JVM where application is running and getting the status of the deamon threads.

Thanks in advance.

AshokReddy
challenge is to knowing currently running Deamon threads and their status like waiting,Stopped etc in the current JRE/JVM wothout touching application.Any one has any idea...please help?
[ January 15, 2008: Message edited by: ashok kumar reddy R ]