Pappu Kumar

Ranch Hand
+ Follow
since Oct 01, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pappu Kumar


Quick question. I am running Jboss. I got the thread dump using "/jstack pid" command but the dump file don't show any application classes that are being invoked.
The file contains Threads like i showed in my first post.

How do i get a stack trace that shows my application classes as well ?


I downloaded TDA to analyze my thread dumps and this is what it said :

Overall Thread Count 322
Overall Monitor Count 209
Number of threads waiting for a monitor 0
Number of threads locking a monitor 184
Number of threads sleeping on a monitor 216
Number of deadlocks 0
Number of Monitors without locking threads 0

67% of all threads are sleeping on a monitor.
This might indicate they are waiting for some external resource (e.g. database) which is overloaded or not available or are just waiting to get to do something (idle threads). You should check the sleeping threads with a filter excluding all idle threads.

"Number of threads sleeping on a monitor 216" - Doesn't this mean that they are waiting for a notify ?

I am going to try and get the stack trace and see what i can find.


Thanks for the prompt response. Another problem is that i don't know what needs to happen for the notify to take place.
Clearly the thread is busy doing something.

Can you recommend something in order to get much more detailed info ? For ex : I would like to what business methods in my app are waiting and which ones are slow to notify.

Hope i make sense.
"http-localhost-8080-70" daemon prio=10 tid=0x00002aaba8a28800 nid=0x611d in Object.wait() [0x0000000046275000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aab1e6a9708> (a$Worker)
at java.lang.Object.wait(
- locked <0x00002aab1e6a9708> (a$Worker)

I am investigating slow performance of my app. 65% of the threads are in this state (WAITING).
I cant understand what the locked and waiting lines mean. Please explain.


I have the following definition in my XSD :

<xs:element name="EMPLOYER">
<xs:attribute name="Name" type="xs:string"/>
<xs:attribute name="Address" type="xs:string"/>
<xs:attribute name="City" type="xs:string"/>
<xs:attribute name="State" type="xs:string"/>

My XSD designer software doesnt allow me to do this :

<xs:complexType name="CURRENT_EMPLOYER">
<xs:extension base="EMPLOYER">
<xs:element name="StartDate" type="xs:string" />

It gives me the following error : 'EMPLOYER' must refer to an existing simple or complex type.

Is there any way to extend "EMPLOYER" without having to change it to a complex type.


I am new to web services. I need some help on how to proceed with a simple web service search that receives an Object and returns a List.

I have already implemented the search method in Java. Now i need to create a web service for that search method.

I would like to know the steps involved in this implentation. Most examples i saw on the internet involve "HelloWorld" but i would i like to receive and return complex java objects.

I have the following setup :

Eclipse (WTP) .

I have an interface : IUserService. I want to expose - getAllAddresses as a web service.

public interface IUserService {

public List getAllAddresses(User usr);

Here is my User class and Address class :

public class User {
private String username;
public String getUsername(){
return username;
public void setUsername(String usernm){
username = usernm;

public class Address {
private String id = null;
private String street = null;

public Address (String id, String street)
{ = id;
this.street = street;

public String getId ()
public String getStreet ()
return this.street;

15 years ago
I have a file ("test.dat"). How do i remove the first 26 characters of the First and the Last line of this file. PLease suggest.
17 years ago
I have two questions :

1.) How many nodes can we have under one admin Server ?

2.) If i have an application deployed on two nodes (node1 and node2). I create a cache on node1...will it automatically be replicated onto node2 ? Is there any way to implement this functionality or i have to manually create copies on both nodes ?

Please suggest
17 years ago
I am sorry i didnt publish the complete code.
But i do have this -

for(Iterator iter = children.iterator(); iter.hasNext() {
TreeNode tnodeChild = (TreeNode);

18 years ago
I have a TreeNode....which may or may not have children. These children may or may not have children (The children are of type TreeNode too) too. I have to loop thru this TreeNode on an JSP page and display some text based on the properties of the TreeNode that i visit.

There is something wrong with my current loop as it drills down to the deepest TreeNode and forgets the rest. For Example :

TreeNode A has two Children - TreeNode AA and TreeNode AB.
TreeNode AA has two Children AAA and AAAA.
TreeNode AB doesnt have any children.

My current loop visits TreeNode A and TreeNode AA and both its children.
But somehow skips TreeNode AB.

Can you please tell me whats wrong with this peice of code.

public void createNodes(TreeNode tnode,JspWriter out){
Collection children = tnode.getChildren().values();
if(children.size() == 0)
out.println("Info abt this treenode");
out.println("Info abt this treenode");
for(Iterator iter = children.iterator(); iter.hasNext() {

Can some please suggest whats wrong here....

18 years ago
another thing if i do a "select @@spid" query inside METHODA and METHODB , they return deifferent spid's. I believe that somehow the app server is not handling the TX DATASOURCE well enough...the spid's have to be the same for one transaction.
UserTx part is OK , when check for the TX status inside Method shows as TX ACTIVE status.
I am using Weblogic 6.1 sp3 and Sybase 12.5 DB.

I have a peice of code....something like this -

Look up userTx;
update table A;
catch(exception e){

Look up userTx;
realize its under a TX context so doesnt call begin;
Read Table A and Update Table B;
Not my TX so dont commit;
}catch(Exception ex){
Not my TX so mark for rollback;
throw ex;

Both Table A and Table B are in the same database.

Now when Method B throws an exception....the DB changes are not getting rolled back.

Can someone tell me , what could possibly be going wrong here ?
I am not using a XADataSource for my TX DataSource , i use the regular connection pool (com.sybase.jdbc2.jdbc.SybDriver is the JDBC driver).
But in the DataSource config i set EnableTwoPhaseCommit=true.

I am i have to use javax.transaction.xa package....i am not using it in my code so far.

Please suggest
I have a servlet that i use to write a excel file and then send it back to user. So the user can save it
or open it in excel. The problem is how do i give a name to this excel file. Because right now, if the
user chooses to open the excel file (rather than saving it). It takes the name of the file same as the name of the servlet
that was used to create the file...ex : http://localhost:7001/app/

Here is the snippet of the servlet . I use POI to create excel file

HSSFWorkbook workBook = CreateExcel.writeMSExcel(list.toArray(), lst); // CreateExcel is my helper class
// Write the output
OutputStream out = response.getOutputStream();

Please help....
19 years ago