Pappu Kumar

Ranch Hand
+ Follow
since Oct 01, 2002
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 Pappu Kumar

Guys,

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 ?

Pappu
Henry,

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.

Pappu
Steve,

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.
Pappu
"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 org.apache.tomcat.util.net.JIoEndpoint$Worker)
at java.lang.Object.wait(Object.java:485)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)
- locked <0x00002aab1e6a9708> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
at java.lang.Thread.run(Thread.java:619)


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.

Pappu
Guys,

I have the following definition in my XSD :

<xs:element name="EMPLOYER">
<xs:complexType>
<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"/>
</xs:complexType>
</xs:element>

My XSD designer software doesnt allow me to do this :

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

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.

Thanks
Guys,

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) .
Struts
Spring
Hibernate
Tomcat

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)
{
this.id = id;
this.street = street;
}

public String getId ()
{
return this.id;
}
public String getStreet ()
{
return this.street;
}
}



13 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.
16 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
16 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) iter.next();
createNodes(tnodeChild,out);

}
16 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");
}
else{
out.println("Info abt this treenode");
for(Iterator iter = children.iterator(); iter.hasNext() {
createNodes(tnodeChild,out);
}
}

Can some please suggest whats wrong here....

regards
Pappu
16 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 B...it 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 -


METHOD A
Look up userTx;
try{
userTx.begin();
getTxDataSource().getConnection();
update table A;
call METGOD B
userTx.commit();
}
catch(exception e){
userTx.rollback();
}



METHOD B
try{
Look up userTx;
realize its under a TX context so doesnt call begin;
getTxDataSource().getConnection();
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 thinking....do 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/CreateExcel.do

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();
workBook.write(out);
out.flush();
out.close();

Please help....
17 years ago