Re: Tomcat Clsuter 6.0.18 White sites

2010-01-20 Thread Mark Thomas
On 20/01/2010 02:45, Alexander Diedler wrote:
 Hi everybody,
 We have some issues with a Tomcat Cluster. Sometimes (after a few hours 
 without restart of services) , the webserver doesn´t deliver the complete 
 content to the browser. It means, in the browser ther appear the header and 
 some parts of the website, but then only blank and white website. In the 
 source code in HTML view it is the same leak. Only after a restart of the 
 services the content will be completely delivered.
 It is a Win 2003 Server with JDK 1.6, the Server jvm.dll is called from 
 Tomcat. It is a 2 node cluster with Apache 2.2.14 and Tomcat 6.0.20 and 
 mod_jk 1.2.28. In front of these cluster there is a Hardware loadbalanacer 
 BigIP from F5.
 Somebody any idea, why the cluster stops delivering of contents after a 
 period of hours?

Could be all sorts of things. What error messages do you see in the
Tomcat and mod_jk logs?

Your mod_jk and AJP connector configuration may shed some light.

Mark

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



Re: Tomcat Realm

2010-01-20 Thread Mark Thomas
On 20/01/2010 01:38, Aihong Yin wrote:
 Hi,
 
 I'm using tomcat5.5. my question is: is it possible to implement a realm
 to identify valid users of a web application: the username and password
 get from LDAP directory server central, and the role of the user get
 from local file such as tomcat-user.xml instead.

Yes, it is possible to implement a custom Realm to do this. Custom
Realms can do pretty much anything you want. Tomcat does not support
this out of the box.

Mark

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



TOMCAT GC Issue

2010-01-20 Thread Paulwintech

Hello,

   I am new to the Tomcat Administration, I have some 4 production servers
running Tomcat6.x with Jdk - To monitor all my applications like
Apache,Tomcat and Mysql we are using OPmanager-Application manager tool.

   Intermediately i get GC critical alert. That means some times GC
collection goes high and remains for more than 10 mins. Then it clears the
Grabage. But this is happening recently checked all possible logs found
nothing. This is not happening every time, Say like twice in a day...

  Please help me on this issue.

Regards
Paulwintech
-- 
View this message in context: 
http://old.nabble.com/TOMCAT-GC-Issue-tp27239776p27239776.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: TOMCAT GC Issue

2010-01-20 Thread Peter Crowther
2010/1/20 Paulwintech paulwint...@gmail.com


 Hello,

   I am new to the Tomcat Administration, I have some 4 production servers
 running Tomcat6.x with Jdk - To monitor all my applications like
 Apache,Tomcat and Mysql we are using OPmanager-Application manager tool.

   Intermediately i get GC critical alert. That means some times GC
 collection goes high and remains for more than 10 mins. Then it clears the
 Grabage. But this is happening recently checked all possible logs found
 nothing. This is not happening every time, Say like twice in a day...

 Could you give us a bit more information?
+ JDK version?
+ What memory and GC settings are set?
+ Does the alert coincide with high usage on the servers?
+ Does it happen on all servers equally?  If not, what factors differ
between the servers?
+ *Exactly* what condition causes the monitor to report the alert?  Feel
free to point us at the web page describing the alert's definition in the
monitor.

Sorry to ask for that lot, but different Java versions can handle GC very
differently, and the options make a difference too.

- Peter


Re: Modifying value or format of HTTPServletRequest.getRemoteUser()

2010-01-20 Thread Pid

On 20/01/2010 01:33, Christopher Nebergall wrote:

I have a Jaas plugin where I'm using basic auth.   It authenticates the user
successfully, and in the jaas plugin I make it so
request.getUserPrincipal().getName() it returns the format of the username I
want shown to the app.  But HttpServletRequest.getRemoteUser always returns
the value of the username in the HTTP AUTHORIZATION header.  How do I modify
what getRemoteUser returns to always match the
request.getUserPrincipal().getName()?

Thanks,
Christopher



Use a servlet Filter and wrap the request in an 
HttpServletRequestWrapper.  Override the appropriate method.



p


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



War file encryption

2010-01-20 Thread Kranti™ K K Parisa
Hi,

Is there any way that we could encrypt the war file that is getting deployed
into tomcat?

or can we make war files or jar files as native code files like dll files or
so.

the objective is to safe guard the code inside the war file (javascript,
jsp, .class files)..etc


Best Regards,
Kranti K K Parisa


RE: multiple URI

2010-01-20 Thread Vadym Chepkov
Unfortunately, I have to install such application in ROOT context for this to 
work and I am trying to avoid it.

Sincerely yours,
  Vadym Chepkov


--- On Wed, 1/20/10, Travis Beech travis.be...@gmail.com wrote:

 From: Travis Beech travis.be...@gmail.com
 Subject: RE: multiple URI
 To: 'Tomcat Users List' users@tomcat.apache.org
 Date: Wednesday, January 20, 2010, 2:48 AM
 Modify your servlet mapping in your
 web.xml so that you have more than one
 mapping to that servlet.
 
 Take the following xml snippet as an example, each of the
 three servlet
 mappings will map to a single servlet. This would allow
 someone to use three
 different URL's to access the same servlet.
 
 servlet
  
 servlet-nameRequestFactory/servlet-name
  
 servlet-classcom.foo.web.servlet.RequestFactory/servlet-class
 /servlet
 servlet-mapping
  
 servlet-nameRequestFactory/servlet-name
  
 url-pattern/RequestFactory/url-pattern
 /servlet-mapping
 servlet-mapping
  
 servlet-nameRequestFactory/servlet-name
   url-pattern/Request/url-pattern
 /servlet-mapping
 servlet-mapping
  
 servlet-nameRequestFactory/servlet-name
   url-pattern/SomeOtherUrl
 /url-pattern
 /servlet-mapping
 
 -Original Message-
 From: Vadym Chepkov [mailto:chep...@yahoo.com]
 
 Sent: Tuesday, January 19, 2010 12:17 PM
 To: users@tomcat.apache.org
 Subject: multiple URI
 
 Greetings,
 
 I want a servlet to serve two different urls: http://server/A
 and
 http://server/B, but I don't want to install this
 servlet as a ROOT servlet.
 Is this possible in tomcat 6?
 
 Thank you.
 Sincerely yours,
   Vadym Chepkov
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: War file encryption

2010-01-20 Thread Peter Crowther
If you control the servers on which the code is being deployed, you should
probably be taking other steps than encryption.

If you *don't* control the servers, you cannot stop someone decrypting your
code - sooner or later, it will have to be decrypted for Tomcat to use it.
Therefore you will have to give those servers the key to decrypt the code.

Javascript that will be sent to a browser is always available in the
clear, as the browser must be able to use it.  You should assume that if a
stream of bytes ever gets served out of a web server, it's gone out of the
server's control and could be copied.

However, you can still sort-of protect your code.  At least one company has
posted here that they have a Java compiler that compiles Tomcat + webapps +
JVM to one big native code executable.  You *could* buy a license to that
technology and use it.  I assume it's not cheap.

- Peter

2010/1/20 Kranti™ K K Parisa kranti.par...@gmail.com

 Hi,

 Is there any way that we could encrypt the war file that is getting
 deployed
 into tomcat?

 or can we make war files or jar files as native code files like dll files
 or
 so.

 the objective is to safe guard the code inside the war file (javascript,
 jsp, .class files)..etc


 Best Regards,
 Kranti K K Parisa



Re: War file encryption

2010-01-20 Thread Kranti™ K K Parisa
Hi Peter,

Thanks for the reply and could you please give me the url of that software,
if possible. I shall take a look at that.

Best Regards,
Kranti K K Parisa



On Wed, Jan 20, 2010 at 7:03 PM, Peter Crowther peter.crowt...@melandra.com
 wrote:

 If you control the servers on which the code is being deployed, you should
 probably be taking other steps than encryption.

 If you *don't* control the servers, you cannot stop someone decrypting your
 code - sooner or later, it will have to be decrypted for Tomcat to use it.
 Therefore you will have to give those servers the key to decrypt the code.

 Javascript that will be sent to a browser is always available in the
 clear, as the browser must be able to use it.  You should assume that if a
 stream of bytes ever gets served out of a web server, it's gone out of the
 server's control and could be copied.

 However, you can still sort-of protect your code.  At least one company has
 posted here that they have a Java compiler that compiles Tomcat + webapps +
 JVM to one big native code executable.  You *could* buy a license to that
 technology and use it.  I assume it's not cheap.

 - Peter

 2010/1/20 Kranti™ K K Parisa kranti.par...@gmail.com

  Hi,
 
  Is there any way that we could encrypt the war file that is getting
  deployed
  into tomcat?
 
  or can we make war files or jar files as native code files like dll files
  or
  so.
 
  the objective is to safe guard the code inside the war file (javascript,
  jsp, .class files)..etc
 
 
  Best Regards,
  Kranti K K Parisa
 



Re: War file encryption

2010-01-20 Thread Mikolaj Rydzewski

Kranti™ K K Parisa wrote:

Is there any way that we could encrypt the war file that is getting deployed
into tomcat?
  

My $0.02:

   * you can obfuscate class files
   * you can precompile JSPs (and again, obfuscate them)
   * you can sign jar files

It will make any unauthorized webapp modifications more complex and 
difficult.
Of course, as Peter said, if you do not control your server you can not 
have 100% guarantee that nothing will get decrypted.



--
Mikolaj Rydzewski m...@ceti.pl


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



mod_jk codepage in header values

2010-01-20 Thread Mirko Solic
Hello,

for connecting tomcat with apache i'm using mod_jk connector. But i'm
having problem with header values. On apache side headers values are in
UTF-8 cp but on tomcat side i have to make conversion from latin-1 cp.
I'm using this code:

for(Enumeration en = request.getHeaderNames(); en.hasMoreElements();){
header = new Header();
headerName = (String) en.nextElement();
header.setHeaderName(headerName);
header.setHeaderValue(new
String(request.getHeader(headerName).getBytes(ISO-8859-1)));
headers.add(header);

header = new Header();
header.setHeaderName(headerName);
header.setHeaderValue(request.getHeader(headerName));
headers.add(header);
}


Is it possible to configure mod_jk somehow so that this conversion would
be no longer needed? I went through configuration documentation but i
didn't find nothing that could solve my problem.

Any help will be much appreciated. 


SW versions:
Tomcat 6.0.18
Apache 2.2.3
mod_jk 1.2.28

OS:Linux Centos 5.3

lp mirko 




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



RE: multiple URI

2010-01-20 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: multiple URI
 
 - then in the web.xml of the existing ROOT application, add the
 configuration for the UrlRewriteFilter.

No.  The webapp would be deployed as A or B (implementor choice), and a dummy 
webapp consisting only of the rewrite filter deployed as the other one to 
forward or redirect to the real webapp.  Don't mess with the ROOT application.

 - now comes the tricky bit of which I am not sure : how do you set up
 your webapp/servlet, so that it will process these /xyz/* URLs, as
 re-directed by the filter, and without itself receiving the requests
 for /xyz directly ?

Do what I suggested above, and you don't have that problem.

 I believe for that you have to set it up somewhere else than under
 /tomcat/webapps, and then tell Tomcat, separately, where to find it.

No; things will work fine under the appBase directory.

 - 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



Timeout

2010-01-20 Thread Mohit Anchlia
Tomcat 6:

Are there any other kind of timeout values other than
ConnectionTimeout? Does Connection Timeout come into affect when there
is an ESTABLISHED socket connection from the client?

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



RE: TOMCAT GC Issue

2010-01-20 Thread Robin Wilson
I agree with Peter, we need more information.

I will point out that we had a similar issue - during peak activity on our 
site, and it related to sessions being created faster than Tomcat could get rid 
of them (even though they were expired already). We used the /manager/html 
app that comes with Tomcat (you have to leave the '/manager' webapp installed) 
to view the number of sessions - and noticed that they were growing 
exponentially during our peak loads.

Also, if you are clustered, remember that your sessions are being replicated 
across all 4 Tomcats - so 1/4 of the load on each server will fill up the heap 
space as fast as 4X load on 1 server would...

Check your heap size (-Xmx=? in your 'catalina.sh' or 'catalina.bat' file)... 
As Peter mentioned, that will be necessary to figure out what the problem is.

--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
CELL: 512-426-3929
DESK: 512-623-5913
www.KingsIsle.com


-Original Message-
From: peter.crowth...@googlemail.com [mailto:peter.crowth...@googlemail.com] On 
Behalf Of Peter Crowther
Sent: Wednesday, January 20, 2010 4:58 AM
To: Tomcat Users List
Subject: Re: TOMCAT GC Issue

2010/1/20 Paulwintech paulwint...@gmail.com


 Hello,

   I am new to the Tomcat Administration, I have some 4 production servers
 running Tomcat6.x with Jdk - To monitor all my applications like
 Apache,Tomcat and Mysql we are using OPmanager-Application manager tool.

   Intermediately i get GC critical alert. That means some times GC
 collection goes high and remains for more than 10 mins. Then it clears the
 Grabage. But this is happening recently checked all possible logs found
 nothing. This is not happening every time, Say like twice in a day...

 Could you give us a bit more information?
+ JDK version?
+ What memory and GC settings are set?
+ Does the alert coincide with high usage on the servers?
+ Does it happen on all servers equally?  If not, what factors differ
between the servers?
+ *Exactly* what condition causes the monitor to report the alert?  Feel
free to point us at the web page describing the alert's definition in the
monitor.

Sorry to ask for that lot, but different Java versions can handle GC very
differently, and the options make a difference too.

- Peter

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



Windows Thread dump issue

2010-01-20 Thread Jeffrey Janner
Is there a version where the Tomcat Monitor (Tomcat5w.exe) thread dump
option doesn't work and one where it's been fixed?

I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit and
Tomcat 5.5.27.

When I right-click on the Tomcat monitor in the system tray and select
Thread Dump, nothing appears to happen.  I cannot find any new file,
and the jakarta-service-xxx.log file is still at zero.

I checked the file version of the procrun wrapper and it shows 2.0.4.
The version that comes with the Tomcat 5.5.28 install is 2.0.5.

Do I need to just replace the wrapper with the latest version, or is
there something else I need to set.

 

Note: the Tomcat install is straight from the installer with only
modifications to the server.xml file and my webapp installed.  No other
tomcat config files have been modified.

 

=
Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
mailto:jeffrey.jan...@polydyne.com 
PolyDyne Software Inc.  web: http://www.polydyne.com/
http://www.polydyne.com/ 
9390 Research Blvd.   phone: (512) 343-9100 x8930
Building 1, Suite 400   fax: (512) 343-9297
Austin, TX 78759
=

 


***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


Re: Windows Thread dump issue

2010-01-20 Thread Konstantin Kolinko
2010/1/20 Jeffrey Janner jeffrey.jan...@polydyne.com:
 Is there a version where the Tomcat Monitor (Tomcat5w.exe) thread dump
 option doesn't work and one where it's been fixed?

 I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit and
 Tomcat 5.5.27.

 When I right-click on the Tomcat monitor in the system tray and select
 Thread Dump, nothing appears to happen.  I cannot find any new file,
 and the jakarta-service-xxx.log file is still at zero.


Look in stdout_.log.  I don't have 5.5 installed at the moment,
but in 6.0 it is there.

Best regards,
Konstantin Kolinko

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



Re: multiple URI

2010-01-20 Thread Vadym Chepkov
Unfortunately,  this would change the request and breaks application 
functionality, it's a proxy already (IBM WBIMB Proxy Servlet - Message Broker)

Sincerely yours,
  Vadym Chepkov


--- On Wed, 1/20/10, André Warnier a...@ice-sa.com wrote:

 From: André Warnier a...@ice-sa.com
 Subject: Re: multiple URI
 To: Tomcat Users List users@tomcat.apache.org
 Date: Wednesday, January 20, 2010, 9:37 AM
 Vadym Chepkov wrote:
  Unfortunately, I have to install such application in
 ROOT context for this to work and I am trying to avoid it.
  
 I think Chuck pointed you to one way of achieving this,
 using the UrlRewriteFilter module (www.tuckey.org). 
 That is a third-party Tomcat add-on module (free) which
 functions as a servlet filter (meaning it works on any
 servlet engine, not only Tomcat), and fills a role similar
 to the Apache httpd mod_rewrite module.
 
 Basically, the filter catches a request early (before the
 servlets see it), examines it, and according to configurable
 parameters, rewrites the URL and forwards it to another
 webapp (or not).
 
 Unfortunately, I don't know enough myself to show you
 exactly how to set this up, but my guess would be something
 like :
 
 - suppose for now that you set up your webapp (the one you
 wish to use to handle requests to /A or /B), under
 tomcat/webapps/xyz
 
 - then in the web.xml of the existing ROOT application, add
 the configuration for the UrlRewriteFilter.
 You want it to check the URL for requests to either /A/* or
 /B/*, and if it matches, then rewrite the URL to /xyz/A/* or
 /xyz/B/* (for instance) and re-direct this request to your
 webapp.
 If it does not match, then you do nothing (and let the
 request filter down to the normal ROOT app).
 
 - now comes the tricky bit of which I am not sure : how do
 you set up your webapp/servlet, so that it will process
 these /xyz/* URLs, as re-directed by the filter, and without
 itself receiving the requests for /xyz directly ?
 I believe for that you have to set it up somewhere else
 than under /tomcat/webapps, and then tell Tomcat,
 separately, where to find it.
 But that's where my knowledge ends and someone else should
 take over.
 Of course you have to set up your webapp to handle the URLs
 /xyz/A* and /xyz/B*. But the previous post showed you how to
 do that.
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



RE: Windows Thread dump issue

2010-01-20 Thread Caldarale, Charles R
 From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
 Subject: Re: Windows Thread dump issue
 
 Look in stdout_.log.  I don't have 5.5 installed at the moment,
 but in 6.0 it is there.

Not for me - it's in jakarta_service_MMdd.log, in both 5.5 and 6.0.

 - 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: Windows Thread dump issue

2010-01-20 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: Windows Thread dump issue
 
 I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit and
 Tomcat 5.5.27.

I just tried it with Vista 64 using JDK 1.6.0_14, running both Tomcat 5.5.27 
and 6.0.20.

 When I right-click on the Tomcat monitor in the system tray and select
 Thread Dump, nothing appears to happen.  I cannot find any new file,
 and the jakarta-service-xxx.log file is still at zero.

The size in Explorer doesn't update unless you refresh the window.  The trace 
is there for me, on both levels.  Open the file in an editor and take a look at 
it.

 - 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



Http 500 and %b in access log

2010-01-20 Thread Mohit Anchlia
Tomcat 6:

I am seeing Exception in localhost java.net.SocketTimeoutException:
Read time out. I looked at the access log and I see tomcat returning
Http 500. Only thing in common is that %b (bytes sent) for all the
timeouts are 2657. For rest of them where requests are successfull
it's less than 2657.

Could someone help me understand what %b is for in localhost access
logs and if what I am seeing makes sense.

Does SocketTimeoutException correspond to ConnectionTimeout in the
connector? We tried increasing it but didn't make any difference.

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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney
Thanks, Chuck.

Caldarale, Charles R chuck.caldar...@unisys.com wrote ..
  From: John Tangney [mailto:jo...@jdtangney.com]
  Is it possible to get two apps in the same Tomcat instance to exchange
  session info, in a cluster? If so, how?

 Not sure what you're asking.

Apologies if I was not clear.

We have two machines, each with a Tomcat, forming a cluster. An app named gh 
runs on each cluster node. We want to add a second app to one of the Tomcats 
(call it gh2 – it's just a clone of gh) that synchronizes sessions with gh on 
all of the nodes.

 Multiple apps in one Tomcat cannot share a session, since that's prohibited by
 the servlet spec.

I think you've answered my question. So gh2 cannot synchronize sessions with gh 
– on the same cluster node or not.

 You can create a bean from a class in a shared library to hold
 data needed by both apps.

Ah, this sounds promising! Where would this shared library live so that both 
apps can talk to it?

Just for background... In an ideal world, we'd just buy another server and add 
it to the (existing) cluster. But we are looking for ways to get the benefit of 
another cluster node without new hardware.

Thanks!
--johnt


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

RE: Windows Thread dump issue

2010-01-20 Thread Jeffrey Janner
Sorry I wasn't clear.  The file is empty.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, January 20, 2010 10:44 AM
To: Tomcat Users List
Subject: RE: Windows Thread dump issue

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: Windows Thread dump issue
 
 I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit
and
 Tomcat 5.5.27.

I just tried it with Vista 64 using JDK 1.6.0_14, running both Tomcat
5.5.27 and 6.0.20.

 When I right-click on the Tomcat monitor in the system tray and select
 Thread Dump, nothing appears to happen.  I cannot find any new file,
 and the jakarta-service-xxx.log file is still at zero.

The size in Explorer doesn't update unless you refresh the window.  The
trace is there for me, on both levels.  Open the file in an editor and
take a look at it.

 - 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



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


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



RE: Windows Thread dump issue

2010-01-20 Thread Jeffrey Janner
Thanks Konstantin.  That is where it was.
Now I have something to document for the ops to run when the app hangs again.

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Wednesday, January 20, 2010 10:20 AM
To: Tomcat Users List
Subject: Re: Windows Thread dump issue

2010/1/20 Jeffrey Janner jeffrey.jan...@polydyne.com:
 Is there a version where the Tomcat Monitor (Tomcat5w.exe) thread dump
 option doesn't work and one where it's been fixed?

 I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit and
 Tomcat 5.5.27.

 When I right-click on the Tomcat monitor in the system tray and select
 Thread Dump, nothing appears to happen.  I cannot find any new file,
 and the jakarta-service-xxx.log file is still at zero.


Look in stdout_.log.  I don't have 5.5 installed at the moment,
but in 6.0 it is there.

Best regards,
Konstantin Kolinko

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



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


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



Re: Windows Thread dump issue

2010-01-20 Thread Konstantin Kolinko
2010/1/20 Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
 Subject: Re: Windows Thread dump issue

 Look in stdout_.log.  I don't have 5.5 installed at the moment,
 but in 6.0 it is there.

 Not for me - it's in jakarta_service_MMdd.log, in both 5.5 and 6.0.

  - Chuck


2010/1/20 Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: Windows Thread dump issue

 I have a Windows 2008 Server 64-bit running Sun JDK 1.6.0_13 64-bit and
 Tomcat 5.5.27.

 I just tried it with Vista 64 using JDK 1.6.0_14, running both Tomcat 5.5.27 
 and 6.0.20.


With 6.0.20 it ends up in jakarta_service_20100120.log, the service
runner version there is 2.0.4.

With 6.0.24 RC it ends up in stdout_20100120.log, the service runner
version there is 2.0.6.

Both on the same PC with JRE 6u17 and WinXP 32-bit.


From a quick look at the procrun sources svn history, I do not see any
specific commit that might have caused this change.  And from last
Jeffrey's reply below it looks like it can end up in either file.

2010/1/20 Jeffrey Janner jeffrey.jan...@polydyne.com:
 Thanks Konstantin.  That is where it was.
 Now I have something to document for the ops to run when the app hangs again.


Best regards,
Konstantin Kolinko

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



Tomcat 5.5 connection reset

2010-01-20 Thread Maximilian Stocker
I have the following basic configuration RHEL 5 with Tomcat 5.5.23. This server 
is in a DMZ in my office and from here I can connect to it via LAN rather than 
the internet.

When I try to download a file (a simple PDF about 1 MB in size) chucked into 
WebContent from the server over the internet it 95% of the time fails due to a 
connection reset event. This happens whether the client I attempt this with is 
a browser or wget. Wget will usually download the file after three or four 
attempts but on one occasion gave up after 20 attempts.

Meanwhile it *never* fails when I download via the LAN.

From this I thought I had a network issue of some sort but after further 
testing I have concluded that the problem is either Tomcat or Java on this 
system.

Not to get overly tedious but I have tried different files (no difference). I 
have looked at where the reset happens (no difference). I looked at and tried 
slightly different config settings (as expected no difference) However when I 
dropped the same file into Apache httpd server on the same server it does work, 
100% on both via LAN and internet.

So at this point if httpd works but tomcat doesn't then I have to think that 
either tomcat or the vm are the cause of the problem. I have searched the bug 
database and google to no real effect, unfortunately connection resets are too 
common a term I think and I am now a bit stuck.

If more information is required I can provide it but are there are any known 
issues that can cause resets to be sent from Tomcat (I assume from prematurely 
closed sockets)?

In the hope that it helps, below is some xx-ed output from running wget on a 
remote box. This is from one of my tests with a larger (15MB) but the idea is 
the same.

wget  http://xxx/example.pdf
--13:24:06--  http://xxx/example.pdf
   = `example.pdf.29'
Resolving xxx... xxx
Connecting to xxx | xxx |:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15,807,270 (15M) [application/pdf]

 0% [ ] 77,94894.55K/s

13:24:07 (94.27 KB/s) - Read error at byte 77948/15807270 (Connection reset by 
peer). Retrying.

--13:24:08--  http://xxx/example.pdf
  (try: 2) = `example.pdf.29'
Connecting to xxx| xxx |:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 15,807,270 (15M), 15,729,322 (15M) remaining [application/pdf]

 3% [] 493,221  133.01K/sETA 01:52

13:24:11 (132.71 KB/s) - Read error at byte 493221/15807270 (Connection reset 
by peer). Retrying.

--13:24:13--  http://xxx/example.pdf
  (try: 3) = `example.pdf.29'
Connecting to xxx | xxx |:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 15,807,270 (15M), 15,314,049 (15M) remaining [application/pdf]

 3% [+] 581,245  132.67K/s

13:24:14 (132.09 KB/s) - Read error at byte 581245/15807270 (Connection reset 
by peer). Retrying.

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



Re: Http 500 and %b in access log

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mohit,

On 1/20/2010 12:06 PM, Mohit Anchlia wrote:
 Tomcat 6:

Which specific version, please. Also, what connector(s) are you using.
Please provide the configuration for them. Are you using another web
server in front of Tomcat? If so, which one, and how are you connecting
them (mod_jk, mod_proxy_ajp, mod_proxy_http, etc.)?

 I am seeing Exception in localhost java.net.SocketTimeoutException:
 Read time out. I looked at the access log and I see tomcat returning
 Http 500. Only thing in common is that %b (bytes sent) for all the
 timeouts are 2657. For rest of them where requests are successful
 it's less than 2657.

Interesting. Do all responses with fewer than 2657 bytes succeed? Do all
responses with more than 2656 bytes fail?

Please post the entire stack trace of the exception.

 Could someone help me understand what %b is for in localhost access
 logs and if what I am seeing makes sense.

%b is, as you say, the number of bytes sent (presumably to the client,
in the response).

Does this always fail with certain clients? If so, which ones? Are these
normal web browsers, or are you using a custom client?

 Does SocketTimeoutException correspond to ConnectionTimeout in the
 connector? We tried increasing it but didn't make any difference.

ConnectionTimeout is how long the connector will wait after a connection
is established for the request to come from the client.

There really isn't a setting on the standard HTTP connector that will
cause a timeout to occur when writing to the connection.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXT8wACgkQ9CaO5/Lv0PC+wwCgjE73Gni6yEQ9qJYbldBamfUJ
+2IAnjgjRVHVoq8Cro2MmrTrjXTXG0jf
=B4HZ
-END PGP SIGNATURE-

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



form authentication error on tomcat cluster

2010-01-20 Thread Okubo, Yasushi (TSD)
Hi

 

I have configured tomcat cluster [v6.0.20] on linux box with
mod_proxy/mod_proxy_ajp [tomcat 6/Redhat 5/stickysession also turned on
for load balancer] on two different nodes. Each node is running one
tomcat instance.  I inserted cluster element under engine and turned on
jvmroute by setting up mod_proxy/mod_proxy_ajp. I also tested with
mod_jk, but both cases failed.

 

Anyway, when I turned on form authentication, it always generates the
error for the fist login attempt, but the second login attempt always
succeeds. 

I am getting:

HTTP Status 400 - Invalid direct reference to form login page

 

When I switched from form to basic authentication, the first login
attempt always succeeds. 

 

When I turned off mod_proxy/mod_proxy_ajp or mod_jk with very basic
simple cluster configuration also has this problem if I tried to use two
nodes [two physically different node by inserting cluster element under
engine element on server.xml].  If I moved cluster element to under host
element by setting up two tomcat instances on the same machine/node, the
first login attempts succeeds with form authentication. 

 

Is there any way to make form authentication work for the fist login
attempt with two different nodes?  

 

I am using clustersinglesignon. Even if I switch to singlesignon, the
result is consistent.

 

Any idea?

 

Thanks,

yasushi

 



Re: Different apps clustering on the same Tomcat?

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John,

On 1/20/2010 12:37 PM, John Tangney wrote:
 Just for background... In an ideal world, we'd just buy another 
 server and add it to the (existing) cluster. But we are looking for
 ways to get the benefit of another cluster node without new
 hardware.

Is this need for a new server related to your desire to add a shadow
copy of the webapp? If so, I don't see the point: deploying another
instance of the webapp into an existing Tomcat isn't going to help you
serve any more users... which would be the point of bringing another
server online. Maybe I don't understand.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXUHIACgkQ9CaO5/Lv0PDl+ACfQri+1/l/fY4JAB2WkMqTl/E/
xWQAnAz4//+Mwqb+ovDnH3sWCsQRjwxi
=GrHE
-END PGP SIGNATURE-

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



Tomcat encryption algorithms

2010-01-20 Thread Shan, Justine
Hi,

As far as I know, the only encryption implemented by Tomcat itself is SSL. But 
I need to know what exactly algorithms have been implemented and distributed 
with the binary from Apache Tomcat 5.X and 6.

To my understanding, Tomcat relies on the JVM or JCE installed on the user's 
machine to implement SSL, which implies Tomcat doesn't ship any cryptographic 
algorithms but only implements SSL protocol. On the other hand, from the Legal 
page Tomcat is classified as 5D002, strong cryptography. This implies Tomcat 
does contain (and thus ships with) encryption implementation. And I need to 
know what exactly algorithms are implemented.

Please reply to me at justine.s...@sap.commailto:justine.s...@sap.com

Thank you very much!

Justine




RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: RE: Different apps clustering on the same Tomcat?
 
 We have two machines, each with a Tomcat, forming a cluster. An app
 named gh runs on each cluster node. We want to add a second app to
 one of the Tomcats (call it gh2 ? it's just a clone of gh) that
 synchronizes sessions with gh on all of the nodes.

Like Chris, I still don't really understand what you're trying to achieve.

  You can create a bean from a class in a shared library to hold
  data needed by both apps.
 
 Ah, this sounds promising! Where would this shared library live so that
 both apps can talk to it?

In Tomcat 6, $CATALINA_HOME/lib; in 5.5, $CATALINA_HOME/shared/lib (or 
classes).  You also have the option of modifying conf/catalina.properties and 
defining your own location for classloaders to examine.

 - 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



PermGen question

2010-01-20 Thread Jeffrey Janner
I've got a really odd situation that I'm not understanding.  I figured
the gurus could explain it to me.

I have two Tomcat instances deployed as services on the same 64bit
Windows 2008 machine with Sun JDK 1.6.0_13 64bit.

They are running the same apps but for different user bases and were
deployed per the Tomcat doc on running multiple instances.

The only difference in their configs, besides the obvious file pointers,
is the memory settings.

 

Instance 1 is -Xmx=5000M -Xms5000M

Instance 2 is -Xmx=4096M -Xms3092M  (yes, I know, it's best to make them
the same)

Neither has a Thread Stack Size set.

 

When I did a thread dump on each instance, I noticed that the PermGen
space for each instance was different.  Even more interesting, the
instance with the smaller memory settings had the larger PermGen.

 

Instance 1:

Heap

 PSYoungGen  total 1622976K, used 714557K [0x00015595,
0x0001bdbf, 0x0001bdbf)

  eden space 1534528K, 44% used
[0x00015595,0x00017f3795b0,0x0001b33e)

  from space 88448K, 36% used
[0x0001b859,0x0001ba536148,0x0001bdbf)

  to   space 83648K, 0% used
[0x0001b33e,0x0001b33e,0x0001b859)

 PSOldGentotal 3413376K, used 867706K [0x853f,
0x00015595, 0x00015595)

  object space 3413376K, 25% used
[0x853f,0xba34ead0,0x00015595)

 PSPermGen   total 43712K, used 43613K [0x7fff,
0x82aa, 0x853f)

  object space 43712K, 99% used
[0x7fff,0x82a875d8,0x82aa)

 

Instance 2:

Heap

 PSYoungGen  total 989312K, used 149224K [0x00012fea,
0x00016fea, 0x0001853f)

  eden space 932544K, 15% used
[0x00012fea,0x000138c55de0,0x000168d5)

  from space 56768K, 7% used
[0x000168d5,0x000169154480,0x00016c4c)

  to   space 54400K, 0% used
[0x00016c98,0x00016c98,0x00016fea)

 PSOldGentotal 2097152K, used 174926K [0x853f,
0x0001053f, 0x00012fea)

  object space 2097152K, 8% used
[0x853f,0x8fec3a20,0x0001053f)

 PSPermGen   total 86016K, used 45979K [0x7fff,
0x853f, 0x853f)

  object space 86016K, 53% used
[0x7fff,0x82cd6ef8,0x853f)

 

Obviously, I'm concerned about that 99% used value in the first
instance, and will be going back to address it.  However, I would have
thought that it would have the same  size as instance 2. 

 

Can someone explain what's happening here that I'm not seeing?  I didn't
think that the PermGen grew or shrunk over time.

 

Other than the heap size differences, the only other thing that's
different is that #1 has been running a day or two longer than #2.

 

=
Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
mailto:jeffrey.jan...@polydyne.com 
PolyDyne Software Inc.  web: http://www.polydyne.com/
http://www.polydyne.com/ 
9390 Research Blvd.   phone: (512) 343-9100 x8930
Building 1, Suite 400   fax: (512) 343-9297
Austin, TX 78759
=

 


***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


RE: PermGen question

2010-01-20 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: PermGen question
 
 Instance 1:
  PSPermGen   total 43712K, used 43613K [0x7fff,
 0x82aa, 0x853f)
   object space 43712K, 99% used
 [0x7fff,0x82a875d8,0x82aa)
 
 Instance 2:
  PSPermGen   total 86016K, used 45979K [0x7fff,
 0x853f, 0x853f)
   object space 86016K, 53% used
 [0x7fff,0x82cd6ef8,0x853f)

 Obviously, I'm concerned about that 99% used value in the first
 instance, and will be going back to address it.

It is likely not a problem.  That's 99% used of what's allocated, not the 
maximum - 99% is a good thing (high efficiency).  I'd be more concerned about 
Instance 2, where PermGen expanded to 86MB at one point.

 However, I would have thought that it would have the same 
 size as instance 2.

Unless they have identical workloads with identical requests, there will be 
variance.

 Can someone explain what's happening here that I'm not seeing?

Nothing unusual is going on.

 I didn't think that the PermGen grew or shrunk over time.

You thought wrong.  There are parameters for both initial and maximum PermGen 
size; unless they're explicitly set to the same value, PermGen will expand and 
contract, just like the Java heap.

It's often more illuminating to use JConsole or JVisualVM to monitor heap and 
PermGen usage over a significant time period, rather than looking at snapshots.

 - 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 encryption algorithms

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Justine,

On 1/20/2010 1:52 PM, Shan, Justine wrote:
 As far as I know, the only encryption implemented by Tomcat itself
 is SSL.

SSL is a strategy of securely transmitting data, which uses encryption.
Technically speaking, Tomcat does not /implement/ SSL, but rather uses
the JVM's SSL libraries to provide HTTP over SSL.

 But I need to know what exactly algorithms have been implemented and
 distributed with the binary from Apache Tomcat 5.X and 6.

Tomcat does not ship with any cryptographic algorithms.

 To my understanding, Tomcat relies on the JVM or JCE installed on
 the user's machine to implement SSL, which implies Tomcat doesn't
 ship any cryptographic algorithms but only implements SSL protocol.

Correct.

 On the other hand, from the Legal page Tomcat is classified as 5D002,
 strong cryptography.

Would you care to provide a reference? I can find none of the following
strings on the Legal page for Tomcat
(http://tomcat.apache.org/legal.html): crypt, 5D002, classif, or
anything like that.

 This implies Tomcat does contain (and thus ships with) encryption
 implementation. And I need to know what exactly algorithms are
 implemented.

Again, none are implemented: everything is implemented by the JRE/JVM or
a 3rd-party library, if you choose to install and configure one (such as
Bouncy Castle... I'm sure there are others).

If you just want to know which algorithms are available to your JDK, you
can write a bit of code to dump-out that information, but it depends
entirely on your environment.

Tomcat also allows you to use OpenSSL as an SSL provider (using the APR
native library) which may provide a different set of encryption
algorithms to Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXVRAACgkQ9CaO5/Lv0PBorwCgprlSVdu1ly0DWdpvA8PS2nZV
61MAoII8HcPJ2nTTCSTflA3Ic3q2PSRb
=Xnhn
-END PGP SIGNATURE-

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



Re: Http 500 and %b in access log

2010-01-20 Thread Mohit Anchlia
On Wed, Jan 20, 2010 at 10:47 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mohit,

 On 1/20/2010 12:06 PM, Mohit Anchlia wrote:
 Tomcat 6:

 Which specific version, please. Also, what connector(s) are you using.
 Please provide the configuration for them. Are you using another web
 server in front of Tomcat? If so, which one, and how are you connecting
 them (mod_jk, mod_proxy_ajp, mod_proxy_http, etc.)?


Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:   /usr/local/java
Server version: Apache Tomcat/6.0.18
Server built:   Jul 22 2008 02:00:36
Server number:  6.0.18.0
OS Name:Linux
OS Version: 2.6.9-42.0.10.ELhugemem
Architecture:   i386
JVM Version:1.5.0_08-b03
JVM Vendor: Sun Microsystems Inc.

We don't any other web server in front

 I am seeing Exception in localhost java.net.SocketTimeoutException:
 Read time out. I looked at the access log and I see tomcat returning
 Http 500. Only thing in common is that %b (bytes sent) for all the
 timeouts are 2657. For rest of them where requests are successful
 it's less than 2657.

 Interesting. Do all responses with fewer than 2657 bytes succeed? Do all
 responses with more than 2656 bytes fail?


YES

 Please post the entire stack trace of the exception.

SEVERE: Servlet.service() for servlet SwitchServlet threw exception
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.FilterInputStream.read(FilterInputStream.java:111)
at 
com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
at 
org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:746)
at 
org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:776)
at 
org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
at 
org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:705)
at org.apache.coyote.Request.doRead(Request.java:428)
at 
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
at 
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218)
at 
com.intuit.engine.efp.efe.efileswitch.SwitchServlet.doPostOrGet(SwitchServlet.java:174)
at 
com.intuit.engine.efp.efe.common.servlet.BaseServlet.doPost(BaseServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)


 Could someone help me understand what %b is for in localhost access
 logs and if what I am seeing makes sense.

 %b is, as you say, the number of bytes sent (presumably to the client,
 in the response).

 Does this always fail with certain clients? If so, which ones? Are these
 normal web browsers, or are you using a custom client?

Yes it always fail with desktop clients on the broadband/modem etc..
Basically ones that are using our GUI application.

 Does SocketTimeoutException correspond to ConnectionTimeout in the
 connector? We tried increasing it but didn't make any difference.

 ConnectionTimeout is how long 

RE: Tomcat encryption algorithms

2010-01-20 Thread Caldarale, Charles R
 From: Shan, Justine [mailto:justine.s...@sap.com]
 Subject: Tomcat encryption algorithms
 
 But I need to know what exactly algorithms have been implemented
 and distributed with the binary from Apache Tomcat 5.X and 6.

That's easy: none.  Tomcat uses whatever algorithms are installed with the JVM 
it's using.

 On the other hand, from the Legal page Tomcat is classified as 5D002,
 strong cryptography.

What Legal page is that?  Certainly not the one on the Tomcat web site.

 Please reply to me at justine.s...@sap.commailto:justine.s...@sap.com

No.  All inquiries and responses should be to the mailing list, not offline.

 - 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: PermGen question

2010-01-20 Thread Jeffrey Janner
And no, I'm not seeing out of PermGen errors -- yet.

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Wednesday, January 20, 2010 12:53 PM
To: Tomcat Users List
Subject: PermGen question

I've got a really odd situation that I'm not understanding.  I figured
the gurus could explain it to me.

I have two Tomcat instances deployed as services on the same 64bit
Windows 2008 machine with Sun JDK 1.6.0_13 64bit.

They are running the same apps but for different user bases and were
deployed per the Tomcat doc on running multiple instances.

The only difference in their configs, besides the obvious file pointers,
is the memory settings.

 

Instance 1 is -Xmx=5000M -Xms5000M

Instance 2 is -Xmx=4096M -Xms3092M  (yes, I know, it's best to make them
the same)

Neither has a Thread Stack Size set.

 

When I did a thread dump on each instance, I noticed that the PermGen
space for each instance was different.  Even more interesting, the
instance with the smaller memory settings had the larger PermGen.

 

Instance 1:

Heap

 PSYoungGen  total 1622976K, used 714557K [0x00015595,
0x0001bdbf, 0x0001bdbf)

  eden space 1534528K, 44% used
[0x00015595,0x00017f3795b0,0x0001b33e)

  from space 88448K, 36% used
[0x0001b859,0x0001ba536148,0x0001bdbf)

  to   space 83648K, 0% used
[0x0001b33e,0x0001b33e,0x0001b859)

 PSOldGentotal 3413376K, used 867706K [0x853f,
0x00015595, 0x00015595)

  object space 3413376K, 25% used
[0x853f,0xba34ead0,0x00015595)

 PSPermGen   total 43712K, used 43613K [0x7fff,
0x82aa, 0x853f)

  object space 43712K, 99% used
[0x7fff,0x82a875d8,0x82aa)

 

Instance 2:

Heap

 PSYoungGen  total 989312K, used 149224K [0x00012fea,
0x00016fea, 0x0001853f)

  eden space 932544K, 15% used
[0x00012fea,0x000138c55de0,0x000168d5)

  from space 56768K, 7% used
[0x000168d5,0x000169154480,0x00016c4c)

  to   space 54400K, 0% used
[0x00016c98,0x00016c98,0x00016fea)

 PSOldGentotal 2097152K, used 174926K [0x853f,
0x0001053f, 0x00012fea)

  object space 2097152K, 8% used
[0x853f,0x8fec3a20,0x0001053f)

 PSPermGen   total 86016K, used 45979K [0x7fff,
0x853f, 0x853f)

  object space 86016K, 53% used
[0x7fff,0x82cd6ef8,0x853f)

 

Obviously, I'm concerned about that 99% used value in the first
instance, and will be going back to address it.  However, I would have
thought that it would have the same  size as instance 2. 

 

Can someone explain what's happening here that I'm not seeing?  I didn't
think that the PermGen grew or shrunk over time.

 

Other than the heap size differences, the only other thing that's
different is that #1 has been running a day or two longer than #2.

 

=
Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
mailto:jeffrey.jan...@polydyne.com 
PolyDyne Software Inc.  web: http://www.polydyne.com/
http://www.polydyne.com/ 
9390 Research Blvd.   phone: (512) 343-9100 x8930
Building 1, Suite 400   fax: (512) 343-9297
Austin, TX 78759
=

 


***  NOTICE
*
This message is intended for the use of the individual or entity to
which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient,

you are hereby notified that any dissemination, distribution, or copying

of this communication is strictly prohibited.  If you have received this

communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.

***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect 

RE: Tomcat encryption algorithms

2010-01-20 Thread Shan, Justine
Thank you so much for the answer!

Regarding the classification, please see the link below: 
http://www.apache.org/licenses/exports/

scroll down to the product Apache Tomcat. It says it's 5D002. I also reached to 
Apache Legal to verify but haven't heard anything back. 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Wednesday, January 20, 2010 11:10 AM
To: Tomcat Users List
Subject: Re: Tomcat encryption algorithms

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Justine,

On 1/20/2010 1:52 PM, Shan, Justine wrote:
 As far as I know, the only encryption implemented by Tomcat itself
 is SSL.

SSL is a strategy of securely transmitting data, which uses encryption.
Technically speaking, Tomcat does not /implement/ SSL, but rather uses
the JVM's SSL libraries to provide HTTP over SSL.

 But I need to know what exactly algorithms have been implemented and
 distributed with the binary from Apache Tomcat 5.X and 6.

Tomcat does not ship with any cryptographic algorithms.

 To my understanding, Tomcat relies on the JVM or JCE installed on
 the user's machine to implement SSL, which implies Tomcat doesn't
 ship any cryptographic algorithms but only implements SSL protocol.

Correct.

 On the other hand, from the Legal page Tomcat is classified as 5D002,
 strong cryptography.

Would you care to provide a reference? I can find none of the following
strings on the Legal page for Tomcat
(http://tomcat.apache.org/legal.html): crypt, 5D002, classif, or
anything like that.

 This implies Tomcat does contain (and thus ships with) encryption
 implementation. And I need to know what exactly algorithms are
 implemented.

Again, none are implemented: everything is implemented by the JRE/JVM or
a 3rd-party library, if you choose to install and configure one (such as
Bouncy Castle... I'm sure there are others).

If you just want to know which algorithms are available to your JDK, you
can write a bit of code to dump-out that information, but it depends
entirely on your environment.

Tomcat also allows you to use OpenSSL as an SSL provider (using the APR
native library) which may provide a different set of encryption
algorithms to Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXVRAACgkQ9CaO5/Lv0PBorwCgprlSVdu1ly0DWdpvA8PS2nZV
61MAoII8HcPJ2nTTCSTflA3Ic3q2PSRb
=Xnhn
-END PGP SIGNATURE-

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



RE: Tomcat encryption algorithms

2010-01-20 Thread Shan, Justine
Thanks! Just replied a min ago with the link :
http://www.apache.org/licenses/exports/

(scroll down to Apache Tomcat)

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, January 20, 2010 11:13 AM
To: Tomcat Users List
Subject: RE: Tomcat encryption algorithms

 From: Shan, Justine [mailto:justine.s...@sap.com]
 Subject: Tomcat encryption algorithms
 
 But I need to know what exactly algorithms have been implemented
 and distributed with the binary from Apache Tomcat 5.X and 6.

That's easy: none.  Tomcat uses whatever algorithms are installed with the JVM 
it's using.

 On the other hand, from the Legal page Tomcat is classified as 5D002,
 strong cryptography.

What Legal page is that?  Certainly not the one on the Tomcat web site.

 Please reply to me at justine.s...@sap.commailto:justine.s...@sap.com

No.  All inquiries and responses should be to the mailing list, not offline.

 - 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


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



Re: TOMCAT GC Issue

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paulwintech,

On 1/20/2010 5:48 AM, Paulwintech wrote:
 Intermediately i get GC critical alert. That means some times GC
 collection goes high and remains for more than 10 mins. Then it clears the
 Grabage. But this is happening recently checked all possible logs found
 nothing. This is not happening every time, Say like twice in a day...

I would enable verbose garbage collection to verify what your
instrumentation is telling you. You can enable verbose GC using this
command-line flag:

- -verbose:gc

or

- -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps

If you are able to post relevant portions of the GC log along with any
other information you provide, it will certainly be helpful.

A 10-minute-long GC run? That sounds disastrous.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXVoIACgkQ9CaO5/Lv0PBHugCZAYKdm4b0rLLsPDRUxXPIr4sU
FqYAoKiUL+CjKGXm+/A9UtuCG9KCnG2s
=9/YG
-END PGP SIGNATURE-

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



RE: Tomcat encryption algorithms

2010-01-20 Thread Caldarale, Charles R
 From: Shan, Justine [mailto:justine.s...@sap.com]
 Subject: RE: Tomcat encryption algorithms
 
 scroll down to the product Apache Tomcat. It says it's 5D002.

Perhaps you missed this part of the explanation of 5D002:

Products classified as ECCN 5D002, are exported by the ASF under the TSU 
exception in EAR 740.13(e), which applies to software containing or *DESIGNED 
FOR USE WITH* encryption software that is publicly available as open source. 
[emphasis added]

 - 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.



Re: Tomcat encryption algorithms

2010-01-20 Thread Mark Thomas
On 20/01/2010 13:52, Shan, Justine wrote:
 Tomcat is classified as 5D002, strong cryptography. This implies
Tomcat does contain (and thus ships with) encryption implementation.

No it doesn't. It means
quote
ASF product distributions that contain or are specially designed to
use cryptography
/quote

Mark

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



Re: Http 500 and %b in access log

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mohit,

On 1/20/2010 2:11 PM, Mohit Anchlia wrote:
 Server version: Apache Tomcat/6.0.18

 We don't any other web server in front

Okay. What connector(s) are you using? I'm not sure it matters, given
the other information you've provided.

 Interesting. Do all responses with fewer than 2657 bytes succeed? Do all
 responses with more than 2656 bytes fail?

 YES

Hmm.

 Please post the entire stack trace of the exception.
 
 SEVERE: Servlet.service() for servlet SwitchServlet threw exception
 java.net.SocketTimeoutException: Read timed out
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at java.io.FilterInputStream.read(FilterInputStream.java:111)
 at 
 com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)

I've never see this class before. What is it? In this some kind of
instrumentation? If so, what happens if you turn it off?

Another interesting thing is that this fails during a read() operation.
So, your servlet isn't failing to send data to the client, it's failing
to read the data in the first place.

I'll bet that 2657 bytes is the size of your 500 error page. Can you
check that?

Does your servlet usually emit fewer than 2657 bytes? That's a pretty
small response for many HTTP requests.

 at 
 org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:746)
 at 
 org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:776)
 at 
 org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
 at 
 org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:705)
 at org.apache.coyote.Request.doRead(Request.java:428)
 at 
 org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
 at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
 at 
 org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
 at 
 org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
 at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
 at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218)
 at 
 com.intuit.engine.efp.efe.efileswitch.SwitchServlet.doPostOrGet(SwitchServlet.java:174)
 at 
 com.intuit.engine.efp.efe.common.servlet.BaseServlet.doPost(BaseServlet.java:48)

So, you're copying a byte array from the client. Where are you copying
it to?

 Yes it always fail with desktop clients on the broadband/modem etc..
 Basically ones that are using our GUI application.

So, regular web browsers like Firefox, MSIE, Safari? When you say GUI
application do you mean a web-based application, or do you have
something else that's running on the client?

 Is there also a timeout where connection is closed when 'n' secs
 expire irrespecitve of if the client and server are actively talking
 to each other.

That would be the SocketTimeout itself which I don't believe is settable
through Tomcat's Connector configuration. The default socket timeout
for ServerSocket is 0 (infinity: wait forever) so it must be that this
default is being changed somewhere along the way.

It's possible that the Connector configurator will pass-through any
settings onto the socket (I haven't read the code). It would be simple
to try adding soTimeout=6 (that's 60 seconds) to your Connector
configuration and see if that works. Check the logs after startup to see
if there's any warning that the soTimeout attribute didn't match
anything useful.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXXFsACgkQ9CaO5/Lv0PCZAACfeJMBprxz6/hwoOmp9PXA8VwN
Rq0An09fm8L6FT6PYP5KolY6R+li+C3H
=ZVEw
-END PGP SIGNATURE-

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



Re: mod_jk codepage in header values

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mirko,

On 1/20/2010 9:42 AM, Mirko Solic wrote:
 for connecting tomcat with apache i'm using mod_jk connector. But i'm
 having problem with header values. On apache side headers values are in
 UTF-8 cp but on tomcat side i have to make conversion from latin-1 cp.

Hmm.

HTTP defines header values as ASCII (well, it inherits that from other
RFCs, but, whatever). If you need to encode non-ASCII data in header
values, you'll need to do it in such a way that your client understands
them. Often, URL-encoding (aka %-encoding) is used in these situations.

 I'm using this code:
 
 for(Enumeration en = request.getHeaderNames(); en.hasMoreElements();){
 header = new Header();
 headerName = (String) en.nextElement();
 header.setHeaderName(headerName);
 header.setHeaderValue(new
 String(request.getHeader(headerName).getBytes(ISO-8859-1)));

For most values, this will work. On the other hand, the response already
knows how to convert a String into ASCII, so you probably don't have to
do this.

 headers.add(header);
 
 header = new Header();
 header.setHeaderName(headerName);
 header.setHeaderValue(request.getHeader(headerName));
 headers.add(header);
 }

The Header class is not part of the Servlet API. What does all of this do?

 Is it possible to configure mod_jk somehow so that this conversion would
 be no longer needed?

I don't believe so. mod_jk simply moves bytes back and forth across the
wire. There is little to no interference with the HTTP protocol.

What information are you passing through the HTTP headers that needs to
be in a particular encoding? These issues are typically handled using
the response body coupled with a Content-Type header which specifies a
character encoding.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXXcUACgkQ9CaO5/Lv0PD5ywCgnzBVvS4a1u1wIpb065Z+ALpS
IDUAnjomSUwNPMcpX2lTe08ytExsJ46G
=V2Cz
-END PGP SIGNATURE-

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



Re: Http 500 and %b in access log

2010-01-20 Thread Mohit Anchlia
On Wed, Jan 20, 2010 at 11:41 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mohit,

 On 1/20/2010 2:11 PM, Mohit Anchlia wrote:
 Server version: Apache Tomcat/6.0.18

 We don't any other web server in front

 Okay. What connector(s) are you using? I'm not sure it matters, given
 the other information you've provided.

Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=12
   maxThreads=300
   redirectPort=8443 /


 Interesting. Do all responses with fewer than 2657 bytes succeed? Do all
 responses with more than 2656 bytes fail?

 YES

 Hmm.

 Please post the entire stack trace of the exception.

 SEVERE: Servlet.service() for servlet SwitchServlet threw exception
 java.net.SocketTimeoutException: Read timed out
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at java.io.FilterInputStream.read(FilterInputStream.java:111)
         at 
 com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)

 I've never see this class before. What is it? In this some kind of
 instrumentation? If so, what happens if you turn it off?

Yes it's Wily that we use to instrument to get the throughput,
response time etc.

 Another interesting thing is that this fails during a read() operation.
 So, your servlet isn't failing to send data to the client, it's failing
 to read the data in the first place.

YES that is correct.

 I'll bet that 2657 bytes is the size of your 500 error page. Can you
 check that?


 Does your servlet usually emit fewer than 2657 bytes? That's a pretty
 small response for many HTTP requests.

Yes we don't send much data because it's just an acknwoledgment that's
parsed by home grown client application

         at 
 org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:746)
         at 
 org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:776)
         at 
 org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
         at 
 org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:705)
         at org.apache.coyote.Request.doRead(Request.java:428)
         at 
 org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
         at 
 org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
         at 
 org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
         at 
 org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
         at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
         at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
         at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218)
         at 
 com.intuit.engine.efp.efe.efileswitch.SwitchServlet.doPostOrGet(SwitchServlet.java:174)
         at 
 com.intuit.engine.efp.efe.common.servlet.BaseServlet.doPost(BaseServlet.java:48)

 So, you're copying a byte array from the client. Where are you copying
 it to?

Copying it to byte array.

transmission = IOUtils.toByteArray(request.getInputStream())

 Yes it always fail with desktop clients on the broadband/modem etc..
 Basically ones that are using our GUI application.

 So, regular web browsers like Firefox, MSIE, Safari? When you say GUI
 application do you mean a web-based application, or do you have
 something else that's running on the client?

Something else which home grown application running on client

 Is there also a timeout where connection is closed when 'n' secs
 expire irrespecitve of if the client and server are actively talking
 to each other.

 That would be the SocketTimeout itself which I don't believe is settable
 through Tomcat's Connector configuration. The default socket timeout
 for ServerSocket is 0 (infinity: wait forever) so it must be that this
 default is being changed somewhere along the way.

 It's possible that the Connector configurator will pass-through any
 settings onto the socket (I haven't read the code). It would be simple
 to try adding soTimeout=6 (that's 60 seconds) to your Connector
 configuration and see if that works. Check the logs after startup to see
 if there's any warning that the soTimeout attribute didn't match
 anything useful.

It didn't throw warning when I changed it.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAktXXFsACgkQ9CaO5/Lv0PCZAACfeJMBprxz6/hwoOmp9PXA8VwN
 Rq0An09fm8L6FT6PYP5KolY6R+li+C3H
 =ZVEw
 -END PGP SIGNATURE-

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




Re: Polling and session timeout

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael,

I've been seeing this message on the list for a few days, and haven't
responded because I didn't have any suggestions for you. Since nobody
has answered, I'll go ahead and give you my thoughts.

On 1/12/2010 10:42 AM, grailcattt wrote:
 I have a GWT application that polls tomcat periodically to deliver
 notifications into the browser.
 
 This works well, except that the session never times out since the poll
 period is much shorter than our tomcat timeout (have set to 15 minutes now).

I presume you expect that this would be the case.

 Is there any way to specify that my PollingServlet does not cause a reset of
 the session timeout. Or to have the PollingServlet use a different, perhaps
 transient, session?

This is not really possible, but there are other possibilities. Consider
this one:

You write a filter that updates an in-session timestamp of the last time
the session was used meaningfully: that is, by some truly useful
thing, instead of one of these polling requests. Map this filter to all
URLs /except/ those that do this kind of polling.

Now, in your polling servlet, you check this value and expire the
session if the last meaningful use of the session exceeds the timeout
configured for sessions (which is easy to check). If it does, expire the
session and return an error to the polling caller.

What happens to your GWT-based polling process if it gets an error? Will
it keep polling forever, getting errors? Or, will it go into an error
state and stop bothering the server?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXY80ACgkQ9CaO5/Lv0PAWGQCfR0ru/bPn6mfnDyesGn3rr9Vp
uuIAn2rePjy5HU9/5GUWK9N5bQ7GJ8Xv
=TzbK
-END PGP SIGNATURE-

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



RE: PermGen question

2010-01-20 Thread Jeffrey Janner
Thanks Charles.  I found that later in a link I got from Google.  I'd
found lots of references to how to set MaxPermGen, but I already knew
that.  I also found lots of references that the default was 64Mb, which
didn't jive with the 86Mb that one instance had.  Perhaps the 64bit
server default is a good bit higher than the 32bit version.  Plus I was
reading it, erroneously, as the starting value.  
I think I'll stick to searching the SUN docs on this stuff like I used
to.  I googled thinking it would probably get me to some Sun docs
quickly, but it's returning a lot of other links.

Yea, if I'm really worried about it, I watch it with jconsole. I had
just found it interesting on reviewing the thread dumps - it looked odd.
Yes, the two loads are vastly different, different # users, different
dataset sizes, different usage patterns.  From my support folks, I hear
that instance 1 has probably been lightly used the last 2 days, but will
probably be having more usage today/tomorrow - and heavy data pulls at
that.

The numbers will probably be vastly different at the end of the day
tomorrow.

Thanks again.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, January 20, 2010 1:08 PM
To: Tomcat Users List
Subject: RE: PermGen question

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: PermGen question
 
 Instance 1:
  PSPermGen   total 43712K, used 43613K [0x7fff,
 0x82aa, 0x853f)
   object space 43712K, 99% used
 [0x7fff,0x82a875d8,0x82aa)
 
 Instance 2:
  PSPermGen   total 86016K, used 45979K [0x7fff,
 0x853f, 0x853f)
   object space 86016K, 53% used
 [0x7fff,0x82cd6ef8,0x853f)

 Obviously, I'm concerned about that 99% used value in the first
 instance, and will be going back to address it.

It is likely not a problem.  That's 99% used of what's allocated, not
the maximum - 99% is a good thing (high efficiency).  I'd be more
concerned about Instance 2, where PermGen expanded to 86MB at one point.

 However, I would have thought that it would have the same 
 size as instance 2.

Unless they have identical workloads with identical requests, there will
be variance.

 Can someone explain what's happening here that I'm not seeing?

Nothing unusual is going on.

 I didn't think that the PermGen grew or shrunk over time.

You thought wrong.  There are parameters for both initial and maximum
PermGen size; unless they're explicitly set to the same value, PermGen
will expand and contract, just like the Java heap.

It's often more illuminating to use JConsole or JVisualVM to monitor
heap and PermGen usage over a significant time period, rather than
looking at snapshots.

 - 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



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


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



Ajp port in use - tomcat using next available port

2010-01-20 Thread Paul Guglielmino
I'm setting up tomcat and I noticed what I think is an odd behavior.

I'm setting up the server to only listen on an ajp port (8009). If I already
have something listening on that port then tomcat starts listening on the next
port number (8010). This doesn't happen if the shutdown port is already in use
or if I try it with a http connector port that is in use.

I don't seem any mention of this behavior in the docs. I do see an autobind
option for clustering which will turn on behavior like this but I'm not using
clustering. 

Here's a log sample:

Jan 20, 2010 4:02:41 PM org.apache.jk.common.ChannelSocket init
INFO: Port busy 8009 java.net.BindException: Address already in use
Jan 20, 2010 4:02:41 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8010
Jan 20, 2010 4:02:41 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=1 time=0/118  config=null
Jan 20, 2010 4:02:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2945 ms

The connector from server.xml is:
Connector port=${ajp-port} protocol=AJP/1.3/

And I define ajp-port on the cmd line. Also tried hard coding the port into
the file. I also tried setting the bind ip address in the server.xml, no luck.

Is this expected behavior? I don't see it mentioned in the docs and google
wasn't helpful. If this is expected then is there a way to shut it off?

This is tomcat 6.0.20 on a fedora 3 server. Java is 1.6.0_14.

Thanks everyone,
Paul

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



Re: Http 500 and %b in access log

2010-01-20 Thread Mohit Anchlia
On the same note. Is there a way to log in access log at what time the
request was received and time response was sent? I am planning to add
more debug to see how long it waits before timing out.

On Wed, Jan 20, 2010 at 12:08 PM, Mohit Anchlia mohitanch...@gmail.com wrote:
 On Wed, Jan 20, 2010 at 11:41 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mohit,

 On 1/20/2010 2:11 PM, Mohit Anchlia wrote:
 Server version: Apache Tomcat/6.0.18

 We don't any other web server in front

 Okay. What connector(s) are you using? I'm not sure it matters, given
 the other information you've provided.

    Connector port=8080 protocol=HTTP/1.1
               connectionTimeout=12
               maxThreads=300
               redirectPort=8443 /


 Interesting. Do all responses with fewer than 2657 bytes succeed? Do all
 responses with more than 2656 bytes fail?

 YES

 Hmm.

 Please post the entire stack trace of the exception.

 SEVERE: Servlet.service() for servlet SwitchServlet threw exception
 java.net.SocketTimeoutException: Read timed out
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at java.io.FilterInputStream.read(FilterInputStream.java:111)
         at 
 com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)

 I've never see this class before. What is it? In this some kind of
 instrumentation? If so, what happens if you turn it off?

 Yes it's Wily that we use to instrument to get the throughput,
 response time etc.

 Another interesting thing is that this fails during a read() operation.
 So, your servlet isn't failing to send data to the client, it's failing
 to read the data in the first place.

 YES that is correct.

 I'll bet that 2657 bytes is the size of your 500 error page. Can you
 check that?


 Does your servlet usually emit fewer than 2657 bytes? That's a pretty
 small response for many HTTP requests.

 Yes we don't send much data because it's just an acknwoledgment that's
 parsed by home grown client application

         at 
 org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:746)
         at 
 org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:776)
         at 
 org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
         at 
 org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:705)
         at org.apache.coyote.Request.doRead(Request.java:428)
         at 
 org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
         at 
 org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
         at 
 org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
         at 
 org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
         at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
         at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
         at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218)
         at 
 com.intuit.engine.efp.efe.efileswitch.SwitchServlet.doPostOrGet(SwitchServlet.java:174)
         at 
 com.intuit.engine.efp.efe.common.servlet.BaseServlet.doPost(BaseServlet.java:48)

 So, you're copying a byte array from the client. Where are you copying
 it to?

 Copying it to byte array.

 transmission = IOUtils.toByteArray(request.getInputStream())

 Yes it always fail with desktop clients on the broadband/modem etc..
 Basically ones that are using our GUI application.

 So, regular web browsers like Firefox, MSIE, Safari? When you say GUI
 application do you mean a web-based application, or do you have
 something else that's running on the client?

 Something else which home grown application running on client

 Is there also a timeout where connection is closed when 'n' secs
 expire irrespecitve of if the client and server are actively talking
 to each other.

 That would be the SocketTimeout itself which I don't believe is settable
 through Tomcat's Connector configuration. The default socket timeout
 for ServerSocket is 0 (infinity: wait forever) so it must be that this
 default is being changed somewhere along the way.

 It's possible that the Connector configurator will pass-through any
 settings onto the socket (I haven't read the code). It would be simple
 to try adding soTimeout=6 (that's 60 seconds) to your Connector
 configuration and see if that works. Check the logs after startup to see
 if there's any warning that the soTimeout attribute didn't match
 anything useful.

 It didn't throw warning when I changed it.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAktXXFsACgkQ9CaO5/Lv0PCZAACfeJMBprxz6/hwoOmp9PXA8VwN
 

Re: Http 500 and %b in access log

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mohit,

On 1/20/2010 3:08 PM, Mohit Anchlia wrote:
 Connector port=8080 protocol=HTTP/1.1
connectionTimeout=12
maxThreads=300
redirectPort=8443 /

Okay, so you're using the standard HTTP connector. Is APR involved? I
notice that your connectionTimeout is 2 minutes: is there a reason to
increase that timeout from the default 1 minute? 1 minute is a long time
to wait around for the client to simply make a request.

 I've never see this class before. What is it? In this some kind of
 instrumentation? If so, what happens if you turn it off?
 
 Yes it's Wily that we use to instrument to get the throughput,
 response time etc.

So... what happens if you take-out the instrumentation? Does the
exception still occur?

 I'll bet that 2657 bytes is the size of your 500 error page. Can you
 check that?

Did you check this?

 Does your servlet usually emit fewer than 2657 bytes? That's a pretty
 small response for many HTTP requests.
 
 Yes we don't send much data because it's just an acknwoledgment that's
 parsed by home grown client application

Interesting: you have a home-grown client application. I wonder if the
client application isn't working properly. For instance, if the client
sends a Content-Length but then doesn't send enough bytes, Tomcat will
wait for a long time and then throw a SocketTimeoutException. It's
possible this is happening in this case. If the client doesn't close the
output stream (from the client to the server) then the server might wait
forever (until it times out) for the remaining data. Again, check that
your client is sane.

 So, you're copying a byte array from the client. Where are you copying
 it to?
 
 Copying it to byte array.
 
 transmission = IOUtils.toByteArray(request.getInputStream())

Ok. You might want to modify the code so that you repeatedly read and
then report the maximum number of bytes read before the pipe stalls.
Logging the Content-Length from the request might also prove useful.

 So, regular web browsers like Firefox, MSIE, Safari? When you say GUI
 application do you mean a web-based application, or do you have
 something else that's running on the client?
 
 Something else which home grown application running on client

I would encourage you to use a well-known client such as wget to check
the server behavior: if wget still has problems, then you know that a
server-side solution is necessary. If wget works with no problems,
you're client app is probably broken.

 [Tomcat] didn't throw warning when I changed [the soTimeout attribute].

Try setting that to 10 seconds (1) and seeing if the client/server
communication fails after 10 seconds. Then, set it to 120 seconds
(12) and see if the same error takes 2 minutes. If so, that setting
is correct, although it won't help you: it will just set the amount of
time necessary before the server gives up on your client.

Again, I'd really recommend that you check into your client app code so
make sure it's following the rules.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXfO8ACgkQ9CaO5/Lv0PD8kQCfSi4pTOuBgQazu7MMT63kAbFU
+c4AoJR/5thGws3IFd0KNfO23+2BItYX
=VvCH
-END PGP SIGNATURE-

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



Re: Http 500 and %b in access log

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mohit,

On 1/20/2010 4:18 PM, Mohit Anchlia wrote:
 On the same note. Is there a way to log in access log at what time the
 request was received and time response was sent? I am planning to add
 more debug to see how long it waits before timing out.

It doesn't look like it:
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html

You could always write a filter to capture this information, though the
notion of request received and response sent timestamps is a little
blurry: your request is never fully-read, so what's the timestamp for
that? If the request does complete, do you want the first-byte time or
the last-byte time? Or both? Same question for the response.

Finally, you can never really know exactly what time certain things
happen due to OS buffering, network lag, etc.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXfk4ACgkQ9CaO5/Lv0PCz5QCgmHtU6bSsxTeTZ+/cXeZgdHAi
2kkAoLOvrdmaBcnMMesMFkAjlJ16Z0Cz
=nVpQ
-END PGP SIGNATURE-

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



Re: Ajp port in use - tomcat using next available port

2010-01-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul,

On 1/20/2010 4:08 PM, Paul Guglielmino wrote:
 I'm setting up the server to only listen on an ajp port (8009). If I already
 have something listening on that port then tomcat starts listening on the next
 port number (8010). This doesn't happen if the shutdown port is already in use
 or if I try it with a http connector port that is in use.
 
 I don't seem any mention of this behavior in the docs. I do see an autobind
 option for clustering which will turn on behavior like this but I'm not using
 clustering. 

I don't see any mention of the auto-port-choosing for Connectors,
either. Are you doing this manually?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktXfscACgkQ9CaO5/Lv0PAolwCePJS+N/wwgsAXqBw3SDrT5j1J
PhsAnjFBcCtids0QPvWT+YxLCgf4goYU
=0Cf5
-END PGP SIGNATURE-

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



Re: Http 500 and %b in access log

2010-01-20 Thread Mohit Anchlia
On Wed, Jan 20, 2010 at 2:00 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mohit,

 On 1/20/2010 3:08 PM, Mohit Anchlia wrote:
     Connector port=8080 protocol=HTTP/1.1
                connectionTimeout=12
                maxThreads=300
                redirectPort=8443 /

 Okay, so you're using the standard HTTP connector. Is APR involved? I
 notice that your connectionTimeout is 2 minutes: is there a reason to
 increase that timeout from the default 1 minute? 1 minute is a long time
 to wait around for the client to simply make a request.

 I've never see this class before. What is it? In this some kind of
 instrumentation? If so, what happens if you turn it off?

 Yes it's Wily that we use to instrument to get the throughput,
 response time etc.

 So... what happens if you take-out the instrumentation? Does the
 exception still occur?

 I'll bet that 2657 bytes is the size of your 500 error page. Can you
 check that?

 Did you check this?

 Does your servlet usually emit fewer than 2657 bytes? That's a pretty
 small response for many HTTP requests.

 Yes we don't send much data because it's just an acknwoledgment that's
 parsed by home grown client application

 Interesting: you have a home-grown client application. I wonder if the
 client application isn't working properly. For instance, if the client
 sends a Content-Length but then doesn't send enough bytes, Tomcat will
 wait for a long time and then throw a SocketTimeoutException. It's
 possible this is happening in this case. If the client doesn't close the
 output stream (from the client to the server) then the server might wait
 forever (until it times out) for the remaining data. Again, check that
 your client is sane.

I suspect the following as you mentioned. Is there a way I can write
small application that simulates this behaviour? How do I write in a
way that content-length goes through but bytes are not sent.

 So, you're copying a byte array from the client. Where are you copying
 it to?

 Copying it to byte array.

 transmission = IOUtils.toByteArray(request.getInputStream())

 Ok. You might want to modify the code so that you repeatedly read and
 then report the maximum number of bytes read before the pipe stalls.
 Logging the Content-Length from the request might also prove useful.

 So, regular web browsers like Firefox, MSIE, Safari? When you say GUI
 application do you mean a web-based application, or do you have
 something else that's running on the client?

 Something else which home grown application running on client

 I would encourage you to use a well-known client such as wget to check
 the server behavior: if wget still has problems, then you know that a
 server-side solution is necessary. If wget works with no problems,
 you're client app is probably broken.

 [Tomcat] didn't throw warning when I changed [the soTimeout attribute].

 Try setting that to 10 seconds (1) and seeing if the client/server
 communication fails after 10 seconds. Then, set it to 120 seconds
 (12) and see if the same error takes 2 minutes. If so, that setting
 is correct, although it won't help you: it will just set the amount of
 time necessary before the server gives up on your client.

 Again, I'd really recommend that you check into your client app code so
 make sure it's following the rules.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAktXfO8ACgkQ9CaO5/Lv0PD8kQCfSi4pTOuBgQazu7MMT63kAbFU
 +c4AoJR/5thGws3IFd0KNfO23+2BItYX
 =VvCH
 -END PGP SIGNATURE-

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



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



RE: Http 500 and %b in access log

2010-01-20 Thread Maximilian Stocker


-Original Message-
From: Mohit Anchlia [mailto:mohitanch...@gmail.com]
Sent: Wednesday, January 20, 2010 5:40 PM
To: Tomcat Users List
Subject: Re: Http 500 and %b in access log

I suspect the following as you mentioned. Is there a way I can write
small application that simulates this behaviour? How do I write in a
way that content-length goes through but bytes are not sent.

By just opening a Socket and sending HTTP headers. It's not very difficult.

Do you know the clients who are sending you these hanging connections? Either 
way this is a client problem, but it could be either bad code, or malicious 
code. And if you find it's the latter you should find a another better solution.

You really don't need to waste time by writing a test case or trying to see how 
long the wait is or anything else. It's a client error. So go and investigate 
and fix that.

Also to add that there is only one kind of timeout you can have for a socket in 
Java and it's a read timeout. The exception is coming because you aren't 
getting data from the client in a reasonable amount of time. Increasing your 
wait timeout is a major mistake because all it really does is increase the ease 
which with someone can DoS you.




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



Deploying war on embedded tomcat

2010-01-20 Thread Clay McCoy

I want to programmatically deploy a War file in an embedded Tomcat.

I found these two examples:
http://onjava.com/onjava/2002/04/03/tomcat.html
http://mail-archives.apache.org/mod_mbox/tomcat-users/200704.mbox/20070427190204.279...@gmx.net

Both appear to be completely out of date.  I'm using Tomcat 6.0.18.
Both of these examples use some form of Host.install(String contextPath, URL 
warLocation).  I can't find this method.

Is there any updated information about this?  Does anyone know how to deploy a 
war to an embedded Tomcat?

Thanks,
Clay

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



memory leak

2010-01-20 Thread Ken Bowen
Short version: I have a project which gets some simple info from a db  
via DWR, and outputs it simply on the page.  There is a memory leak on  
the java side.


Longer version:
I've developed a project using JSPs and the Ajax tool DWR 2.0 (Direct  
Web Remoting: http://directwebremoting.org/dwr).
I've used Java 1.6, and am running the project on Tomcat 6.0.20 on a  
remote CentOS 5 VPS with 288MB memory.  {I know that my problem may  
lie in my (mis)use of DWR, but I'm starting here to clarify my  
(possible lack of) understanding about JSP memory usage and Tomcat.}


The app consists of a number of independent tasks, one of which  
(LISTALL) just asks for a list of all the html web pages (about 550)  
available from a certain collection.  The payload shipped to the  
browser is roughly 140K, just consisting of a list of authors and  
titles and urls to the relevant pages.


Using top, I've observed that when I repeatedly run this LISTALL  
request, the resident memory increases about 1Meg for every  
approximately ~10 reloads of the page.  If I turn of javascript in the  
browser and repeatedly reload the page, there is no change in the  
resident memory (as naturally expected).  It is suggestive the 140k *  
10 is in the ballpark of 1Meg.


The LISTALL request is contained in the javascript for onPageLoaded()  
on a very simple JSP page which simply displays the data, together  
with some Amazon and Google ads.


The LISTALL request simply makes a call  
StoriesAccess.getAllAuthorsAndTitles through the DWR servlet:


http://mydomain/dwr/call/plaincall/ 
StoriesAccess.getAllAuthorsAndTitles.dwr


The StoriesAccess class contains no instance variables and consists of  
a collection of methods to be invoked for their callbakcs (the dwr  
servlet makes the return values of the methods available to the  
javascript as a callback).  The getAllAuthorsAndTitles is very  
simple:  It makes several calls to the (MySQL) db to obtain the data,  
and assembles a bean which it returns.

Basically:
public AuthorsWithTitles getAllAuthorsAndTitles(long userNum)
{
 // the data bean to be returned
AuthorsWithTitles result = new AuthorsWithTitles(all);

 // db call to get all the story data
CustomSbDataDAO csbddao = new CustomSbDataDAO();
ListStory alist = csbddao.retrieveStoryAll();

// holds individual author + titles classes being 
assembled:
		HashMapInteger,AuthorAndTitles hres = new  
HashMapInteger,AuthorAndTitles();


IteratorStory stories = alist.iterator();
while (stories.hasNext()){
Story story = stories.next();
Integer authorNum = story.getAuthorNum();

AuthorAndTitles aat = hres.get(authorNum);
if (aat == null){
Author author = 
csbddao.retrieveAuthorByPrimaryKey(authorNum);
aat = new AuthorAndTitles(authorNum, author.getAuthorLN(),  
author.getAuthorFN());

hres.put(authorNum, aat);
}
XStory xstory = new XStory(story);
aat.addStory(xstory);
}
// this will be the actual list of author + titles 
returned:
ArrayListAuthorAndTitles initATs = new 
ArrayListAuthorAndTitles();
initATs.addAll(hres.values());

// sort by author, and sub-sort by assigned title 
letter of story:
		Collections.sort(initATs,  new ComparatorAuthorAndTitles()  
{...comparator} );	

IteratorAuthorAndTitles aTs = initATs.iterator();
while (aTs.hasNext()){
AuthorAndTitles at = aTs.next();
ListXStory xstoryList = at.getAuthorStories();
Collections.sort(xstoryList,...comparator...);
}

result.setAuthorsWithTitles(initATs);
return result;
}

The class CustomSbDataDAO provides methods for accessing MySQL, and  
all connections, statements, resultsets, etc., are released using the  
standard try/catch/finally pattern.   It's my understanding (belief)  
that each time the method runs, when it returns, the values in all the  
local variables become available for gc.


So the obvious issue is where the leak could be occurring.  DWR is  
relatively mature and somewhat extensively used, so there isn't likely  
to be simple-minded memory leak in DWR itself.  Any suggestions for  
where to look or what I may be doing wrong will be greatly appreciated.


Thanks in advance,
Ken


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

Re: Ajp port in use - tomcat using next available port

2010-01-20 Thread Paul Guglielmino
 On 1/20/2010 4:08 PM, Paul Guglielmino wrote:
 I'm setting up the server to only listen on an ajp port (8009). If I already
 have something listening on that port then tomcat starts listening on the 
 next
 port number (8010). This doesn't happen if the shutdown port is already in 
 use
 or if I try it with a http connector port that is in use.
 
 I don't seem any mention of this behavior in the docs. I do see an autobind
 option for clustering which will turn on behavior like this but I'm not using
 clustering. 
 
 I don't see any mention of the auto-port-choosing for Connectors,
 either. Are you doing this manually?

Hi,
I've tried both setting the port number in the server.xml file and tried 
setting it via the cmd line. I have the port in the connector config set as 
${ajp-port} and set it on the cmd line with -Dajp-port=8009 as an arg to the 
java process.

If I have something else listening on 8009 then it just grabs port 8010. I 
don't have 8010 set anywhere else in the config. I found this by accident 
because I had hudson running on the same server also using port 8009 for its 
ajp connection. 

Is that what you were asking?

Thanks,
Paul



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



Re: memory leak

2010-01-20 Thread Travis Beech
I would make sure that your DAO class is closing any statements,
resultsets, and connections that are no longer being used once your
method call returns.

Since GC does happen immediately your db resources could still be in
memory.

Travis Beech

On Jan 20, 2010, at 3:50 PM, Ken Bowen kbo...@als.com wrote:

 Short version: I have a project which gets some simple info from a
 db via DWR, and outputs it simply on the page.  There is a memory
 leak on the java side.

 Longer version:
 I've developed a project using JSPs and the Ajax tool DWR 2.0
 (Direct Web Remoting: http://directwebremoting.org/dwr).
 I've used Java 1.6, and am running the project on Tomcat 6.0.20 on a
 remote CentOS 5 VPS with 288MB memory.  {I know that my problem may
 lie in my (mis)use of DWR, but I'm starting here to clarify my
 (possible lack of) understanding about JSP memory usage and Tomcat.}

 The app consists of a number of independent tasks, one of which
 (LISTALL) just asks for a list of all the html web pages (about 550)
 available from a certain collection.  The payload shipped to the
 browser is roughly 140K, just consisting of a list of authors and
 titles and urls to the relevant pages.

 Using top, I've observed that when I repeatedly run this LISTALL
 request, the resident memory increases about 1Meg for every
 approximately ~10 reloads of the page.  If I turn of javascript in
 the browser and repeatedly reload the page, there is no change in
 the resident memory (as naturally expected).  It is suggestive the
 140k * 10 is in the ballpark of 1Meg.

 The LISTALL request is contained in the javascript for onPageLoaded
 () on a very simple JSP page which simply displays the data,
 together with some Amazon and Google ads.

 The LISTALL request simply makes a call
 StoriesAccess.getAllAuthorsAndTitles through the DWR servlet:

http://mydomain/dwr/call/plaincall/
 StoriesAccess.getAllAuthorsAndTitles.dwr

 The StoriesAccess class contains no instance variables and consists
 of a collection of methods to be invoked for their callbakcs (the
 dwr servlet makes the return values of the methods available to the
 javascript as a callback).  The getAllAuthorsAndTitles is very
 simple:  It makes several calls to the (MySQL) db to obtain the
 data, and assembles a bean which it returns.
 Basically:
public AuthorsWithTitles getAllAuthorsAndTitles(long userNum)
{
 // the data bean to be returned
AuthorsWithTitles result = new AuthorsWithTitles(all);

 // db call to get all the story data
CustomSbDataDAO csbddao = new CustomSbDataDAO();
ListStory alist = csbddao.retrieveStoryAll();

// holds individual author + titles classes being
 assembled:
HashMapInteger,AuthorAndTitles hres = new
 HashMapInteger,AuthorAndTitles();

IteratorStory stories = alist.iterator();
while (stories.hasNext()){
Story story = stories.next();
Integer authorNum = story.getAuthorNum();

AuthorAndTitles aat = hres.get(authorNum);
if (aat == null){
Author author = csbddao.retrieveAuthorByPrimaryKey
 (authorNum);
aat = new AuthorAndTitles(authorNum,
 author.getAuthorLN(), author.getAuthorFN());
hres.put(authorNum, aat);
}
XStory xstory = new XStory(story);
aat.addStory(xstory);
}
// this will be the actual list of author + titles
 returned:
ArrayListAuthorAndTitles initATs = new
 ArrayListAuthorAndTitles();
initATs.addAll(hres.values());

// sort by author, and sub-sort by assigned title letter
 of story:
Collections.sort(initATs,  new ComparatorAuthorAndTitles()
 {...comparator} );
IteratorAuthorAndTitles aTs = initATs.iterator();
while (aTs.hasNext()){
AuthorAndTitles at = aTs.next();
ListXStory xstoryList = at.getAuthorStories();
Collections.sort(xstoryList,...comparator...);
}

result.setAuthorsWithTitles(initATs);
return result;
}

 The class CustomSbDataDAO provides methods for accessing MySQL, and
 all connections, statements, resultsets, etc., are released using
 the standard try/catch/finally pattern.   It's my understanding
 (belief) that each time the method runs, when it returns, the values
 in all the local variables become available for gc.

 So the obvious issue is where the leak could be occurring.  DWR is
 relatively mature and somewhat extensively used, so there isn't
 likely to be simple-minded memory leak in DWR itself.  Any
 suggestions for where to look or what I may be doing wrong will be
 greatly appreciated.

 Thanks in advance,
 Ken


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



Re: Ajp port in use - tomcat using next available port

2010-01-20 Thread Mark Thomas
On 20/01/2010 17:08, Christopher Schultz wrote:
 Paul,
 
 On 1/20/2010 4:08 PM, Paul Guglielmino wrote:
 I'm setting up the server to only listen on an ajp port (8009). If I already
 have something listening on that port then tomcat starts listening on the 
 next
 port number (8010). This doesn't happen if the shutdown port is already in 
 use
 or if I try it with a http connector port that is in use.
 
 I don't seem any mention of this behavior in the docs. I do see an autobind
 option for clustering which will turn on behavior like this but I'm not using
 clustering. 
 
 I don't see any mention of the auto-port-choosing for Connectors,
 either. Are you doing this manually?

It is an undocumented feature of the
org.apache.jk.server.JkCoyoteHandler implementation. Setting maxPort to
the same value as port should disable it.

Alternatively use the newer (and default in Tomcat 7)
org.apache.coyote.ajp.AjpProtocol implementation.

Mark

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



RE: Multiple Services running on single Server instance?

2010-01-20 Thread Caldarale, Charles R
 From: Ted Steiner [mailto:ted006...@yahoo.com]
 Subject: Multiple Services running on single Server instance?
 
 Is there any good reason to do this? If so, could someone please let me
 know and possibly provide an example?

Your question is rather vague.  Want to give us some idea of what you're 
actually asking for, along with basic information such as Tomcat version and 
platform you want to use?

If you just want to run multiple instances of Tomcat as services on a Windows 
box, just configure the ports to avoid conflicts, and use the service.bat 
script to install them under different names.  (The service.bat script is only 
in the .zip and tar downloads, not the .exe one.)

 - 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: memory leak

2010-01-20 Thread Caldarale, Charles R
 From: Ken Bowen [mailto:kbo...@als.com]
 Subject: memory leak
 
 Short version: I have a project which gets some simple info from a db
 via DWR, and outputs it simply on the page.  There is a memory leak on
 the java side.

First off, do you really have a leak?  top is not an appropriate tool for 
examining Java heap usage.  JConsole, JVisualVM, and the various GC logging 
settings will give you real information.

If you really do have a leak, you can use a heap profiler to find out what's 
consuming the space and who's allocating it.  Also, jhat can be used with a 
heap dump to trace objects back to their roots, so you can see if there perhaps 
are any object references lying around that should have been cleared; loggers 
and pooling mechanisms (as Travis noted) are somewhat infamous for doing that.

 - 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: memory leak

2010-01-20 Thread Ken Bowen
As I mentioned, the DAO class uses a standard try/catch/finally  
pattern to ensure that all statements, resultsets,  connections have  
been closed before a method returns.


On Jan 20, 2010, at 9:25 PM, Travis Beech wrote:


I would make sure that your DAO class is closing any statements,
resultsets, and connections that are no longer being used once your
method call returns.

Since GC does happen immediately your db resources could still be in
memory.

Travis Beech

On Jan 20, 2010, at 3:50 PM, Ken Bowen kbo...@als.com wrote:


Short version: I have a project which gets some simple info from a
db via DWR, and outputs it simply on the page.  There is a memory
leak on the java side.

Longer version:
I've developed a project using JSPs and the Ajax tool DWR 2.0
(Direct Web Remoting: http://directwebremoting.org/dwr).
I've used Java 1.6, and am running the project on Tomcat 6.0.20 on a
remote CentOS 5 VPS with 288MB memory.  {I know that my problem may
lie in my (mis)use of DWR, but I'm starting here to clarify my
(possible lack of) understanding about JSP memory usage and Tomcat.}

The app consists of a number of independent tasks, one of which
(LISTALL) just asks for a list of all the html web pages (about 550)
available from a certain collection.  The payload shipped to the
browser is roughly 140K, just consisting of a list of authors and
titles and urls to the relevant pages.

Using top, I've observed that when I repeatedly run this LISTALL
request, the resident memory increases about 1Meg for every
approximately ~10 reloads of the page.  If I turn of javascript in
the browser and repeatedly reload the page, there is no change in
the resident memory (as naturally expected).  It is suggestive the
140k * 10 is in the ballpark of 1Meg.

The LISTALL request is contained in the javascript for onPageLoaded
() on a very simple JSP page which simply displays the data,
together with some Amazon and Google ads.

The LISTALL request simply makes a call
StoriesAccess.getAllAuthorsAndTitles through the DWR servlet:

  http://mydomain/dwr/call/plaincall/
StoriesAccess.getAllAuthorsAndTitles.dwr

The StoriesAccess class contains no instance variables and consists
of a collection of methods to be invoked for their callbakcs (the
dwr servlet makes the return values of the methods available to the
javascript as a callback).  The getAllAuthorsAndTitles is very
simple:  It makes several calls to the (MySQL) db to obtain the
data, and assembles a bean which it returns.
Basically:
  public AuthorsWithTitles getAllAuthorsAndTitles(long userNum)
  {
   // the data bean to be returned
  AuthorsWithTitles result = new AuthorsWithTitles(all);

   // db call to get all the story data
  CustomSbDataDAO csbddao = new CustomSbDataDAO();
  ListStory alist = csbddao.retrieveStoryAll();

  // holds individual author + titles classes being
assembled:
  HashMapInteger,AuthorAndTitles hres = new
HashMapInteger,AuthorAndTitles();

  IteratorStory stories = alist.iterator();
  while (stories.hasNext()){
  Story story = stories.next();
  Integer authorNum = story.getAuthorNum();

  AuthorAndTitles aat = hres.get(authorNum);
  if (aat == null){
  Author author = csbddao.retrieveAuthorByPrimaryKey
(authorNum);
  aat = new AuthorAndTitles(authorNum,
author.getAuthorLN(), author.getAuthorFN());
  hres.put(authorNum, aat);
  }
  XStory xstory = new XStory(story);
  aat.addStory(xstory);
  }
  // this will be the actual list of author + titles
returned:
  ArrayListAuthorAndTitles initATs = new
ArrayListAuthorAndTitles();
  initATs.addAll(hres.values());

  // sort by author, and sub-sort by assigned title letter
of story:
  Collections.sort(initATs,  new ComparatorAuthorAndTitles()
{...comparator} );
  IteratorAuthorAndTitles aTs = initATs.iterator();
  while (aTs.hasNext()){
  AuthorAndTitles at = aTs.next();
  ListXStory xstoryList = at.getAuthorStories();
  Collections.sort(xstoryList,...comparator...);
  }

  result.setAuthorsWithTitles(initATs);
  return result;
  }

The class CustomSbDataDAO provides methods for accessing MySQL, and
all connections, statements, resultsets, etc., are released using
the standard try/catch/finally pattern.   It's my understanding
(belief) that each time the method runs, when it returns, the values
in all the local variables become available for gc.

So the obvious issue is where the leak could be occurring.  DWR is
relatively mature and somewhat extensively used, so there isn't
likely to be simple-minded memory leak in DWR itself.  Any
suggestions for where to look or what I may be doing wrong will be
greatly appreciated.

Thanks in advance,
Ken


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

Re: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney

On Jan 20, 2010, at 10:57 AM, Caldarale, Charles R wrote:


From: John Tangney [mailto:jo...@jdtangney.com]
Subject: RE: Different apps clustering on the same Tomcat?

We have two machines, each with a Tomcat, forming a cluster. An app
named gh runs on each cluster node. We want to add a second app to
one of the Tomcats (call it gh2 ? it's just a clone of gh) that
synchronizes sessions with gh on all of the nodes.


Like Chris, I still don't really understand what you're trying to  
achieve.


We use a cluster to do seamless deploys. We use Nginx on the front end  
to direct traffic to one or other of the nodes in the cluster. To  
deploy, we bring up the new version of the app in a one node, tell  
Nginx to send traffic to that node, then bring down the other node.  
Because sessions are propagated, users never notice that one node has  
been exchanged for another.


We need to add two more nodes that run on Windows (we have platform- 
specific code, and Nginx sends windows traffic to one of the windows  
nodes based on URL) but we only have one Windows box. We thought that  
perhaps we could just run a second instance of the app on the Windows  
node.


From what you said previously, this does not appear to be possible.  
So we'll be looking new hardware.


Thanks for all your help!
--johnt


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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: Re: Different apps clustering on the same Tomcat?
 
 We use a cluster to do seamless deploys. We use Nginx on the front end
 to direct traffic to one or other of the nodes in the cluster. To
 deploy, we bring up the new version of the app in a one node, tell
 Nginx to send traffic to that node, then bring down the other node.
 Because sessions are propagated, users never notice that one node has
 been exchanged for another.

This is fairly typical.

 We need to add two more nodes that run on Windows (we have platform-
 specific code, and Nginx sends windows traffic to one of the windows
 nodes based on URL) but we only have one Windows box. We thought that
 perhaps we could just run a second instance of the app on the Windows
 node.

This is the part that I can't make sense of.  You talk about two more Windows 
nodes, which I take to mean two more OS/JVM/Tomcat instances.  Then you talk 
about *one* additional instance of your existing webapp running in the same 
Tomcat, but using a different name.  Your numbers don't match up.

You can run multiple instances of Tomcat on the same box, and each could have a 
copy of the app deployed, and each Tomcat could be a separate node in the 
cluster.  You would need to give each Tomcat instance a unique IP address or 
set of ports, of course, and make sure you have enough RAM to handle all 
instances without provoking paging.

 - 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: Different apps clustering on the same Tomcat?

2010-01-20 Thread John Tangney

On Jan 20, 2010, at 7:38 PM, Caldarale, Charles R wrote:

You can run multiple instances of Tomcat on the same box, and each  
could have a copy of the app deployed, and each Tomcat could be a  
separate node in the cluster.


That's exactly what we do on Linux, but it fails on Windows due to a  
bug I have already logged.


--johnt


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



RE: Different apps clustering on the same Tomcat?

2010-01-20 Thread Caldarale, Charles R
 From: John Tangney [mailto:jo...@jdtangney.com]
 Subject: Re: Different apps clustering on the same Tomcat?
 
 That's exactly what we do on Linux, but it fails on Windows due to a
 bug I have already logged.

What bug is that?  I run multiple Tomcats concurrently on Vista 64 without a 
problem.

 - 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: Polling and session timeout

2010-01-20 Thread grailcattt

That is exactly what I ended up doing and it is working well. I was hoping
for a solution that used tomcat session management rather than managing my
own session timeouts, but it works well.
-- 
View this message in context: 
http://old.nabble.com/Polling-and-session-timeout-tp27129549p27252791.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: memory leak

2010-01-20 Thread Travis Beech
Are you doing any server side caching of the data? If so perhaps your
caching mechanism is re-caching the same data per request?

As Charles said earlier, your best bet would be to use a profiling tool that
will tell you exactly where the memory is being allocated.

-Original Message-
From: Ken Bowen [mailto:kbo...@als.com] 
Sent: Wednesday, January 20, 2010 7:11 PM
To: Tomcat Users List
Subject: Re: memory leak

As I mentioned, the DAO class uses a standard try/catch/finally  
pattern to ensure that all statements, resultsets,  connections have  
been closed before a method returns.

On Jan 20, 2010, at 9:25 PM, Travis Beech wrote:

 I would make sure that your DAO class is closing any statements,
 resultsets, and connections that are no longer being used once your
 method call returns.

 Since GC does happen immediately your db resources could still be in
 memory.

 Travis Beech

 On Jan 20, 2010, at 3:50 PM, Ken Bowen kbo...@als.com wrote:

 Short version: I have a project which gets some simple info from a
 db via DWR, and outputs it simply on the page.  There is a memory
 leak on the java side.

 Longer version:
 I've developed a project using JSPs and the Ajax tool DWR 2.0
 (Direct Web Remoting: http://directwebremoting.org/dwr).
 I've used Java 1.6, and am running the project on Tomcat 6.0.20 on a
 remote CentOS 5 VPS with 288MB memory.  {I know that my problem may
 lie in my (mis)use of DWR, but I'm starting here to clarify my
 (possible lack of) understanding about JSP memory usage and Tomcat.}

 The app consists of a number of independent tasks, one of which
 (LISTALL) just asks for a list of all the html web pages (about 550)
 available from a certain collection.  The payload shipped to the
 browser is roughly 140K, just consisting of a list of authors and
 titles and urls to the relevant pages.

 Using top, I've observed that when I repeatedly run this LISTALL
 request, the resident memory increases about 1Meg for every
 approximately ~10 reloads of the page.  If I turn of javascript in
 the browser and repeatedly reload the page, there is no change in
 the resident memory (as naturally expected).  It is suggestive the
 140k * 10 is in the ballpark of 1Meg.

 The LISTALL request is contained in the javascript for onPageLoaded
 () on a very simple JSP page which simply displays the data,
 together with some Amazon and Google ads.

 The LISTALL request simply makes a call
 StoriesAccess.getAllAuthorsAndTitles through the DWR servlet:

   http://mydomain/dwr/call/plaincall/
 StoriesAccess.getAllAuthorsAndTitles.dwr

 The StoriesAccess class contains no instance variables and consists
 of a collection of methods to be invoked for their callbakcs (the
 dwr servlet makes the return values of the methods available to the
 javascript as a callback).  The getAllAuthorsAndTitles is very
 simple:  It makes several calls to the (MySQL) db to obtain the
 data, and assembles a bean which it returns.
 Basically:
   public AuthorsWithTitles getAllAuthorsAndTitles(long userNum)
   {
// the data bean to be returned
   AuthorsWithTitles result = new AuthorsWithTitles(all);

// db call to get all the story data
   CustomSbDataDAO csbddao = new CustomSbDataDAO();
   ListStory alist = csbddao.retrieveStoryAll();

   // holds individual author + titles classes being
 assembled:
   HashMapInteger,AuthorAndTitles hres = new
 HashMapInteger,AuthorAndTitles();

   IteratorStory stories = alist.iterator();
   while (stories.hasNext()){
   Story story = stories.next();
   Integer authorNum = story.getAuthorNum();

   AuthorAndTitles aat = hres.get(authorNum);
   if (aat == null){
   Author author = csbddao.retrieveAuthorByPrimaryKey
 (authorNum);
   aat = new AuthorAndTitles(authorNum,
 author.getAuthorLN(), author.getAuthorFN());
   hres.put(authorNum, aat);
   }
   XStory xstory = new XStory(story);
   aat.addStory(xstory);
   }
   // this will be the actual list of author + titles
 returned:
   ArrayListAuthorAndTitles initATs = new
 ArrayListAuthorAndTitles();
   initATs.addAll(hres.values());

   // sort by author, and sub-sort by assigned title letter
 of story:
   Collections.sort(initATs,  new ComparatorAuthorAndTitles()
 {...comparator} );
   IteratorAuthorAndTitles aTs = initATs.iterator();
   while (aTs.hasNext()){
   AuthorAndTitles at = aTs.next();
   ListXStory xstoryList = at.getAuthorStories();
   Collections.sort(xstoryList,...comparator...);
   }

   result.setAuthorsWithTitles(initATs);
   return result;
   }

 The class CustomSbDataDAO provides methods for accessing MySQL, and
 all connections, statements, resultsets, etc., are released using
 the standard try/catch/finally pattern.   It's my understanding
 (belief) that each time the method runs, when it returns, 

Re: TOMCAT GC Issue

2010-01-20 Thread Paulwintech

Hi,
 
  I am really sorry it was my typo mistake its 10 second not 10 mins =^D.

   Please let me know what are the logs you are looking for accordingly i
will send.

Thanks
Paulwintech



Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Paulwintech,
 
 On 1/20/2010 5:48 AM, Paulwintech wrote:
 Intermediately i get GC critical alert. That means some times GC
 collection goes high and remains for more than 10 mins. Then it clears
 the
 Grabage. But this is happening recently checked all possible logs found
 nothing. This is not happening every time, Say like twice in a day...
 
 I would enable verbose garbage collection to verify what your
 instrumentation is telling you. You can enable verbose GC using this
 command-line flag:
 
 - -verbose:gc
 
 or
 
 - -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps
 
 If you are able to post relevant portions of the GC log along with any
 other information you provide, it will certainly be helpful.
 
 A 10-minute-long GC run? That sounds disastrous.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAktXVoIACgkQ9CaO5/Lv0PBHugCZAYKdm4b0rLLsPDRUxXPIr4sU
 FqYAoKiUL+CjKGXm+/A9UtuCG9KCnG2s
 =9/YG
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/TOMCAT-GC-Issue-tp27239776p27253657.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



tomcat log analyzer

2010-01-20 Thread Ramachandran, Vishwanath(IE10)
Hi there

 

We have a application called JIRA, running on apache tomcat. The logs
are in the form of catalina.out. Is there a web log analyzer tool which
analyzes and supports the logs (catalina.out) so as I get output like
the no of visitors, authenticated users, hit counts, page views etc.

 

I have evaluated around 8 tools which do not support catalina.out.
Kindly suggest.

 

 

Regards

Vishwanath

Desk: +91 80 26588360 Extn: 48555