RE: Preventing OutOfMemoryError: Java heap space
From: André Warnier [...@ice-sa.com] would it not be easier to catch the OOM exception and then return a sorry, server overloaded page to the browser ? At that point, it's too late. A thread, somewhere in the system, tried to allocate some memory for an object and couldn't. This could happen anywhere! It might be while allocating the buffer to read the request, or the buffer to send the response, or even the socket instance from which to read the request. There are then no guarantees. You may be unable to send anything back to the client, as you may be unable to access the socket because the OOM was caused by trying to create that socket. Or the thread that got the exception might be one of the threads processing incoming requests. Once the system encounters an out-of-memory error, you pretty much have to stop the process and start again, as you generally have no idea what else has failed. You can't even save any outstanding work to file, as there's no guarantee you can allocate the memory for the file object - if MS Word runs out of memory, you just lost your document! This isn't unique to Java, by the way - if you want a coding nightmare, try to handle *all* malloc() fails in a reasonably sized C program. Or kalloc() calls in a kernel :-). When you realise that running out of memory means you can no longer guarantee to allocate any new memory for any purpose at all, the scale of the problem becomes apparent. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
ClassLoader issues in multithreaded webapp ? TC5.0
Hi I'm using 5.0.28 (with java5 patch) running on java5 (SR9 AIX). My webapp is running on axis 1.2. When I start some threads to do the work in my web service, I'm getting errors like: Exception in thread Thread-33 java.lang.NoClassDefFoundError: my.whatever.package.whatever.class Caused by: java.lang.ClassNotFoundException: my.whatever.package.whatever.class at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) Needless to say all the classes are in place and it works fine with single thread webapp (heavily tested). Using multiple threads, only one or two thread report this error while others seem to work fine. I would say I have a race condition with WebappClassLoader but why does it complain only about my classes ( never throws CNFE for java.* classes ). Any thoughts ? Thanks in advance, Kate. -- View this message in context: http://www.nabble.com/ClassLoader-issues-in-multithreaded-webapp---TC5.0-tp23515950p23515950.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: Preventing OutOfMemoryError: Java heap space
From: Todd Hivnor [mailto:spambox_98...@yahoo.com] One challenge with Peter's suggestion of tracking the number of sessions myself is that I have a collection of webapps. So I can't just set up a shared static counter; I need a counter which works across multiple webapps. The only way I know to do that is to use a text file, and take care about locking the file before updating it. Or perhaps I can use ServletContext. Some classes can be shared across webapps, though the precise approach varies depending on the version. See the Classloader how-to for your Tomcat version at http://tomcat.apache.org for details. Pre-6.0, you could load a class through the common or shared classloaders; in 6.0, your options are reduced somewhat. That class could keep a common integer. It doesn't have to be a straight session count; you could weight it based on the relative sizes of the sessions. A heavy session increments the counter by 10, a light one by 1. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to create a virtual host with war file without beeing created aROOT dir?
Thank you for your answers, the versions is apache-tomcat-6.0.16, sorry. I'll try to make the things as you say. Thanks!! awarnier wrote: Caldarale, Charles R wrote: From: raistlink [mailto:ela...@gmail.com] Subject: How to create a virtual host with war file without beeing created aROOT dir? I've been developing an application with this structure of directories Care to tell us the version of Tomcat you're using? Or should we just guess? The above is incorrect; set it up like this: mydir/html/ROOT mydir/html/ROOT/WEB-INF mydir/html/ROOT/WEB-INF/classes mydir/html/ROOT/WEB-INF/lib mydir/html/ROOT/WEB-INF/web.xml At server.xml I've included this host: Host name=myhost.es appBase=/myhost/html unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false With the above directory changes, your Host settings are o.k. Context path= reloadable=true docBase=/myhost/html/ The Context is completely wrong: 1) Don't put Context elements in server.xml - that's extremely bad practice unless you're using an ancient level of Tomcat. 2) The Context element should be in the webapp's META-INF/context.xml file; in your case, that will be mydir/html/ROOT/META-INF/context.xml. 3) The docBase attribute (when used, which is rarely) must *never* be the same as appBase. 4) For your case, the path and docBase attributes are not allowed when the Context element is in the proper location; remove them. And everything works fine. Not really; there are bugs in certain versions of Tomcat that make it appear to work. You're also getting double application deployment and have serious security holes with your current setup. What I've done es to take the directory mydir/html and create the html.war. Change the name to ROOT.war. Then I changed the host by this one: Host name=myhost.es appBase=/myhost unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false The above is o.k. Context path= reloadable=true docBase=/myhost/html/ This is bad, for the reasons stated above. Correct it as noted above. What I don't get in all this, is how it works, what with the application located in /mydir/html and the Tomcat appBase in /myhost/html. What version of Tomcat is that ? It's *really* smart. ;-) - 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://www.nabble.com/How-to-create-a-virtual-host-with-war-file-without-beeing-created-a-ROOT-dir--tp23504283p23518575.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 close_wait state and proxy error when connecting to my web application
On 12.05.2009 23:26, orahi001 wrote: Hi, I have apache web server running on one box as a proxy server tomcat running on another box. The apache server connects to application server (tomcat) via proxy passthru parameter. The server running tomcat was recently rebooted. When it came back up I started tomcat but I can no longer connect to my web application over http. I'm getting a proxy error in my browser window: error reading from the remote server. The apache log shows the same message. On the server running tomcat, netstat -a shows the port running tomcat changes to a state of close_wait. however, if I telnet to the port (8980) from the server running apache I can connect and the port shows a state of established. Any ideas as to why I can no longer reach my web application? Whats causing this close_wait state? CLOSE_WAIT is when the remote side of a connection closed it. It seems your proxy tries to reuse an existing connection tha doesn't work any more. So have a look at how to configure the proxy connection pools, using timeouts etc. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Preventing OutOfMemoryError: Java heap space
On 13.05.2009 08:07, Peter Crowther wrote: From: André Warnier [...@ice-sa.com] would it not be easier to catch the OOM exception and then return a sorry, server overloaded page to the browser ? At that point, it's too late. A thread, somewhere in the system, tried to allocate some memory for an object and couldn't. This could happen anywhere! It might be while allocating the buffer to read the request, or the buffer to send the response, or even the socket instance from which to read the request. There are then no guarantees. You may be unable to send anything back to the client, as you may be unable to access the socket because the OOM was caused by trying to create that socket. Or the thread that got the exception might be one of the threads processing incoming requests. Once the system encounters an out-of-memory error, you pretty much have to stop the process and start again, as you generally have no idea what else has failed. You can't even save any outstanding work to file, as there's no guarantee you can allocate the memory for the file object - if MS Word runs out of memory, you just lost your document! This isn't unique to Java, by the way - if you want a coding nightmare, try to handle *all* malloc() fails in a reasonably sized C program. Or kalloc() calls in a kernel :-). When you realise that running out of memory means you can no longer guarantee to allocate any new memory for any purpose at all, the scale of the problem becomes apparent. +1! Another example for no more guarantees: after an OOME in heap, your business logic might be broken in a very unexpected way! Don't let any Java process do more work once it had an OOME in heap. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Connector for diameter protocol
Hi, I am trying to port our existing plain old java diameter ( http://en.wikipedia.org/wiki/Diameter_(protocol) Diameter wiki page ) server on top of tomcat. I am new to J2EE/Tomcat. Since Diameter is quite different from HTTP it is bit difficult to get started with doing things. As far as i have read, it seems that i need a protocol handler for Diameter protocol and feed it into tomcat. Could any one of you please direct me to some documents/references that describes how to develop custom protocol handlers for non HTTP protocols like Sip/Diameter/Radius. Thanks, Ramsundar -- View this message in context: http://www.nabble.com/Connector-for-diameter-protocol-tp23519306p23519306.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: Preventing OutOfMemoryError: Java heap space
From: Todd Hivnor [mailto:spambox_98...@yahoo.com] Subject: Re: Preventing OutOfMemoryError: Java heap space In my tests, as the RAM becomes depleted, the server response becomes slower and slower. That's because you're going through garbage collections at an ever increasing frequency, with little benefit. Yes of course I can throw more RAM at the problem. But I would still like to have a graceful response to the overloaded scenario. More RAM is just delaying the problem. You need to size the system for the expected load, and refuse requests when you approach some arbitrary threshold. You also need to check very carefully for memory leaks in your webapps, since your symptoms are typical of that kind of problem. If you aren't doing so already, run in a 64-bit environment, allowing a much larger heap; your current setting of -Xmx256m is tiny in today's world. Just make sure you have enough RAM to support the heap, otherwise paging will kill your performance. - 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: Form Based Authentication creates user session before it is authenticated?
From: umeshkavade [mailto:umeshkav...@yahoo.co.in] Subject: Re: Form Based Authentication creates user session before it is authenticated? P.S: BTW, is Tomcat planning to resolve this vulnerability in near future? I'll bite: what vulnerability are you referring to? - 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: ClassLoader issues in multithreaded webapp ? TC5.0
From: katepl [mailto:klin...@poczta.fm] Subject: ClassLoader issues in multithreaded webapp ? TC5.0 I'm using 5.0.28 (with java5 patch) What's the java5 patch? Note that Tomcat 5.0 is deprecated. Can you reproduce the problem on a supported level? I don't recall having seen these symptoms on any level, so it may be related to the JVM you're using. - 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: [OT] Performance with many small requests
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 5/12/2009 5:03 PM, Caldarale, Charles R wrote: From: David kerber [mailto:dcker...@verizon.net] Subject: Re: Performance with many small requests When (what java version) did those string operation optimizations happen? Sun's web page that talks about this (and explicitly says that string buffers are usually faster than direct string operations) doesn't mention a specific java version. Don't confuse a StringBuffer (the recommended type) with a byte array (what Chris was talking about). Right. People used to write code like this: String s = ...; char[] c = s.toCharArray(); for(int i=0; ic.length; ++i) if(c[i] == '\n') ...; Instead of just: String s = ...; for(int i=0; is.length(); ++i) if(s.charAt(i) == '\n') ...; Final method calls got a whole lot quicker at some point (like 1.2 or 1.3) and so the conversion to a char array (or even a byte array) merely wastes time (for the constructor, memory allocation, etc.) /plus/ the memory required to duplicate the String's character array. This optimization quickly became a de-optimization. My position has always been that you should write the code how it ought to look. Only if it's really causing you performance pain should you bother to do pinhole optimizations. The JVM authors are more likely to have an effect on the performance of your code (through optimizations of things like method calls and monitor lock acquisition) than pinhole optimizations like the one shown above. Since a String object is immutable, one should always use a StringBuffer (preferably a StringBuilder, these days) when you are constructing strings in a piecemeal fashion, then convert to String when complete. This advice is good when constructing a long string in a loop or across a long series of statements. If you are just concatenating a bunch of string together to make a big one in a single statement, go ahead and use the + operator: the compiler is smart enough to convert the entire thing into a StringBuilder (a non-synchronized replacement for StringBuffer) expression that gets good performance without making your code look like crap. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkoKxUcACgkQ9CaO5/Lv0PCo+gCgrlE7HabUgDG+zcba+GFPwZlP TTEAn2l+hTciWmHGvHH5GSiybnxZfTbi =nuGH -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: IE + Flash + mod_jk issue
On Tue, May 12, 2009 at 4:58 PM, Rainer Jung wrote: On 12.05.2009 22:33, Stephen More wrote: I have a flash application ( Macromedia Breeze Presentation ) that is working fine when I access it directly from tomcat's port 8080. When I access it through apache using mod_jk, IE loads some of the flash files, but not all. The problem is only appearing with IE, it is working fine with Firefox. Here are my options: JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories Could this be a mod_jk issue or should I be looking at something else ? I found a solution. I needed to remove the following from my apache httpd config: AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/html I guess a better solution might be: http://www.robertswarthout.com/2007/05/ie-6-apache-mod_deflate-blank-pages/ -Steve - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Performance with many small requests
Christopher Schultz wrote: ... Since a String object is immutable, one should always use a StringBuffer (preferably a StringBuilder, these days) when you are constructing strings in a piecemeal fashion, then convert to String when complete. This advice is good when constructing a long string in a loop or across a long series of statements. If you are just concatenating a bunch of string together to make a big one in a single statement, go ahead and use the + operator: the compiler is smart enough to convert the entire thing into a StringBuilder (a non-synchronized replacement for StringBuffer) expression that gets good performance without making your code look like crap. I was wondering about that. It certainly seemed like a good place for a smart compiler to fix things up, but didn't know if it actually did or not. I don't do a lot of that, but enough of it that it becomes a style issue. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to configure Tomcat 6.0 with JAAS?
Thanks, if possible could you/someone send some examples of how to configure JAAS with JBoss? I have it working with Tomcat but need the minimum configuration to do the same for JBoss. Note, I have a servlet that at startup sets the JAAS configuration, i.e. Configuration.setConfiguration(configuration) which sets the LoginModule to use. I just need to know how to configure JBoss to work with this LoginModule. -Dave On Tue, May 12, 2009 at 10:56 AM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: How to configure Tomcat 6.0 with JAAS? ... though JBoss uses Tomcat as its default servlet container Unfortunately, JBoss does not use Tomcat's authentication - it has its own. When we wrote JAAS modules for use on our proprietary OS, we had to do separate implemenations for JBoss and Tomcat. - 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: Form Based Authentication creates user session before it is authenticated?
http://www.cafesoft.com/products/cams/tomcat-security.html if you are asking how to overcome Man-in-the-middle fraudulent manipulation based on basic authentication? and or Man-in-the middle fraudulent manipulation based on Form-based authentication which uses j_username and j_password and posts back to j_security_check using cleartext? i would suggest implementation authentication using either Message-Digest or HTTPS Message-Digest processes passwords with a Digest algorithm such as SHA, MD2, or MD5.. the receiving entity must agree on the digested contents for authentication to occur HTTPS or HTTP on a SSL connection usually implemented with a known key stored in a keystore where access is controlled by CA (certificate authority) presentation of a certificate.. a good explanation of how Tomcat implements SSL details are available at http://www.mbaworld.com/docs/ssl-howto.html commercial vendors such as Verisign have implemented CA servers which validate the requesting entity and the requestor to ensure both are indeed who they say they are.. client authenticating to CA authority is a new feature but prevents spoofed clients from order-execution and/or using spoofed credentials to effect fraudulent transactions..I would strongly suggest you enable authentication capability in both directions if using SSL https://www.verisign.com/support/roots.html security elements defined and configured by Tomcat: Deployment descriptor security-constraint elements define the permissions and rules for the protected Tomcat resources and include the following XML elements: web-resource-collection - A set of URL patterns and HTTP methods that describe a set of resources to be protected. All requests that contain a URL pattern matched in a web resource collection are subject to the constraint. auth-constraint - A set of security roles (one or more) to which a user must belong to be granted access to resources matched by the web resource collections (e.g. admin/manager) user-data-constraint - Describes integrity and confidentiality requirements for the transport layer of the client server. an example of XSD which describes user-data-constraintType would be xsd:complexType name=user-data-constraintType xsd:annotation xsd:documentation The user-data-constraintType is used to indicate how data communicated between the client and container should be protected. Used in: security-constraint /xsd:documentation /xsd:annotation xsd:sequence xsd:element name=description type=j2ee:descriptionType minOccurs=0 maxOccurs=unbounded/ xsd:element name=transport-guarantee type=j2ee:transport-guaranteeType/ /xsd:sequence xsd:attribute name=id type=xsd:ID/ /xsd:complexType namespace j2ee is assigned xmlns:j2ee=http://java.sun.com/xml/ns/j2ee; where transport=guaranteeType can be NONE,INTEGRAL or CONFIDENTIAL the latter 2 types imply use of SSL Man in the middle fraud is a concern to all and one which should be dealt with the most secure and reliable algorithm available anyone else? Martin Gainty __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons
Tomcat Cluster Deployment without WAR
Hello, It is possible to make a Cluster Deployment without WAR Files? WatchDir is F:\inetpub\wwwroot if there is something changed, it should be deployed to all other cluster nodes. Mit freundlichen Grüßen tecRacer GmbH Co. KG Alexander Diedler Softwareentwicklung und Netzwerksicherheit Vahrenwalder Str. 156 30165 Hannover Telefon: 0511 59095-950 Durchwahl: 0511 59095-919 Fax: 0511 59095-590 Mobil: 0172 5134664 E-Mail: adied...@tecracer.de Internet: http://www.tecracer.de http://www.tecracer.de/ Registergericht Hannover HRA 200331 Geschäftsführer: Markus P. Herrlich, Sven Ramuschkat, Torsten Höpfner Kompl: tecRacer Verwaltungs GmbH, Hannover HRB 200935 * E-Mails sparen Zeit; sie nicht auszudrucken, spart Bäume. smime.p7s Description: S/MIME cryptographic signature
RE: Tomcat Cluster Deployment without WAR
From: Alexander Diedler [mailto:adied...@tecracer.de] WatchDir is F:\inetpub\wwwroot if there is something changed, it should be deployed to all other cluster nodes. If you're on Windows, why not use the built-in file replication to replicate changes between the nodes rather than use Tomcat? - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Preventing OutOfMemoryError: Java heap space
Thanks, Chuck and Peter, for the clarifications on OOM. I believe that unconsciously, with my large object reservation theory, I was vaguely remembering something I had read some time in the past. So I searched Google for java +parachute +memory and this is something I found : http://mail-archives.apache.org/mod_mbox/tomcat-dev/200703.mbox/%3c20070325171940.34dae1a9...@eris.apache.org%3e Does this have any bearing on the OP's issue ? It is past me capacities to see if it is relevant or not (I don't mean the above post per se, but the idea). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat close_wait state and proxy error when connecting to my web application
Rainer Jung-3 wrote: On 12.05.2009 23:26, orahi001 wrote: Hi, I have apache web server running on one box as a proxy server tomcat running on another box. The apache server connects to application server (tomcat) via proxy passthru parameter. The server running tomcat was recently rebooted. When it came back up I started tomcat but I can no longer connect to my web application over http. I'm getting a proxy error in my browser window: error reading from the remote server. The apache log shows the same message. On the server running tomcat, netstat -a shows the port running tomcat changes to a state of close_wait. however, if I telnet to the port (8980) from the server running apache I can connect and the port shows a state of established. Any ideas as to why I can no longer reach my web application? Whats causing this close_wait state? CLOSE_WAIT is when the remote side of a connection closed it. It seems your proxy tries to reuse an existing connection tha doesn't work any more. So have a look at how to configure the proxy connection pools, using timeouts etc. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Hi Rainer, thanks for the reply, I don't understand how the proxy connection would have changed. Nothing has changed in the config files. I added the following in the httpd config file and also increased the timeout in the tomcat config file. SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 Still seeing the same results -- View this message in context: http://www.nabble.com/tomcat-close_wait-state-and-proxy-error-when-connecting-to-my-web-application-tp23510873p23523302.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: Preventing OutOfMemoryError: Java heap space
From: André Warnier [mailto:a...@ice-sa.com] Thanks, Chuck and Peter, for the clarifications on OOM. I believe that unconsciously, with my large object reservation theory, I was vaguely remembering something I had read some time in the past. So I searched Google for java +parachute +memory and this is something I found : http://mail-archives.apache.org/mod_mbox/tomcat-dev/200703.mbo x/%3c20070325171940.34dae1a9...@eris.apache.org%3e Does this have any bearing on the OP's issue ? It is past me capacities to see if it is relevant or not (I don't mean the above post per se, but the idea). Nice. The idea's relevant... as long as you realise that all it's doing is defending a very few critical areas of Tomcat's code against some (not all) OOMEs. Another thread could allocate heap memory between lines in this code, leading to unexpected failures because the memory freed by the parachute has been used elsewhere; and it doesn't defend all areas of Tomcat's code (I think - Filip will no doubt correct me). It's a great way of helping to make sure that, most of the time, it's at least possible to log an OOME - assuming the application passes it up the stack, which most will. It's not a general solution without a lot more work; each webapp would have to do something similar at each point that it might allocate heap memory. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat not closing threads
I guess I need to ask my question again. Im primarily an HP-UX administrator and recently inherited this web based application ... We are having some issues in accomodating additional user load/functionality. While a part of the team is looking at optimizing code, I am responsible for infrastructure componants. One particular focus area for me is the mod_jk and tomcat configurations. 1. Last of April saw one of the tomcat's stop processing requests. Looking at the mod_jk.log I saw the following errors Unable to get the free endpoint for worker XXX from 37 slots I have setup the status servlet for mod_jk in which I saw that max slots were opened. Thinking that mod_jk needs more number of connections, I basically set it to ThreadsPerChild from worker MPM 2. Now we are randomly seeing that even a simple activity as user login causes a spike in used tomcat connector threads. Eventually all tomcat threads are used and no new requests can be serviced. So, long story short, is my apache, mod_jk and tomcat configuration in sync? Maxclients = 512 ThreadsPerChild = 256 So that means 2 server processes with 256 threads each. I have 2 worker threads in my worker.properties file with connection_pool_size=256. Does this mean that total number of connections into tomcat = 256 * 2(number of workers) * 2(number of server procs) = 1024 ?? Do I need to change the connection_pool_size to 120 . Which means 120*2 *2 = 480 and that leaves the remainder of apache threads for static content? 3. I have worker.XXX.cache_timeout=900 and no connectionTimeout in server.xml . Is this why connections remain open? Thanks, Chetan From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, May 12, 2009 10:47:00 PM Subject: RE: Tomcat not closing threads From: Chetan Chheda [mailto:chetan_chh...@yahoo.com] Subject: Re: Tomcat not closing threads I managed to get a thread dump during one such tomcat hangs. Most of the threads are in the following status ... The ones you show are simply waiting for input from httpd; that's a pretty normal state. When looking at a thread dump, it's often the oddball thread that's not doing what the rest are that is causing a problem. However, if all of the threads are just waiting to receive something from httpd, then you may have to look outside of Tomcat for the cause. - 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
Different resources for different user roles
Hi All, I have a web application that communicate with a DB2 Database. There are multiple users that need to authenitcate them before using the application. Each user has just a role and the are 3 roles. I need to access to a DB2 database using those 3 different roles in order to limite the access to some tables' rows. So i tried to use the PerUserPerUserPoolDataSource in order to use the method getConnection(user,pass) not provided in the BasicDataSource but i got some problem. So i decided to define 3 Resource element in the context.xml (one for each role) and when i need to create a specific datasource based on the role i use cxt.lookup( jdbc/ + roleName ) I have 2 question: 1) Do you think it is a good solution 2) It is better have a DAO object with a list of datasource or a list of DAO objects (one for each DataSource) Thanks in advance, Claudio -- View this message in context: http://www.nabble.com/Different-resources-for-different-user-roles-tp23525487p23525487.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
General errors in virtual host setup
A few days ago, a number of you helped me get tomcat up and running with the example files shipped with the default install of tomcat. Just as a reminder, I am on CentOS 5.4/64 bit system using jdk1.6.1_13, apache tomcat 6.0.18. I was going through this exercise because I was given a tomcat based site to host for the next while. Having never dealt with tomcat before, with the help of a few members of this list, I managed to get tomcat running. So then I came to the task of getting this site going. So, here is what I did an I hope if anyone sees anything off base (likely) they will point it out to me. First I created a war file of the site pages using java -cvf exodus.war * I then put the war file inside my webapps directory at /usr/opt/tomcat/webapps/ (this is the same directory for my default host) I then restarted tomcat and it expanded the war file to create a directory under webapps called exodus In this new directory, there is a WEB-INF directory and a META-INF directory. I edited the web.xml file from inside WEB-INF to reflect the current server environment, which included the following: context-param param-nameroot/param-name !-- param-value/opt/tomcat/webapps/exodus/param-value -- param-value/usr/opt/tomcat/webapps/exodus/param-value description Path to where the system begins /description /context-param context-param param-namexmlprops/param-name !-- param-value/opt/tomcat/webapps/exodus/WEB-INF/conf/environment.xml/param-v alue -- param-value/usr/opt/tomcat/webapps/exodus/WEB-INF/conf/environment.xml/par am-value description Used to find path to local XML props file. /description /context-param This reflected the paths in the new server. Inside WEB-INF, there is also a conf directory which holds an environment.xml file. This too I edited to reflect the current server environment, which included: paths loginJSP/login.jsp/loginJSP parentControlJSP/parentControl.jsp/parentControlJSP baseRoot/usr/opt/tomcat/webapps/exodus/baseRoot dataRoot/data/dataRoot instanceFile/instanceFile systemLogFolder/usr/opt/tomcat/webapps/exodus/WEB-INF/logs//systemLogFo lder systemArchiveFolder/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/archive/ /systemArchiveFolder logFile/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/codelog.txt/logFile cronLog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/scheduler.txt/cronLo g broadcastLog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/broadcast.txt/b roadcastLog memoryLog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/memory.txt/memoryL og securityLog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/security.txt/sec urityLog ipmanifestlog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/ipmanifest.txt /ipmanifestlog forumArchiveLog/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/forum.txt/fo rumArchiveLog /paths (Sorry if the above was not necessary to send but wanted to be thorough). My server.xml file was edited to look like this: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListen er / !-- Listener className=org.apache.ajp.tomcat.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so / -- !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=exodus.zuka.net appBase=webapps/exodus unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Realm className=org.apache.catalina.realm.UserDatabaseRealm
Re: General errors in virtual host setup
Trying to provide some limited help peppered across your message.. Dave Filchak wrote: A few days ago, a number of you helped me get tomcat up and running with the example files shipped with the default install of tomcat. Just as a reminder, I am on CentOS 5.4/64 bit system using jdk1.6.1_13, apache tomcat 6.0.18. I was going through this exercise because I was given a tomcat based site to host for the next while. Having never dealt with tomcat before, with the help of a few members of this list, I managed to get tomcat running. So then I came to the task of getting this site going. So, here is what I did an I hope if anyone sees anything off base (likely) they will point it out to me. First I created a war file of the site pages using java -cvf exodus.war * That was more likely jar -cvf exodus.war *, right ? I then put the war file inside my webapps directory at /usr/opt/tomcat/webapps/ (this is the same directory for my default host) Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? I then restarted tomcat and it expanded the war file to create a directory under webapps called exodus In this new directory, there is a WEB-INF directory and a META-INF directory. That looks ok so far. I edited the web.xml file from inside WEB-INF to reflect the current server environment, which included the following: context-param param-nameroot/param-name .. etc.. that unfortunately is a part we cannot help you with, probably. It is a series of parameters specific to that exodus application which probably nobody here knows. That comment extends all the way to ... /paths (Sorry if the above was not necessary to send but wanted to be thorough). My server.xml file was edited to look like this: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListen er / !-- Listener className=org.apache.ajp.tomcat.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so / -- !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Note that, apparently, you only have an AJP connector listening on port 8009. You do not have one for port 8010. Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=exodus.zuka.net appBase=webapps/exodus unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host So, are we to think that this server is known in DNS by the name exodus.zuka.net ? Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Engine /Service /Server With this, I am wondering if I have the exodus directory in the right place as it crosses into the default host space. My workers.properties file now looks like: worker.list=rosewood,exodus # # Defining a worker named ajp13w and of type ajp13 # Note that the name and the type do not have to match. # worker.rosewood.type=ajp13 worker.rosewood.host=localhost worker.rosewood.port=8009 worker.exodus.type=ajp13 worker.exodus.host=exodus.zuka.net Here you should better say, also, worker.exodus.host=localhost worker.exodus.port=8010 That is why I am surprised that there is no Connector for port 8010 in your server.xml. If we are talking all about the same single host, then you need to add it. Just copy the one for 8009 and change the port number. Otherwise, the worker exodus won't be able to connect to Tomcat. (In fact, if this is all on the same system, I think you can simplify this
Re: [OT] Performance with many small requests
On 13-May-2009, at 09:16, David kerber wrote: Christopher Schultz wrote: ... Since a String object is immutable, one should always use a StringBuffer (preferably a StringBuilder, these days) when you are constructing strings in a piecemeal fashion, then convert to String when complete. This advice is good when constructing a long string in a loop or across a long series of statements. If you are just concatenating a bunch of string together to make a big one in a single statement, go ahead and use the + operator: the compiler is smart enough to convert the entire thing into a StringBuilder (a non-synchronized replacement for StringBuffer) expression that gets good performance without making your code look like crap. I was wondering about that. It certainly seemed like a good place for a smart compiler to fix things up, but didn't know if it actually did or not. I don't do a lot of that, but enough of it that it becomes a style issue. If in doubt write a small test case and repeat it for a period of time and see which one had the most completions. The one with the most completions is likely to be the most optimal. André-John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
André Warnier wrote: Trying to provide some limited help peppered across your message.. snip First I created a war file of the site pages using java -cvf exodus.war * That was more likely jar -cvf exodus.war *, right ? Errr ... yes correct. I then put the war file inside my webapps directory at /usr/opt/tomcat/webapps/ (this is the same directory for my default host) Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? Correct. I then restarted tomcat and it expanded the war file to create a directory under webapps called exodus In this new directory, there is a WEB-INF directory and a META-INF directory. That looks ok so far. I edited the web.xml file from inside WEB-INF to reflect the current server environment, which included the following: context-param param-nameroot/param-name .. etc.. that unfortunately is a part we cannot help you with, probably. It is a series of parameters specific to that exodus application which probably nobody here knows. That comment extends all the way to ... /paths (Sorry if the above was not necessary to send but wanted to be thorough). Yes well I do not know that much about this app either and truthfully, once I had tomcat set up I was expecting the developer to do this but you know how these things go. My server.xml file was edited to look like this: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListen er / !-- Listener className=org.apache.ajp.tomcat.config.ApacheConfig modJk=/usr/local/apache2/modules/mod_jk.so / -- !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Note that, apparently, you only have an AJP connector listening on port 8009. You do not have one for port 8010. Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=exodus.zuka.net appBase=webapps/exodus unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host So, are we to think that this server is known in DNS by the name exodus.zuka.net ? Yes ... for now. Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Engine /Service /Server With this, I am wondering if I have the exodus directory in the right place as it crosses into the default host space. My workers.properties file now looks like: worker.list=rosewood,exodus # # Defining a worker named ajp13w and of type ajp13 # Note that the name and the type do not have to match. # worker.rosewood.type=ajp13 worker.rosewood.host=localhost worker.rosewood.port=8009 worker.exodus.type=ajp13 worker.exodus.host=exodus.zuka.net Here you should better say, also, worker.exodus.host=localhost worker.exodus.port=8010 That is why I am surprised that there is no Connector for port 8010 in your server.xml. If we are talking all about the same single host, then you need to add it. Just copy the one for 8009 and change the port number. Otherwise, the worker exodus won't be able to connect to Tomcat. (In fact, if this is all on the same system, I think you can simplify this configuration, but let's first try and make this one work). Again, this is all for now, but there will be more so I would like to prepare for this now, rather than later. I have changes the line to worker.exodus.host=localhost I have then modified the apache conf and added: JkMount /exodus/* exodus JkUnMount /images/* exodus snip Note however that /images/*
Re: General errors in virtual host setup
Something doesn't square : this : Dave Filchak wrote: Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? Correct. and this : Starting Razuna Tomcat: Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/opt/jdk1.6.0_13 done. So, where that /usr/opt/tomcat coming from ? Where /is/ tomcat installed ? starting at /usr/opt/tomcat, or at /opt/tomcat ? or are these two symlinked somehow ? And what is this ? May 13, 2009 3:02:39 PM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) etc.. What is this Tomcat trying to connect to ? Speparately : According to your server.xml file, this Tomcat has a Connector set up for port 8080, through which you could access it directly. So, what happens when you point your browser at http://exodus.zuka.net:8080/exodus and at http://exodus.zuka.net:8080/exodus/something.html (replace something.html by the name of a html document that is really in your webapps/exodus/ directory) and at : http://exodus.zuka.net:8080/exodus/images/someimage.gif (replace by an image that exists there) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
André Warnier wrote: Something doesn't square : this : Dave Filchak wrote: Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? Correct. and this : Starting Razuna Tomcat: Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/opt/jdk1.6.0_13 done. So, where that /usr/opt/tomcat coming from ? Where /is/ tomcat installed ? starting at /usr/opt/tomcat, or at /opt/tomcat ? or are these two symlinked somehow ? Yes .. the actual path is /usr/opt/tomcat but the is a symlink on the root which makes it /opt/tomcat And what is this ? May 13, 2009 3:02:39 PM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) etc.. What is this Tomcat trying to connect to ? I do not know. This only started after I added this second domain. Speparately : According to your server.xml file, this Tomcat has a Connector set up for port 8080, through which you could access it directly. So, what happens when you point your browser at http://exodus.zuka.net:8080/exodus This times out and at http://exodus.zuka.net:8080/exodus/something.html (replace something.html by the name of a html document that is really in your webapps/exodus/ directory) This times out as well and at : http://exodus.zuka.net:8080/exodus/images/someimage.gif (replace by an image that exists there) as does this. Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
Dave Filchak wrote: André Warnier wrote: Something doesn't square : this : Dave Filchak wrote: Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? Correct. and this : Starting Razuna Tomcat: Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/opt/jdk1.6.0_13 done. So, where that /usr/opt/tomcat coming from ? Where /is/ tomcat installed ? starting at /usr/opt/tomcat, or at /opt/tomcat ? or are these two symlinked somehow ? Yes .. the actual path is /usr/opt/tomcat but the is a symlink on the root which makes it /opt/tomcat And what is this ? May 13, 2009 3:02:39 PM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) etc.. What is this Tomcat trying to connect to ? I do not know. This only started after I added this second domain. Speparately : According to your server.xml file, this Tomcat has a Connector set up for port 8080, through which you could access it directly. So, what happens when you point your browser at http://exodus.zuka.net:8080/exodus This times out and at http://exodus.zuka.net:8080/exodus/something.html (replace something.html by the name of a html document that is really in your webapps/exodus/ directory) This times out as well and at : http://exodus.zuka.net:8080/exodus/images/someimage.gif (replace by an image that exists there) as does this. Allright. There is something really strange going on. Can you, from some command window it does not matter where, do nslookup exodus.zuka.net and check if the IP address that comes as a response is really this same host we are talking about ? (you can check the current host's IP addresses with ifconfig -a ) Then, just for completion, start Tomcat and then do netstat -an | grep LISTEN and paste the output here - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: General errors in virtual host setup
From: Dave Filchak [mailto:sub...@zuka.net] Subject: General errors in virtual host setup This reflected the paths in the new server. It's generally bad form for a webapp to know where it's deployed, indicating some degree of laziness or ignorance on the part of the webapp developer. However, you're probably stuck with it. baseRoot/usr/opt/tomcat/webapps/exodus/baseRoot Don't know what exodus expects here; a file system path, or a URL path? The former would be unusual. You'll need to consult whatever doc you have for exodus to verify correctness. systemLogFolder/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/ /systemLogFolder It's really, really bad form to write into the webapps directory; you need to move the logging area to somewhere else. With this, I am wondering if I have the exodus directory in the right place as it crosses into the default host space. Yes, that's a problem; the two should not overlap. Do you really need two Host elements? (I suspect not.) Regardless, setting appBase to webapps/exodus cannot be correct. 1) Do you expect to be hosting more domains in the future? 2) Do you want the exodus webapp to be the default webapp for exodus.zuka.net? 3) Do you need the existing Tomcat webapps to be available under exodus.zuka.net (or available at all)? Your setup will vary depending on the answers to the above. - 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: General errors in virtual host setup
André Warnier wrote: Dave Filchak wrote: André Warnier wrote: Something doesn't square : this : Dave Filchak wrote: Ok, so we assume your tomcat's CATALINA_HOME and CATALINA_BASE are both /usr/opt/tomcat, and below that you have directories like - bin - conf - webapps - logs right ? Correct. and this : Starting Razuna Tomcat: Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/opt/jdk1.6.0_13 done. So, where that /usr/opt/tomcat coming from ? Where /is/ tomcat installed ? starting at /usr/opt/tomcat, or at /opt/tomcat ? or are these two symlinked somehow ? Yes .. the actual path is /usr/opt/tomcat but the is a symlink on the root which makes it /opt/tomcat And what is this ? May 13, 2009 3:02:39 PM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) etc.. What is this Tomcat trying to connect to ? I do not know. This only started after I added this second domain. Speparately : According to your server.xml file, this Tomcat has a Connector set up for port 8080, through which you could access it directly. So, what happens when you point your browser at http://exodus.zuka.net:8080/exodus This times out and at http://exodus.zuka.net:8080/exodus/something.html (replace something.html by the name of a html document that is really in your webapps/exodus/ directory) This times out as well and at : http://exodus.zuka.net:8080/exodus/images/someimage.gif (replace by an image that exists there) as does this. Allright. There is something really strange going on. Can you, from some command window it does not matter where, do nslookup exodus.zuka.net and check if the IP address that comes as a response is really this same host we are talking about ? Is correct yes. (you can check the current host's IP addresses with ifconfig -a ) This is also correct. Then, just for completion, start Tomcat and then do netstat -an | grep LISTEN and paste the output here netstat -an | grep LISTEN tcp0 0 0.0.0.0:32768 0.0.0.0:* LISTEN tcp0 0 127.0.0.1:11553 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:993 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:2401 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:995 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:199 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:425 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp0 0 127.0.0.1:3310 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:110 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:143 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp0 0 66.207.212.58:80 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:465 0.0.0.0:* LISTEN tcp0 0 66.207.212.58:53 0.0.0.0:* LISTEN tcp0 0 127.0.0.1:53 0.0.0.0:* LISTEN tcp0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:25 0.0.0.0:* LISTEN tcp0 0 127.0.0.1:953 0.0.0.0:* LISTEN tcp0 0 0.0.0.0:443 0.0.0.0:* LISTEN tcp0 0 :::8009 :::*LISTEN tcp0 0 :::127.0.0.1:5005 :::*LISTEN tcp0 0 :::1935 :::*LISTEN tcp0 0 :::8080 :::*LISTEN tcp0 0 :::1936 :::*LISTEN tcp0 0 :::21 :::*LISTEN tcp0 0 :::22 :::*LISTEN tcp0 0 :::66.207.212.58:5080 :::*LISTEN tcp0 0 :::8088 :::*LISTEN unix 2 [ ACC ] STREAM LISTENING 6567 /usr/local/var/run/dovecot/auth-worker.3050 unix 2 [ ACC ] STREAM LISTENING 6561
Re: General errors in virtual host setup
Caldarale, Charles R wrote: From: Dave Filchak [mailto:sub...@zuka.net] Subject: General errors in virtual host setup This reflected the paths in the new server. It's generally bad form for a webapp to know where it's deployed, indicating some degree of laziness or ignorance on the part of the webapp developer. However, you're probably stuck with it. baseRoot/usr/opt/tomcat/webapps/exodus/baseRoot I think so ... yes. Don't know what exodus expects here; a file system path, or a URL path? The former would be unusual. You'll need to consult whatever doc you have for exodus to verify correctness. If I had real documentation ... that would be good but I really do not. At least from a back-end point of view. systemLogFolder/usr/opt/tomcat/webapps/exodus/WEB-INF/logs/ /systemLogFolder It's really, really bad form to write into the webapps directory; you need to move the logging area to somewhere else. Can I simply change the path? With this, I am wondering if I have the exodus directory in the right place as it crosses into the default host space. Yes, that's a problem; the two should not overlap. Do you really need two Host elements? (I suspect not.) Regardless, setting appBase to webapps/exodus cannot be correct. 1) Do you expect to be hosting more domains in the future? It is probable. 2) Do you want the exodus webapp to be the default webapp for exodus.zuka.net? It will be the default app but the way the domain is now will be changed. Right now, this is just a staging site. 3) Do you need the existing Tomcat webapps to be available under exodus.zuka.net (or available at all)? At this point, to the best of my knowledge, I will only need the exodus app available under exodus.zuka.net (as well as under the proper domain name when we are ready). The apps that are available currently (if it was working) are simply the example apps that come with the install of Tomcat. These, after all is said and done do not need to be available except for perhaps the manager app. Your setup will vary depending on the answers to the above. Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
Dave Filchak wrote: netstat -an | grep LISTEN tcp0 0 66.207.212.58:800.0.0.0:* LISTEN Apache, listening on just one IP address ? tcp0 0 :::8009 :::* LISTEN Ok, that seems to be the first AJP connector tcp0 0 :::8080 :::* LISTEN The Tomcat HTTP connector .. tcp0 0 :::8088 :::* LISTEN What is that one ? No 8010 port listen? Indeed, strange. There is also port 8005 missing, which should be the Tomcat shutdown connector. Server port=8005 shutdown=SHUTDOWN Where is it ? Are we really talking about the same host and same Tomcat here ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
By the way, the missing 8005 listening port probably explains this previous exception : May 13, 2009 3:02:39 PM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) I believe that the way Tomcat gets stopped, is by connecting to its own port 8005 and sending the magic command. I'm almost tempted to say : scratch this Tomcat, re-install it fresh with just the examples, let's make sure it works and opens all ports it should, test an example app, and then let's re-add the exodus app carefully and in the right place. And then check if that one works through port 8080, and then let's configure the mod_jk bit. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
André Warnier wrote: Dave Filchak wrote: netstat -an | grep LISTEN tcp0 0 66.207.212.58:800.0.0.0:* LISTEN Apache, listening on just one IP address ? tcp0 0 :::8009 :::* LISTEN Ok, that seems to be the first AJP connector tcp0 0 :::8080 :::* LISTEN The Tomcat HTTP connector .. tcp0 0 :::8088 :::* LISTEN What is that one ? If you are referring to the port 8088, we have a Flash media app running on this server using Red5 and believe it uses this port. No 8010 port listen? Indeed, strange. There is also port 8005 missing, which should be the Tomcat shutdown connector. Server port=8005 shutdown=SHUTDOWN Where is it ? I see it here: tcp0 0 :::127.0.0.1:5005 :::*LISTEN Are we really talking about the same host and same Tomcat here ? Absolutely. - 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: General errors in virtual host setup
Dave Filchak wrote: When I ran the url and said that it timed out ... what it actually eventually popped up was: Bad Gateway The proxy server received an invalid response from an upstream server. Maybe this gives us a hint? To me, it just makes it even more confusing. ;-) Please confirm, that you really added the port :8080 in the URL when you did those tests. Nevertheless, we're still missing a couple of listening ports here.. That is nowhere close to normal. You should have : - port 8005 (the Tomcat shurdown port) - port 8080 (Tomcat's HTTP connector) - port 8009 (first configured AJP connector) - port 8010 (second configured AJP connector) 8005 and 8010 aren't there in the netstat, so where are they ? Is the Tomcat log saying anything about these ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Preventing OutOfMemoryError: Java heap space
Dear Todd, I'm not sure I can use session counting, as my session size is not consistent. I could try to estimate the size of each session, and keep a global counter, but that seems like a lot of work. JMX offers quite a bit of insight in what your GC is doing. You could implement throttling as a function of the number of full GC's that your system experiences. While full GC's do happen from time to time, you could trigger if they happen more than once per so-many seconds. Actual values would probably be highly application-specific. I agree with someone else that 256MB is not a whole lot or RAM for a busy server. With current prices of RAM I would go for a gig or two and take it from there. I understand that garbage collection is, err, whimsical, but I think I'm going to give it a go anyway. I will keep in mind that the memory results from Runtime will probably under-report the available memory. I'm going to add an explicit request for garbage collection, _before_ the memory becomes seriously depleted. Here is what happens if you do http://java-monitor.com/forum/showthread.php?t=188 It is not pretty, I can tell you that. I add -XX:-DisableExplicitGC to my JAVA_OPTS for this very reason. -- Kees Jan http://java-monitor.com/forum/ kjkos...@kjkoster.org 06-51838192 The secret of success lies in the stability of the goal. -- Benjamin Disraeli - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
snip Indeed, strange. There is also port 8005 missing, which should be the Tomcat shutdown connector. Server port=8005 shutdown=SHUTDOWN Where is it ? I see it here: Sorry ... ignore this comment. At one point in the past we had changed this port as part of an attempt at better security. I just did not read close enough tcp0 0 :::127.0.0.1:5005 :::*LISTEN snip - 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: General errors in virtual host setup
When I ran the url and said that it timed out ... what it actually eventually popped up was: Bad Gateway The proxy server received an invalid response from an upstream server. Maybe this gives us a hint? Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
Dave Filchak wrote: André Warnier wrote: Dave Filchak wrote: netstat -an | grep LISTEN tcp0 0 66.207.212.58:800.0.0.0:* LISTEN Apache, listening on just one IP address ? tcp0 0 :::8009 :::* LISTEN Ok, that seems to be the first AJP connector tcp0 0 :::8080 :::* LISTEN The Tomcat HTTP connector .. tcp0 0 :::8088 :::* LISTEN What is that one ? If you are referring to the port 8088, we have a Flash media app running on this server using Red5 and believe it uses this port. No 8010 port listen? Indeed, strange. There is also port 8005 missing, which should be the Tomcat shutdown connector. Server port=8005 shutdown=SHUTDOWN Where is it ? I see it here: tcp0 0 :::127.0.0.1:5005 :::*LISTEN Nope. That's 5005, not 8005 as per your server.xml. Are we really talking about the same host and same Tomcat here ? Absolutely. - 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
Running out of tomcat threads - why many threads in RUNNABLE stage even with no activity
My setup is tomcat 5.5.17 + mod_jk 1.2.15 + httpd 2.2.2. I am using AJP1.3. Every 2-3 days with no major load, tomcat throws the error: SEVERE: All threads (200) are currently busy, waiting... I have been monitoring my tomcat TP-Processor thread behavior over extended time intervals and observe that: - even when there is no activity on the server, several TP-Processor threads are in RUNNABLE state while few are in WAITING state - RUNNABLE threads stack trace shows java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method)... - WAITING thread stack trace shows java.lang.Thread.State: WAITING on org.apache.tomcat.util.threads.threadpool$controlrunna...@53533c55 - tomcat adds 4 new TP-Processor threads when a request comes in and it can find no WAITING threads So I conclude that my tomcat is running out of threads due to many threads being in RUNNABLE state when actually they should be in WAITING state. Is that happening because of the socket_keepalive in my workers.properties shown below? Why are threads added in bunches of 4 - is there any way to configure this? My workers config is: Worker...type=ajp13 Worker...cachesize=10 Worker...cache_timeout=600 Worker...socket_keepalive=1 Worker...recycle_timeout=300 Earlier posts related to this issue on the list seem to recommend tweaking: - several timeouts - JkOptions +DisableReuse I am planning to do the following to resolve our problem: - upgrade jk to latest version - e.g. 1.2.28 - replace recycle_timeout with connection_pool_timeout - add connectionTimeout in server.xml - add JkOptions +DisableReuse Please let me know if this is okay or suggestions if any. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Page not completing loading - ideas?
Hi, We recently encountered an issue on one of our integration machines, where a fews pages will not finish loading (actually it will, but only after around 4 minutes), and this is not even a large page. The same tomcat and web application work fine on the local development workstation and pre-integration server. Because the integration machine is managed by the customer, we aren't allowed to make any modifications to tomcat or the webapp without their consent (which is not always easy politically). For this reason we need to be able work out what could be causing the issue. Does anyone have any ideas of how to go about analysing the issue? We are using Linux, Tomcat 5.5.27 and JDK 1.6. The pages are rendered using XSL (I suspect this issue might be here, but nothing in the logs help). André-John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
André Warnier wrote: Dave Filchak wrote: When I ran the url and said that it timed out ... what it actually eventually popped up was: Bad Gateway The proxy server received an invalid response from an upstream server. Maybe this gives us a hint? To me, it just makes it even more confusing. ;-) Please confirm, that you really added the port :8080 in the URL when you did those tests. Sorry for the delay. Had to step away for a bit. yes I did at the port during the test. Nevertheless, we're still missing a couple of listening ports here.. That is nowhere close to normal. You should have : - port 8005 (the Tomcat shurdown port) - port 8080 (Tomcat's HTTP connector) - port 8009 (first configured AJP connector) - port 8010 (second configured AJP connector) 8005 and 8010 aren't there in the netstat, so where are they ? Is the Tomcat log saying anything about these ? Well this: SEVERE: Catalina.start LifecycleException: Protocol handler initialization failed: java.net.BindExc eption: Address already in usenull:8080 Does each host or app need to be on a different port as well? Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: General errors in virtual host setup
Caldarale, Charles R wrote: snip O.k., then leave the extra Host element there. However, redefine its appBase to be somewhere else; it doesn't have to be under the Tomcat directory tree, and it *must not* be under any other Host appBase. 2) Do you want the exodus webapp to be the default webapp for exodus.zuka.net? It will be the default app but the way the domain is now will be changed. Right now, this is just a staging site. Regardless, you might as well get it right from the beginning. Whatever location you choose for the exodus.zuka.net Host appBase, place the exodus app in a directory named ROOT (case sensitive) underneath that, rather than a directory named exodus. OK .. I have moved it into our web directory at /web/exodus.zuka.net/docs/ROOT/ snip Do you have a Context element for the exodus app? If so, please post it (or provide a pointer if you already did and I missed it). Humm ... I have found this in the WEB-INF folder: context-param param-namexmlprops/param-name !-- param-value/opt/tomcat/webapps/exodus/WEB-INF/conf/environment.xml/para m-value -- param-value/usr/opt/tomcat/webapps/exodus/WEB-INF/conf/environment.xml/ param-value description Used to find path to local XML props file. /description /context-param I do not see a context.xml file anywhere. They used to be kept in the server.xml file ... did they not? Dave
Re: Tomcat not closing threads
Chetan, We had similar issue with Sun solaris and weblogic. My system admin found out there is a socket read errors are going on . He used snoop command in solaris. After tuning the TCP parameters the issue got resolved. You might also need to something like that. Thanks Krish On Wed, May 13, 2009 at 11:57 AM, Chetan Chheda chetan_chh...@yahoo.comwrote: I guess I need to ask my question again. Im primarily an HP-UX administrator and recently inherited this web based application ... We are having some issues in accomodating additional user load/functionality. While a part of the team is looking at optimizing code, I am responsible for infrastructure componants. One particular focus area for me is the mod_jk and tomcat configurations. 1. Last of April saw one of the tomcat's stop processing requests. Looking at the mod_jk.log I saw the following errors Unable to get the free endpoint for worker XXX from 37 slots I have setup the status servlet for mod_jk in which I saw that max slots were opened. Thinking that mod_jk needs more number of connections, I basically set it to ThreadsPerChild from worker MPM 2. Now we are randomly seeing that even a simple activity as user login causes a spike in used tomcat connector threads. Eventually all tomcat threads are used and no new requests can be serviced. So, long story short, is my apache, mod_jk and tomcat configuration in sync? Maxclients = 512 ThreadsPerChild = 256 So that means 2 server processes with 256 threads each. I have 2 worker threads in my worker.properties file with connection_pool_size=256. Does this mean that total number of connections into tomcat = 256 * 2(number of workers) * 2(number of server procs) = 1024 ?? Do I need to change the connection_pool_size to 120 . Which means 120*2 *2 = 480 and that leaves the remainder of apache threads for static content? 3. I have worker.XXX.cache_timeout=900 and no connectionTimeout in server.xml . Is this why connections remain open? Thanks, Chetan From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, May 12, 2009 10:47:00 PM Subject: RE: Tomcat not closing threads From: Chetan Chheda [mailto:chetan_chh...@yahoo.com] Subject: Re: Tomcat not closing threads I managed to get a thread dump during one such tomcat hangs. Most of the threads are in the following status ... The ones you show are simply waiting for input from httpd; that's a pretty normal state. When looking at a thread dump, it's often the oddball thread that's not doing what the rest are that is causing a problem. However, if all of the threads are just waiting to receive something from httpd, then you may have to look outside of Tomcat for the cause. - 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: General errors in virtual host setup
André Warnier wrote: Dave Filchak wrote: When I ran the url and said that it timed out ... what it actually eventually popped up was: Bad Gateway The proxy server received an invalid response from an upstream server. Maybe this gives us a hint? To me, it just makes it even more confusing. ;-) Please confirm, that you really added the port :8080 in the URL when you did those tests. Nevertheless, we're still missing a couple of listening ports here.. That is nowhere close to normal. You should have : - port 8005 (the Tomcat shurdown port) - port 8080 (Tomcat's HTTP connector) - port 8009 (first configured AJP connector) - port 8010 (second configured AJP connector) 8005 and 8010 aren't there in the netstat, so where are they ? Is the Tomcat log saying anything about these ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org No chance that these missing ports are caused by the firewall? These are all internal ... yes? Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: General errors in virtual host setup
From: Dave Filchak [mailto:sub...@zuka.net] Subject: Re: General errors in virtual host setup OK .. I have moved it into our web directory at /web/exodus.zuka.net/docs/ROOT/ And what did you set the exodus.zuka.net Host appBase to? It should be /web/exodus.zuka.net/docs. Humm ... I have found this in the WEB-INF folder: No, a Context element would be in the webapp's META-INF/context.xml file, if it exists. You need a Context element primarily if the webapp uses database connections that you want Tomcat to manage. (There are other more esoteric reasons, of course.) I do not see a context.xml file anywhere. They used to be kept in the server.xml file ... did they not? In old versions of Tomcat, Context elements had to be in server.xml; one of the improvements made a few years ago was to move Context elements to the webapp (or alternatively, to conf/Catalina/[host]/[appName].xml). - 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: General errors in virtual host setup
Caldarale, Charles R wrote: From: Dave Filchak [mailto:sub...@zuka.net] Subject: Re: General errors in virtual host setup OK .. I have moved it into our web directory at /web/exodus.zuka.net/docs/ROOT/ And what did you set the exodus.zuka.net Host appBase to? It should be /web/exodus.zuka.net/docs. That is correct. Humm ... I have found this in the WEB-INF folder: No, a Context element would be in the webapp's META-INF/context.xml file, if it exists. You need a Context element primarily if the webapp uses database connections that you want Tomcat to manage. (There are other more esoteric reasons, of course.) Well the exodus app does use a database but the connection stuff is in an environment.xml file. snip Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: General errors in virtual host setup
From: Dave Filchak [mailto:sub...@zuka.net] Subject: Re: General errors in virtual host setup SEVERE: Catalina.start LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in usenull:8080 This looks like you already have a Tomcat instance running, using a default Tomcat config. This will prevent your desired Tomcat from ever starting. The -o option on netstat will show the PID associated with the port, and you should be able to use that to find out where that process is running from. Does each host or app need to be on a different port as well? No, the Connector elements apply to all Hosts within a Service/Engine pair. - 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: General errors in virtual host setup
From: Dave Filchak [mailto:sub...@zuka.net] Subject: Re: General errors in virtual host setup Well the exodus app does use a database but the connection stuff is in an environment.xml file. Then exodus must be managing its own connections. You likely do not need a Context element for that webapp. - 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: General errors in virtual host setup
From: Dave Filchak [mailto:sub...@zuka.net] Subject: Re: General errors in virtual host setup No chance that these missing ports are caused by the firewall? Not likely; they should still show up in netstat. These are all internal ... yes? No - only the shutdown port is internal (127.0.0.1); all the others are normally for 0.0.0.0, meaning they are active on all IP addresses configured for the system. - 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: Page not completing loading - ideas?
From: Andre-John Mas [mailto:andrejohn@gmail.com] Subject: Page not completing loading - ideas? Does anyone have any ideas of how to go about analysing the issue? I'd start with a Wireshark capture/trace on the client workstation to see exactly what's going on over the network. If you can get a Tomcat AccessLogValve trace from the integration server to correlate with it, that would help. - 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: General errors in virtual host setup
Dave Filchak wrote: André Warnier wrote: Dave Filchak wrote: When I ran the url and said that it timed out ... what it actually eventually popped up was: Bad Gateway The proxy server received an invalid response from an upstream server. Maybe this gives us a hint? To me, it just makes it even more confusing. ;-) Please confirm, that you really added the port :8080 in the URL when you did those tests. Sorry for the delay. Had to step away for a bit. yes I did at the port during the test. Nevertheless, we're still missing a couple of listening ports here.. That is nowhere close to normal. You should have : - port 8005 (the Tomcat shurdown port) - port 8080 (Tomcat's HTTP connector) - port 8009 (first configured AJP connector) - port 8010 (second configured AJP connector) 8005 and 8010 aren't there in the netstat, so where are they ? Is the Tomcat log saying anything about these ? Well this: SEVERE: Catalina.start LifecycleException: Protocol handler initialization failed: java.net.BindExc eption: Address already in usenull:8080 Does each host or app need to be on a different port as well? Dave When I run just a plain netstat, I get a ton of connections on port 8009 and 8080. I now have nothing working. Including the default stuff I had running two days ago. Grrrhh!!! Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Page not completing loading - ideas?
Andre can you display contents of $CATALINA_HOME/conf/web.xml localXsltFile globalXsltFile http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html Bon Chance, Martin Gainty __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. From: andrejohn@gmail.com To: users@tomcat.apache.org Subject: Page not completing loading - ideas? Date: Wed, 13 May 2009 19:01:14 -0400 Hi, We recently encountered an issue on one of our integration machines, where a fews pages will not finish loading (actually it will, but only after around 4 minutes), and this is not even a large page. The same tomcat and web application work fine on the local development workstation and pre-integration server. Because the integration machine is managed by the customer, we aren't allowed to make any modifications to tomcat or the webapp without their consent (which is not always easy politically). For this reason we need to be able work out what could be causing the issue. Does anyone have any ideas of how to go about analysing the issue? We are using Linux, Tomcat 5.5.27 and JDK 1.6. The pages are rendered using XSL (I suspect this issue might be here, but nothing in the logs help). André-John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
Re: General errors in virtual host setup
I am going to step away from this for about an hour to get a break and something to eat. Just a bit before I do: tomcat was installed as a service and when I restart the service, I get these errors. However, when I go to /opt/tomcat/bin/shutdown.sh and then startup.sh, I do not appear to get an error. Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connector for diameter protocol
kramasundar kramasun...@yahoo.com wrote in message news:23519306.p...@talk.nabble.com... Hi, I am trying to port our existing plain old java diameter ( http://en.wikipedia.org/wiki/Diameter_(protocol) Diameter wiki page ) server on top of tomcat. I am new to J2EE/Tomcat. Since Diameter is quite different from HTTP it is bit difficult to get started with doing things. As far as i have read, it seems that i need a protocol handler for Diameter protocol and feed it into tomcat. Could any one of you please direct me to some documents/references that describes how to develop custom protocol handlers for non HTTP protocols like Sip/Diameter/Radius. Such support as there is amounts to HTTP under Diameter ;) Well, there isn't much documentation outside of the JavaDocs and the code. Probably the place to start is http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/package-summary.html. You are correct that you need to create a ProtocolHandler. This classs is responsible for accepting requests, and passing them off to a Thread to handle them (more on that later). There are ThreadPool classes, and Executor support classes lying around that you might be able to use for the thread management (e.g. browse the org.apache.tomcat.util.net package to see if anything works for you). The Object in the thread then has to parse the request according to the protocol, and fill in a Request object (from org.apache.coyote), and initialize a Response object (same package). Look at the existing Connectors (especially MemoryConnector, which is the simplest) for how to do this. It then passes these off to the Adapter that Tomcat will pass to your ProtocolHandler. That will run it through your Servlet, and pump the data back to the client. You will possibly need InputBuffer and OutputBuffer implementations to do the protocol translation. I guess the last thing is that you enable it via Connector protocol=com.myfirm.mypackage.MyProtocolHandler ... / and any attributes in in ... will be passed to your ProtocolHandler JavaBean style. Thanks, Ramsundar -- View this message in context: http://www.nabble.com/Connector-for-diameter-protocol-tp23519306p23519306.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: General errors in virtual host setup
Dave Filchak wrote: I am going to step away from this for about an hour to get a break and something to eat. Just a bit before I do: tomcat was installed as a service and when I restart the service, I get these errors. However, when I go to /opt/tomcat/bin/shutdown.sh and then startup.sh, I do not appear to get an error. Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org OK .. back and have made SOME progress. I can now connect to my default site as long as I add the port into the url. However, I have changed the port to 8081 and the connector port to 8010. I did this because when I did a netstat -o, there were about 50 connections in a CLOSE_WAIT state to port 8009. Now, when I restart tomcat I do not get any errors. So, after fiddling with this, I can now properly connect to the default site and view the Tomcat homepage and then connect to the jsp and servlet examples and all seems fine. So now I moved on to the actual application. The site root is in /web/exodus.zuka.net/docs. I have added a ROOT directory to this. I have moved my exodus.war file into this ROOT directory. When I restart tomcat, the WAR file is not unpacked. I have verified the site by creating an index.htm file and then changing it to an index.jsp file and both work. Not sure why the WAR is not being unpacked and deployed. Here is what I currently have for a configuration: HTTPD ServerName exodus.zuka.net ServerAdmin webad...@zuka.net DocumentRoot /web/exodus.zuka.net/docs/ROOT/ Directory /web/exodus.zuka.net/docs/ Options none AllowOverride None Order allow,deny allow from all /Directory ErrorLog logs/exodus.errors ScriptAlias /cgi-bin/ /web/cgi/exodus.zuka.net CustomLog logs/exodus.access combined JkMount /* exodus JkUnMount /images/* exodus workers.properties worker.list=rosewood,exodus # # Defining a worker named ajp13w and of type ajp13 # Note that the name and the type do not have to match. # worker.rosewood.type=ajp13 worker.rosewood.host=localhost worker.rosewood.port=8010 worker.exodus.type=ajp13 worker.exodus.host=exodus.zuka.net worker.exodus.port=8011 Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngi ne=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/j asper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent .html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleLis tener / !-- Listener className=org.apache.ajp.tomcat.config.ApacheConfig modJk= /usr/local/apache2/modules/mod_jk.so / -- !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8081 protocol=HTTP/1.1 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 connectionTimeout=2 debug=0 redirectPort=8443 disableUploadTimeout=true / !-- Define an AJP 1.3 Connector on port 8011 -- Connector port=8011 protocol=AJP/1.3 redirectPort=8443 / !-- Define an AJP 1.3 Connector on port 8010 -- Connector port=8010 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=exodus.zuka.net appBase=/web/exodus.zuka.net/docs/ unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Engine /Service /Server See anything I have screwed up? Dave
Re: General errors in virtual host setup
Dave Filchak wrote: Dave Filchak wrote: I am going to step away from this for about an hour to get a break and something to eat. Just a bit before I do: tomcat was installed as a service and when I restart the service, I get these errors. However, when I go to /opt/tomcat/bin/shutdown.sh and then startup.sh, I do not appear to get an error. Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org OK .. back and have made SOME progress. I can now connect to my default site as long as I add the port into the url. However, I have changed the port to 8081 and the connector port to 8010. I did this because when I did a netstat -o, there were about 50 connections in a CLOSE_WAIT state to port 8009. Now, when I restart tomcat I do not get any errors. So, after fiddling with this, I can now properly connect to the default site and view the Tomcat homepage and then connect to the jsp and servlet examples and all seems fine. So now I moved on to the actual application. The site root is in /web/exodus.zuka.net/docs. I have added a ROOT directory to this. I have moved my exodus.war file into this ROOT directory. When I restart tomcat, the WAR file is not unpacked. I have verified the site by creating an index.htm file and then changing it to an index.jsp file and both work. Not sure why the WAR is not being unpacked and deployed. Here is what I currently have for a configuration: HTTPD ServerName exodus.zuka.net ServerAdmin webad...@zuka.net DocumentRoot /web/exodus.zuka.net/docs/ROOT/ Directory /web/exodus.zuka.net/docs/ Options none AllowOverride None Order allow,deny allow from all /Directory ErrorLog logs/exodus.errors ScriptAlias /cgi-bin/ /web/cgi/exodus.zuka.net CustomLog logs/exodus.access combined JkMount /* exodus JkUnMount /images/* exodus workers.properties worker.list=rosewood,exodus # # Defining a worker named ajp13w and of type ajp13 # Note that the name and the type do not have to match. # worker.rosewood.type=ajp13 worker.rosewood.host=localhost worker.rosewood.port=8010 worker.exodus.type=ajp13 worker.exodus.host=exodus.zuka.net worker.exodus.port=8011 Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngi ne=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/j asper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent .html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleLis tener / !-- Listener className=org.apache.ajp.tomcat.config.ApacheConfig modJk= /usr/local/apache2/modules/mod_jk.so / -- !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8081 protocol=HTTP/1.1 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 connectionTimeout=2 debug=0 redirectPort=8443 disableUploadTimeout=true / !-- Define an AJP 1.3 Connector on port 8011 -- Connector port=8011 protocol=AJP/1.3 redirectPort=8443 / !-- Define an AJP 1.3 Connector on port 8010 -- Connector port=8010 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=exodus.zuka.net appBase=/web/exodus.zuka.net/docs/ unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Engine /Service /Server So, while I can see the index.htm or index.jsp page when I go to exodus, I think it might be simply a function of how apache is set up and not because tomcat is actually connecting and rendering. I tried copying the manager directory into /web/exodus.zuka.net/docs and then also into /web/exodus.zuka.net/docs/ROOT but I cannot connect to the manager app. So not sure it is really functioning. Dave