Re: No of sessions,current thread count and thread busy Logs in tomcat

2010-11-25 Thread André Warnier

rujin raj wrote:

I am Monitoring the tomcat application ,no. of session ,Current thread count
and current thread busy using lambda probe.
Is there any way to save these these datas in local machine for future
reference for specfic interval.

I am sure that you will get more pure-Java tips today for that purpose, but in the 
meantime you could have a look at these :


1) via perl script :

http://cpan.uwinnipeg.ca/htdocs/jmx4perl/JMX/Jmx4Perl.html

(has nice and simple examples and docs)

2) via shell script :

http://code.google.com/p/jmxsh/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: No of sessions,current thread count and thread busy Logs in tomcat

2010-11-25 Thread Mark Thomas
On 25/11/2010 06:16, rujin raj wrote:
 I am Monitoring the tomcat application ,no. of session ,Current thread count
 and current thread busy using lambda probe.
 Is there any way to save these these datas in local machine for future
 reference for specfic interval.

Not in Tomcat nor, to the best of my knowledge, in Lambda probe.

You'd need to write some custom code. You can get the data directly via
JMX or using HTTP and the JMX proxy (part of the Manager app). Whichever
you use, be sure to secure it.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread Pid
On 24/11/2010 22:11, declan harrison wrote:
 How are you writing to the output of the response?
 
 Im wrapping the response ServletOutputStream in a BufferedOutputStream;
 Something like this bufOutStream = new
 BufferedOutputStream(response.getOutputStream(),20480);

... and how are you writing to the BufferedOutputStream?


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread declan harrison
On Thu, Nov 25, 2010 at 9:45 AM, Pid p...@pidster.com wrote:
 On 24/11/2010 22:11, declan harrison wrote:
 How are you writing to the output of the response?
 
 Im wrapping the response ServletOutputStream in a BufferedOutputStream;
 Something like this bufOutStream = new
 BufferedOutputStream(response.getOutputStream(),20480);

 ... and how are you writing to the BufferedOutputStream?


So I end up calling this method for most of the writes that are
performed for binary IO.
@Override
public synchronized void write(byte[] b, int off, int len)
throws IOException {

long bTime = System.currentTimeMillis();
super.write(b, off, len);
long aTime = System.currentTimeMillis();
timeDelta += aTime-bTime;
++numWrites;

updateSNMPValue(bWrote);
}

Im not clear when I call response.addHeader and response.sendError,
what or if the BufferedOutput stream IO is called by Tomcat  Coyote.

When I debug the Web App I see that BufferedOutputStream underlying
OutputStream (protected) is in fact a CoyoteOutputStream (I can access
this object) and it contains a protected object called
org.apache.catalina.connector.OutputBuffer.  I would dearly like to
get at this objects data but I cannot as its protected, this contains
the headers and details about the stream and its state.

Is there a way to dump out this object OutputBuffer details.  Is there
any debug logs I can enable here?

Thanks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread declan harrison
On Wed, Nov 24, 2010 at 10:39 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: declan harrison [mailto:harrison.dec...@gmail.com]
 Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but 
 sometimes sends it back Un-Chunked

 I meant I have local variable that reference the response
 output stream.

 Ok, you're off the hook on that one.  Anything stored in the session that 
 might allow intermingling of requests or responses?

Chuck

I have reviewed the code this morning and I canny see anything that
would allow the intermingling of the request or response between
separate HTTP requests but it does look like it to me that state is
leaking between these two request on this same thread.

Is there a way of obliterating a thread on Tomcat, this way I could
verify that this indeed is the issue.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread Pid
On 25/11/2010 10:22, declan harrison wrote:
 ... and how are you writing to the BufferedOutputStream?
 
 So I end up calling this method for most of the writes that are
 performed for binary IO.
 @Override
 public synchronized void write(byte[] b, int off, int len)
 throws IOException {
 
 long bTime = System.currentTimeMillis();
 super.write(b, off, len);
 long aTime = System.currentTimeMillis();
 timeDelta += aTime-bTime;
 ++numWrites;
 
 updateSNMPValue(bWrote);
 }
 

Sorry, how does this answer my question?


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: [ANN] New Tomcat committer: Christopher Schultz (schultz)

2010-11-25 Thread Rainer Jung

On 22.11.2010 20:16, Mark Thomas wrote:

On behalf of the Tomcat committers I am pleased to announce that
Christopher Schultz (schultz) has been voted in as a new Tomcat committer.

Please join me in welcoming him.


Congrats! Keep up the good work.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread declan harrison
On Thu, Nov 25, 2010 at 10:37 AM, Pid p...@pidster.com wrote:
 On 25/11/2010 10:22, declan harrison wrote:
 ... and how are you writing to the BufferedOutputStream?
 
 So I end up calling this method for most of the writes that are
 performed for binary IO.
     @Override
     public synchronized void write(byte[] b, int off, int len)
     throws IOException {

         long bTime = System.currentTimeMillis();
         super.write(b, off, len);
         long aTime = System.currentTimeMillis();
         timeDelta += aTime-bTime;
         ++numWrites;

         updateSNMPValue(bWrote);
     }


 Sorry, how does this answer my question?


I must have misunderstood your question. What do you mean exactly by
the question and how are you writing to the BufferedOutputStream?

I call the write method above when writing out the binary data in the
response body. Is this the information you require or am I missing
something?  Apoligises if Im being silly on this.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread Pid
On 25/11/2010 11:14, declan harrison wrote:
 On Thu, Nov 25, 2010 at 10:37 AM, Pid p...@pidster.com wrote:
 On 25/11/2010 10:22, declan harrison wrote:
 ... and how are you writing to the BufferedOutputStream?

 So I end up calling this method for most of the writes that are
 performed for binary IO.
 @Override
 public synchronized void write(byte[] b, int off, int len)
 throws IOException {

 long bTime = System.currentTimeMillis();
 super.write(b, off, len);
 long aTime = System.currentTimeMillis();
 timeDelta += aTime-bTime;
 ++numWrites;

 updateSNMPValue(bWrote);
 }


 Sorry, how does this answer my question?


 I must have misunderstood your question. What do you mean exactly by
 the question and how are you writing to the BufferedOutputStream?
 
 I call the write method above when writing out the binary data in the
 response body. Is this the information you require or am I missing
 something?  Apoligises if Im being silly on this.

So far you've shown me that you wrap the output stream, and how the
write method works.

You haven't actually posted the part of the code where you write your
bit of the data to the wrapped output stream.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Replace one class of a running webapp

2010-11-25 Thread caro23

Hello all,

I've deployed a JSF-Project to a Tomcat Server. The problem is that I need
to make a small code change affecting only one class.

There are currenty many users logged into the system, therefore, I don't
want to deploy the whole webapplication.
The question is, can I just replace this class in a running webapp given
that I'm using the same Tomcat version for a local deployment?

Thanks in advance!

-- 
View this message in context: 
http://old.nabble.com/Replace-one-class-of-a-running-webapp-tp30304869p30304869.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Replace one class of a running webapp

2010-11-25 Thread Pid
On 25/11/2010 12:39, caro23 wrote:
 
 Hello all,
 
 I've deployed a JSF-Project to a Tomcat Server. The problem is that I need
 to make a small code change affecting only one class.
 
 There are currenty many users logged into the system, therefore, I don't
 want to deploy the whole webapplication.
 The question is, can I just replace this class in a running webapp given
 that I'm using the same Tomcat version for a local deployment?

You can, but the app will reload.


p



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


RE: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread Caldarale, Charles R
 From: declan harrison [mailto:harrison.dec...@gmail.com] 
 Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but 
 sometimes sends it back Un-Chunked

 it does look like it to me that state is leaking between 
 these two request on this same thread.

That hints of a ThreadLocal being used somewhere in your code (or a 3rd-party 
library).  That's usually not a good idea in a pooled environment.

 Is there a way of obliterating a thread on Tomcat

Not that I'm aware of.  You could temporarily set clearReferencesThreadLocals 
to true in your Context element to see if that takes care of the problem, but 
you probably don't want to do that in production (not really thread-safe).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread declan harrison
On Thu, Nov 25, 2010 at 3:08 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: declan harrison [mailto:harrison.dec...@gmail.com]
 Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but 
 sometimes sends it back Un-Chunked

 it does look like it to me that state is leaking between
 these two request on this same thread.

 That hints of a ThreadLocal being used somewhere in your code (or a 3rd-party 
 library).  That's usually not a good idea in a pooled environment.


Must be in 3rd party code as I dont use any ThreadLocal data explicitly myself.

 Is there a way of obliterating a thread on Tomcat

 Not that I'm aware of.  You could temporarily set clearReferencesThreadLocals 
 to true in your Context element to see if that takes care of the problem, 
 but you probably don't want to do that in production (not really thread-safe).

Yea not sure.  I was wondering it might be worth trying to use the APR
Connector and see if the issue is the present there also or hopefully
not.  you think its worth a shot.


Im also looking at trying to produce a simple servlet where I can
reproduce this problem and send it to the mailing list. I'm hopeful I
can get such a simple servlet

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread declan harrison
On Thu, Nov 25, 2010 at 11:49 AM, Pid p...@pidster.com wrote:
 On 25/11/2010 11:14, declan harrison wrote:
 On Thu, Nov 25, 2010 at 10:37 AM, Pid p...@pidster.com wrote:
 On 25/11/2010 10:22, declan harrison wrote:
 ... and how are you writing to the BufferedOutputStream?

 So I end up calling this method for most of the writes that are
 performed for binary IO.
     @Override
     public synchronized void write(byte[] b, int off, int len)
     throws IOException {

         long bTime = System.currentTimeMillis();
         super.write(b, off, len);
         long aTime = System.currentTimeMillis();
         timeDelta += aTime-bTime;
         ++numWrites;

         updateSNMPValue(bWrote);
     }


 Sorry, how does this answer my question?


 I must have misunderstood your question. What do you mean exactly by
 the question and how are you writing to the BufferedOutputStream?

 I call the write method above when writing out the binary data in the
 response body. Is this the information you require or am I missing
 something?  Apoligises if Im being silly on this.

 So far you've shown me that you wrap the output stream, and how the
 write method works.

 You haven't actually posted the part of the code where you write your
 bit of the data to the wrapped output stream.


 p

I just call wrapper.write(buf, 0, bug.lenght).  Are you looking more
source code here?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-25 Thread Pid
On 25/11/2010 17:49, declan harrison wrote:
  So far you've shown me that you wrap the output stream, and how the
  write method works.
 
  You haven't actually posted the part of the code where you write your
  bit of the data to the wrapped output stream.
 
 
  p
 I just call wrapper.write(buf, 0, bug.lenght).  Are you looking more
 source code here?

You are reporting a problem with the response.

You are writing to the output stream, and maybe setting headers on the
response object.

If you can post each bit of code that interacts with the response object
we can stop guessing what's wrong and start trying to resolve it.


p





0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: org.apache.jasper.util.Entry object Heap Size

2010-11-25 Thread Rainer Jung

On 24.11.2010 21:01, Konstantin Kolinko wrote:

2010/11/24 Christopher Schultzch...@christopherschultz.net:

On 11/24/2010 6:31 AM, amitruwali wrote:

Please find below information:

Tomcat version: 7.0.2
JDK : Java 1.6
[Class is org.apache.jasper.util.Entry]
Class exists in the jar : jasper.jar
Path: /lib/jasper.jar

$ wget
'http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.2-beta/bin/apache-tomcat-7.0.2.tar.gz'
$ tar xzf apache-tomcat-7.0.2.tar.gz
$ $ unzip -v apache-tomcat-7.0.2/lib/jasper.jar |grep /Entry
1501  Defl:N  592  61%  08-04-10 00:24  8d5f2d6a
org/apache/jasper/util/Entry.class

Yup, there it is.

I'm trying to track down what happened to it. My svn-fu is not very good.



http://svn.apache.org/viewvc?view=revisionrevision=1028396


The whole JSP unloading functionality was refactored. As Konstantin 
remarked, Entry is now an inner class. I do hope there's no leak and the 
observed leak was due to a race condition I noticed in the original 
code. It would be very helpful, if you could check using 7.0.5.


Note that in 7.0.5 as an add-on there is also

- an option to unload JSPs by idle time

- a way to track the JSP queue behaviour via JMX

Is your Tomcat running under high load? Anything special to the 
JSPServlet configuration in conf/web.xml?


Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 6 / Mysql / connection Pool isValid Method Error

2010-11-25 Thread EmCpam

Hi,

I've a problem to use the 'isValid' method of Connection class with a
connection pool.
The java exception is:

javax.servlet.ServletException:
com.sun.jersey.api.container.ContainerException:
java.lang.AbstractMethodError:
org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.isValid(I)Z
   
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:346)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   
org.cnamts.securite.filtres.FiltreSecurite.doFilter(FiltreSecurite.java:133)
   
org.cnamts.securite.filtres.FiltreCommun.doFilter(FiltreCommun.java:128)


I'm using tomcat 6.0.29 with java jdk 1.6 and netbeans 6.9. My jdbc
connector jar is mysql-connector-java-5.1.13-bin.jar, placed in tomcat lib
path.

The declaration of my ressource in web.xml is:
resource-ref
descriptionDB Connection/description
res-ref-namejdbc/connData/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
in my context.xml file:
Context path=/QualifluxWeb antiJARLocking=true
Resource name=jdbc/connData auth=Container 
type=javax.sql.DataSource
   maxActive=10 maxIdle=3 maxWait=1
   username=root password=
driverClassName=com.mysql.jdbc.Driver
   url=jdbc:mysql://localhost:3306/test
   validationQuery=select 1 /
/Context

Others methods for conect, retrieve or update data works well. I've only a
problem with isValid.
What is wrong ? Or is there any other solution for checking my connection ?

Thanks a lot for your help.

Emmanuel
-- 
View this message in context: 
http://old.nabble.com/Tomcat-6---Mysql---connection-Pool-isValid-Method-Error-tp30308901p30308901.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org