RE: Change Max Post Size
Hi. Its done in the Connector tag within the /conf/server.xml - see the docs for the exact attribute but I believe it's the maxPostSize attribute. Regards, Carl -Original Message- From: Diwan, Dronesh (Genworth, Contractor) [mailto:[EMAIL PROTECTED] Sent: 15 February 2006 16:01 To: users@tomcat.apache.org Subject: Change Max Post Size Any idea on how to change the maxPostSize in the Connector instead of using the dafault values. I have problem in uploading files 2 MB. I tried setting different values as prescribed but it didn't work. http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html Thanks Dronesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.1409 (20060215) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Tomcat 5.5 as a standalone web server
### Adam Johnston [EMAIL PROTECTED] wrote message to George Sexton [EMAIL PROTECTED], Tomcat Users List users@tomcat.apache.org ### ### this is reply for: RE: Using Tomcat 5.5 as a standalone web server ### Thanks George and to Tim for his answer also - George's example seems to be a reliable indicator of its capability. I am going to load test the site on a pure Tomcat install - I will let you all know how it goes ;) I would love still to hear of any other examples of pure Tomcat installs. It strikes me that if Tomcat is regarded an enterprise-class web server, as opposed to a Java content server only, it provides a lot of great answers to those of us who have to admin integrated environments. I really hope the development of Tomcat continues to shore up its Apache-like capabilities. -Original Message- From: Rafal Zawadzki [mailto:[EMAIL PROTECTED] Sent: 11 January 2006 11:46 To: Tomcat Users List Subject: Re: Using Tomcat 5.5 as a standalone web server IHMO it is not good way. Apache is one of the best open source project ever - stable, fast, powerfull. Tomcat has good conceptial, but it hasn't quality, it is not stable, nor fast. IMHO opinion tomcat dev should focus on improve stability, not porting apache func to it. Don't get me wrong - we are using tomcat, generally we like it, but it is not 1/10 apache quality. -- Rafał Zawadzki Deploy/Release Manager eo Networks Sp. z o.o. Hi. Not sure I fully agree with you - not about Apache being a great stable product - as I do agree with that. However, I have been using Tomcat since version 3 - and settled on using Tomcat (since version 5.0.x) standalone as I found greater stability, speed and reliance than with using it in conjunction with Apache. I would however put this down to the connectors and issues there rather than to Apache or Tomcat. I am still using 5.0.28 in production on well over 15 servers and over 100 sites - some of which are high traffic! My biggest problem is in jugging database server and web server system resources due to hardware limitations. Anyway, just my two cents. Rgds, Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: question
Hi. A lot of people on this forum Top Post. Is this really such a big issue? -Original Message- From: Rafal Zawadzki [mailto:[EMAIL PROTECTED] Sent: 03 January 2006 16:26 To: Tomcat Users List Subject: Re: question ### [EMAIL PROTECTED] wrote message to Tomcat Users List users@tomcat.apache.org ### ### this is reply for: Re: question ### hello a.) Top Post? http://www.google.com/search?q=top+postingie=UTF-8oe=UTF-8 -- Rafał Zawadzki Deploy/Release Manager eo Networks Sp. z o.o. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Season's Greetings
Greetings to all Tomcat folk! For all of you that celebrate Chrsitmas - a very merry one indeed! A big thank you to all the Tomcat contributors - for all the great work and effort being done in such a selfless way! I, for one, really appreciate your efforts! Regards, Carl
RE: java.lang.OutOfMemoryError: PermGen space
Greetings. AFAIK PermGenSpace is not TC related - its within the JVM and is where permanent memory related loads go - which includes classes loaded by ClassLoaders. Additionally - AFAIK this PermGenSpace does NOT get cleared by the Garbage collector - and only a restart of the JVM will rid you of that used space. The default size of the pgs is 64mb I believe - to increase this you need to use the following JVM runtime switch: -XX:MaxPermSize=96m Where 96 is the max size in mb (as indicated by the m! :P). Hope that helps, Rgds, Carl -Original Message- From: Durfee, Bernard [mailto:[EMAIL PROTECTED] Sent: 22 December 2005 20:25 To: Tomcat Users List Subject: RE: java.lang.OutOfMemoryError: PermGen space I've seen the same thing with 5.5.12 running Confluence and JIRA. I needed to bounce Tomcat after making a bunch of changes to the JIRA workflow, which triggered lot's of processing. I assumed it was a JIRA problem, but maybe it is related to Tomcat 5.5.12? I haven't had the problem since, that was a few days ago. Bernie -Original Message- From: Mike Dippold [mailto:[EMAIL PROTECTED] Sent: Thursday, December 22, 2005 1:57 PM To: users@tomcat.apache.org Subject: java.lang.OutOfMemoryError: PermGen space We are using tomcat 5.5.12 and every couple days the tomcat server goes down hard and the last line in the log is: java.lang.OutOfMemoryError: PermGen space It appears to only happen if we: Update jsp pages Reload Webapp Deploy Webapp If we do not do any of the following the server runs great with no problems which makes me wonder if it has to do with our application or tomcat. We are planning on restarting tomcat each night for now, but we do not want to do that if we shouldnt have to. Please Advise. Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setup for web designers?
I would agree with Chuck - Tomcat standalone has been a far better and robust solution for since 5.0.18 was released - and hoping it will improve (actually am sure it will) with 5.5.x! I did use TC 3 and 4 with Apache - which was never ideal or stable (maybe my fault that) - but TC 5+ is really great! Regards, Carl -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: 13 December 2005 18:10 To: Tomcat Users List Subject: RE: setup for web designers? From: JT Neville [mailto:[EMAIL PROTECTED] Subject: RE: setup for web designers? From what I have read, you get better performance if you let tomcat serve the static stuff as well as the jsps I've been running Tomcat for three years now, and I have to disagree. In my experience, Tomcat isn't as robust at serving the static content as other old school webserver daemons. Offering performance advice based on a 3-year old Tomcat is highly inappropriate. The 5.5.12 version delivers static content at essentially the same speed as Apache httpd. Suggested reading (note that this is about 5.5.4, and 5.5.12 is yet faster): http://tomcat.apache.org/articles/benchmark_summary.pdf - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Securing File System Resources ?
Hi. I have used option 1 in your list with no problem. Others seem ok, but I have not tried them - have an innate paranoia about proxies I guess. Rgds, Carl -Original Message- From: Dov Rosenberg [mailto:[EMAIL PROTECTED] Sent: 13 December 2005 00:10 To: WebObjects Dev; Tapestry users; Tomcat Users List Subject: Securing File System Resources ? Our application has its own security model that controls access to our information based on our own roles and permissions. We store files related to our application on the file system where our application is running. These associated files are served out by a web server. Our goal is to come up with a scheme where we could apply our security model to control access to these files via the web server. For example someone associates a PDF with some meta data. We don¹t want the user to be able to bookmark the underlying URL and email it to their friends for them to download without having them authenticated by our service. We are looking at a couple of different ideas. 1. Create a servlet filter to sit in front of the resources requests and somehow tie that into our application logic 2. Create a regular proxy type of servlet that can accept requests and validate them using our security model 3. Figure out a way to secure the filesystem using a Proxy server of some type. Any other thoughts or ideas are appreciated. Thanks in advance -- Dov Rosenberg Conviveon/Inquira Knowledge Management Experts http://www.conviveon.com http://www.inquira.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why only one Connector per Service?
Hi. You can specify an address/port configuration per connector (yes you can have multiple) for a single service. E.g. Connector address=192.168.0.2 port=80 / Connector address=192.168.0.3 port=80 / Connector address=192.168.0.4 port=80 / As long as each BIND event for that service is unique per connector (on an address/port basis) you are fine. Remember that all Hosts within that Engine/Service will be accessible on all the addresses/ports listened on in that Service. Regards, Carl -Original Message- From: Vinny [mailto:[EMAIL PROTECTED] Sent: 09 December 2005 15:07 To: tomcat-user@jakarta.apache.org Subject: Why only one Connector per Service? I am curious as to the reason there is only one connector for each service? I have a machine with 3 IP addresses. 1 IP is being used by another program running on port 80. That leaves me with 2 IPs that I can use for tomcat. The standalone virtual host method that I have used in the past seems to assume that tomcat will have exclusive use of 0.0.0.0:80 and that is obviously not the case in my situation. I've seen solutions that entail using multple Service/ in the server.xml. Another solution would be to use a different tomcat instance on each port. Are these the only options available for a standalone tomcat config? tomcat 5.5.12 jdk 1.5 linux - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why only one Connector per Service?
Oh, and just to be a little more explicit :) You can of course have the same IP of various ports. If you do not specify address the connector will listen on all available Ips on the specified port (which I think is where the confusion came in), so: !-- same IP - different ports -- Connector address=192.168.0.2 port=80 / Connector address=192.168.0.2 port=81 / Connector address=192.168.0.2 port=8080 / !-- different Ips - same port -- Connector address=192.168.0.3 port=80 / Connector address=192.168.0.4 port=80 / Connector address=192.168.0.5 port=80 / Hope that helps. Regards, Carl -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: 09 December 2005 15:26 To: 'Tomcat Users List' Subject: RE: Why only one Connector per Service? Hi. You can specify an address/port configuration per connector (yes you can have multiple) for a single service. E.g. Connector address=192.168.0.2 port=80 / Connector address=192.168.0.3 port=80 / Connector address=192.168.0.4 port=80 / As long as each BIND event for that service is unique per connector (on an address/port basis) you are fine. Remember that all Hosts within that Engine/Service will be accessible on all the addresses/ports listened on in that Service. Regards, Carl -Original Message- From: Vinny [mailto:[EMAIL PROTECTED] Sent: 09 December 2005 15:07 To: tomcat-user@jakarta.apache.org Subject: Why only one Connector per Service? I am curious as to the reason there is only one connector for each service? I have a machine with 3 IP addresses. 1 IP is being used by another program running on port 80. That leaves me with 2 IPs that I can use for tomcat. The standalone virtual host method that I have used in the past seems to assume that tomcat will have exclusive use of 0.0.0.0:80 and that is obviously not the case in my situation. I've seen solutions that entail using multple Service/ in the server.xml. Another solution would be to use a different tomcat instance on each port. Are these the only options available for a standalone tomcat config? tomcat 5.5.12 jdk 1.5 linux - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Howto delete a file with a servlet???
Hi. Solution 2 - 1 is not a great idea! Also, try something like: String fileName = request.getParameter(Id) + .xml; File toDel = new File(c:\\, fileName); //get some info out.println(File exists: + toDel.exists()); out.println(File is readOnly: + !toDel.canWrite()); If (toDel.exists() toDel.canWrite()) { if (!toDel.delete()) { Thread.sleep(1000); //try get around file lock/release issue? (? Stab in the dark maybe!) if (!toDel.delete() { out.println(Failed to delete file - with delay/pause and retry); //could also tell it to delete on JVM exit - not that useful with most web apps though toDel.deleteOnExit(); } } } else { out.println(Failed to delete file + fileName + - file does not exist or is read only!); } You could also try and put the sleep and retry in a loop. However, the main error in your code was that the datName reference when creating a the File object was a string - when it should be a variable reference! i.e. new File(datename) should be new File(datname); Hope that helps, Regards, Carl -Original Message- From: Anne Milbert [mailto:[EMAIL PROTECTED] Sent: 07 December 2005 16:13 To: Tomcat Users List Subject: Howto delete a file with a servlet??? Hi anyone, I'd like to delete a file with a servlet. I tried it with the delete() function and with the runtime.exec() function. What am I doing wrong? Here's my code: Solution 1: [...] String cmd = del C:\\ + request.getParameter(Id) + - + eleno + .xml; Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(datname) [...] Solution 2: [...] String datname = C:\\ + request.getParameter(Id) + - + eleno + .xml; boolean success = (new File(datname)).delete(); if (!success) { out.println(Couldn't delete file: + datname); } [...] Regards, Anne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem loading class in TomCat
Hi Camilla. Is there any chance you could zip up your webapp's ROOT folder and send it over? Would be happy to take a closer look if there isn't anything sensitive in there! Regards, Carl -Original Message- From: Camila Kozlowski Della Corte [mailto:[EMAIL PROTECTED] Sent: 06 December 2005 19:32 To: Tomcat Users List Subject: Re: problem loading class in TomCat Yes, all my classes are in a package. Camila 2005/12/6, Mark Thomas [EMAIL PROTECTED]: Are all your classes in a package? Mark Camila Kozlowski Della Corte wrote: Greetings, I am developing an application with JSP, and using JSF. Here is a description of the problem I had with TomCat. I created a class A which invokes a class B. This class B invokes a class C (class C is a JUnit class). Both the jar files containing class B and C are located in the lib folder of my JSP application (the jar file containing class C is JUnit.jar). When I run my JSP application which uses class A TomCat does not load the JUnit class, and shows the following error message: java.lang.NoClassDefFoundError: junit/framework/TestCase When I run class A as a Java application it works perfectly. I tried many things but TomCat does not find this class. I have tried putting the uncompressed classes inside the application classes folder but I get the same error message. My last trial was to directly call class B of the JSP application, but I get the same error message. Class B (which invokes the JUnit class) uses reflection in the implementation. Is this a problem for this context? I would like to know if anyone knows what is going on and why I get this error message. I would appreciate if anyone can give me a clue to solve this problem. I am using TomCat version 5.5.9, Eclipse 3.1, Java 1.5.0_04 and JSP 2.0. Thanks in advance. Camila - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SSL InvalidKeystore Format?
Hi. Ok, well what I think I will do is clean up my utility classes into a useful utility class (with main and command line switches etc) to do all the in/out/conversions as I use them. I will then mail that source to the list and hopefully it would assist everyone! Will try to get that out this week! Regards, Carl -Original Message- From: Nate Rock [mailto:[EMAIL PROTECTED] Sent: 05 December 2005 16:10 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: SSL InvalidKeystore Format? Sweet Carl that would be awesome! I have other stuff to do as well, but I will take a look at your post from yesterday with code to see if I can't glean any sort of extra inspiration from it since it didn't mention PKCS12 formats I just kind of glanced over it =( All our certs are currently in PKCS12(PFX) format and having to re-request them all using OpenSSL would be a PITA ;) I remember back when looking at our PKI code that it was anoying to try and get the private key exported and in the correct (RSA) format that apache expects out of a PKCS12 file using java. If we could build a utility based off your current code that could take an existing keystore (JKS/PKCS12) that could extract it into PEM (RSA) encoded private key/signed certificate that apache/tomcat(APR) could use and maybe do the reverse, take both pem encoded files and build a keystore (JKS/PKCS12) file, I think it would help a lot of people out when trying to get the APR/SSL thing configured. The confusing part is that when you export a private key in PEM format using java, the default format is PKCS8 which from what I understand, the APR doesn't know what to do with because it's expecting PEM (RSA) encoding. With the utility, we could say that if your certificates were made using java keystores, to get them to work with the APR, run this java command to split them into PEM (RSA) encode private key/signed certificate. If your certificates were made using OpenSSL and you want to use them with the tomcat connector, run this other simple command using your PEM (RSA) encoded private key/signed certificate to get a keystore. I think we already do this using some set of OpenSSL commands(openssl pkcs12, and openssl rsa) as well, but I havn't gotten my verisign cert yet this morning so I can try it out and get back to everyone. Although I don't like to re-invent the wheel, being able to convert between keystore/PEM(RSA) encoded private key/certificates with a simple java app might be better than forcing peeps to learn how to install/configure OpenSSL on their respective platforms. -rOcK -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 7:41 AM To: 'Tomcat Users List' Subject: RE: SSL InvalidKeystore Format? Hi Nate. I am not sure if this is relevant, but think it is - the private keys, CSRs and certificates I am using with tomcat (as per my email from yesterday -- although I have not posted my mechanism for exporting PFX and PEM certificates -with Private Keys etc) have been used as is imported into IIS, Apache, etc with no problems. I will post my export function (as well as the import functions for PFX and PEM with private keys attached) later (or tomorrow) - just a little busy right now. I have a large number of actual certificates (purchased from a number of CAs including verisign) in production use. Anyway - will post my other steps/functions etc as soon as I have a moment! Regards, Carl -Original Message- From: Nate Rock [mailto:[EMAIL PROTECTED] Sent: 05 December 2005 05:11 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: SSL InvalidKeystore Format? I think the issue Scott is getting caught up on is the same issue I have been having for the last week: Using APR + SSL with anything but a self signed certificate isn't clearly defined as of yet. Scott, my recommendation to you at this point is to uninstall tomcat, and then reinstall it making sure to NOT check the native checkbox when given installation options. This will install tomcat without the APR connector and the steps listed on Verisign (and on the tomcat site) using java keytores will work fine. I know Carl and Dhaval have been giving awesome information about how to generate csrs/keystores etc. but none of us (including me) has a rock solid example using an actual verisign certificate that they have set up and have running right now in production using APR. (Remy?) I think that using OpenSSL for generating the private key/csr will end up being the way it's done because of the difference between RSA and PKCS8 private key encodings. (OpenSSL vs java keystore default encodings) If any of you have actually used a verisign (NOT a self signed OpenSSL certificate from http://www.fatofthelan.com/articles/articles.php?pid=12.) with APR+SSL please post the exact steps you used from generating the primary key/csr file down to the connector you used. We would also like to know exactly what encoding the primary
RE: SSL InvalidKeystore Format?
Greetings. Not sure if this will help, but I spent a lot of time fighting with certificates for use with Tomcat - from CSRs to issued certificates from the CAs - as well as using PFX files as exported from other webservers etc.. I have however got it working great, and thought to give you my steps, commands, and pointers - hopefully they will assist! Scenario 1: CSR with issued Cert from CA 1. Generate the CSR. Important - generating the CSR requires a private key (which resides in the keystore used for the generation) to be present when importing the actual certificate from the CA (in response to the CSR). Thus I have a number of different keystores I use. Generate the Private Key I will be using to generate the CSR (using my 'privatestore' keystore): keytool -genkey -keyalg RSA -dname cn=www.site.com ou=My Deptartment o=My Company l=My City s=My province c=GBR -alias certrequest -keypass mypasswd -keystore /ssl/privatestore -storepass mystorepwd -validity 365 This generates the private key, and generates the CSR ready for extraction to be submitted to the CA. I use the following code snippet to extract the private key - bearing in mind that I will be wanting to use the private key later when I wish to import the public key (cert) as returned by the CA. Useful to note that I create a keystore per connector (per site) for use in Tomcat. === code snippet === //this first snippet extracts the private key - as I wish to persist it in Base64 encoding //for use when I import the certificate later //I resuse this keystore for private key/CSR generation //load the privatestore keystore used for privatekey/CSR generation File workingkeystore = new File( /ssl/privatestore ); KeyStore workingStore = KeyStore.getInstance( JKS ); workingStore.load( new FileInputStream( workingkeystore ), mystorepwd.toCharArray() ); //extract the keypair (private key is what we want) KeyPair kp = getPrivateKey( workingStore, certrequest, mypasswd.toCharArray() ); PrivateKey pkey = kp.getPrivate(); //get the private key binary byte[] binary = pkey.getEncoded(); //base64 encoder - in package sun.misc BASE64Encoder myB64 = new BASE64Encoder(); //encode the private key binary as a Base64 string String b64 = myB64.encode( binary ); //persist the private key for later use PrintWriter out = new PrintWriter( new FileWriter( new File(/ssl/privatekeys/www.mysite.com.pkey) ) ); try { out.println( -BEGIN PRIVATE KEY- ); out.println( b64 ); out.println( -END PRIVATE KEY- ); } finally { out.close(); } === end snippet === Now I use the keytool to generate the CSR with the private key generated above (note I use the same alias I used when generating the private key to ensure correct processing). Note that this will generate the Base64 representation of the CSR to the specified location using the -file switch. keytool -certreq -file /ssl/csrs/www.site.com.csr -alias certrequest -keypass mypasswd -keystore /ssl/privatestore -storepass mystorepwd The Base64 string which is the contents of the CSR above can then be submitted to the CA. Be sure to keep the private key generated for use when importing the CA issued certificate. I will now go over how I go about importing/setting up the actual certificate keystore for use with Tomcat: Using a Base64 String representation of the Certificate returned by the CA: Before I run the code below however I run the Private Key we generated to create the CSR through the openssl to get it into the correct format - namely pkcs8 (DER) format using the openssl command as follows: openssl pkcs8 -topk8 -nocrypt -in /ssl/privatekeys/www.mysite.com.pkey -out /ssl/temp/www.mysite.com.tempkey -outform der === code snippet === //first create the keystore we will be using for the cert //the actual keystore file path - ensure this does not exist String keyFilePath = /ssl/keystores/www.mysite.com.keystore; KeyStore ks; try { ks = KeyStore.getInstance(JKS, SUN); ks.load( null, mypasswd.toCharArray() ); ks.store(new FileOutputStream ( new File(keyFilePath) ), mypasswd.toCharArray()); } catch (Exception e) { //handle as you require throw new RuntimeException(Failed to create new Keystore ( + keyFilename + )., e);
RE: How much memory will Tomcat 5.5/Java 5 support?
Hi. Are you running a 64bit or 32bit OS? If 32bit the JVM will not be able to assign higher that 2gb for a single process (which includes system overheads etc). You will need to move to a 64bit OS to be able to create higher Heap. I would check your OS memory/kernel/process memory documentation if I were you. There were recently some posts on this list dealing with Tomcat memory - would suggest reading thrugh those for some useful tips too. Rgds, Carl -Original Message- From: Joe Reger, Jr. [mailto:[EMAIL PROTECTED] Sent: 03 December 2005 12:57 To: users@tomcat.apache.org Subject: How much memory will Tomcat 5.5/Java 5 support? Hi! I'm having trouble getting my Tomcat 5.5. production box to use more than 1.1Gb of memory. 1) When I use the Configure Tomcat console's Java tab to set the Maximum Memory Pool I can only use a max of 1999Mb. If I go above that the Windows Tomcat service will fail to start. 2) Tomcat will start with a configured value of 1999Mb, but when I view max memory in the app it says that it has a max of about 1140Mb (sorry, I forgot the exact value... possibly 1048Mb, but i don't remember it being one of the magic numbers). Is this a JVM issue or a Tomcat issue? I've got 4Gb of ram on the dedicated Tomcat server and I'd like to give 3Gb to Tomcat. Thanks, Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How much memory will Tomcat 5.5/Java 5 support?
Hi Joe. Well, heres how I run it - and remember this is all dependent on the beakdown of requirements of the following: 1. Web app memory needs - how memory intensive are your web apps within Tomcat going to be? 2. Concurrent connections (tcp threads) for incoming requests - how busy will the web apps be? 3. Are you running DB connections? Are you using a Connection pool? How long will each db connection take to return? 4. Are you running OTHER applications/servers on the server which will require memory? E.g. RDBMS Server 5. Always be aware that the native OS will also need memory - thus you cannot just give it all to Tomcat! So, heres one of my scenarios: Server: Quad Xeon 2GB RAM OS: Windows 2000 Server (32 bit) Applications/Servers: Tomcat 5.0.28 (with 40 web apps/contexts/classloaders) MSSQL Server 2000 My Tomcat runtime switches are as follows: -Xms768m//assign all the JVM heap at startup to 768mb -Xmx768m//assign max JVM heap -Xss128k//set the native thread stack size memory allocation down from windows def of 1024kb - very useful -XX:+UseParallelGC //parralel GC - makes use of the multiple processors -XX:MaxPermSize=256m//up the perm gen space (used for classloading etc) from def 64mb - also useful with lots of web apps -XX:+DisableExplicitGC //don't let the System.gc() be called as it could cuse 'pause the world's I also limit the amount of RAM that MSSQL can have to 640mb - and have also set the memory allocation size per sql connection down from 1024kb to 512kb (SQL Server setting) - this is however due to my running MSSQL Server on the same box and may not apply. I have thus left some RAM for the OS to use where required - this should not be ignored. I found that this is a pretty stable setup - with my only problem occurring occasionally when I get a MAJOR spike in concurrent requests. I plan to upgrade to a 64bit OS soon and to up the SQL RAM allocation as my problem lies there - it sometimes has issues with memory! It should be noted that my web apps can be fairly SQL intensive - I do have VM level caching but alas not all of it Anyway - I do hope that helps! Other areas you could look into is the number of concurrent requests Tomcat serves (set at a Connector level) - as too many will cause memory issues under load, while too few will cause visitors to be rejected/wait for response! Anyway, take care, Carl -Original Message- From: Joe Reger, Jr. [mailto:[EMAIL PROTECTED] Sent: 03 December 2005 13:19 To: Tomcat Users List Subject: Re: How much memory will Tomcat 5.5/Java 5 support? Are you running a 64bit or 32bit OS? If 32bit the JVM will not be able to assign higher that 2gb for a single process (which includes system overheads etc). Hi Carl - I'm 32 bit right now. I'll check the archive for past posts. How would you go about using more of the memory that I have on the server? Can I run two Tomcat services and cluster? Thanks for the feedback and help! Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How much memory will Tomcat 5.5/Java 5 support?
Hi Nate. Yeah, the AggressiveHeap is definitely an option. My take on it - over months of researching, fighting, tweaking the memory settings is that it leaves a lot of decision making up to the VM. While this is not necessarily a bad thing - prefer to keep some more control - although that may be my paranoia talking :) Thing is that memory settings I find are more about finding a balance between the different 'users' of the resources within the entire system - all the servers and apps need to coexist on the box - and as such I do not believe there is a 'fix-all' setting - ites definitely more about finding the settings which allow your particular setup to exist best in harmony! With that in mind however, I will give this setting a go on one of my boxes - one where the SQL Server is not running and is on another machine - and see what effect it has - will report any findings/conclusions back to the list for those that are interested. With regards the CPU usage I would agree with you in that dual or quad Xeons will not suffer under the AggressiveHeap option - although it does not that it is intended for quad processors... Gains and losses? Depends on your requirements and setup. As stated in my case (as I did in fact try the AggressiveHeap) where quite often the Tomcat server and Database server runs on the same machine it did not work as well as the more granular settings I have used. I am also a firm believer in leaving enough RAM for the underlying native processes and OS to do its work! All in all resource tweaking is generally a tedious task that requires thorough investigation and a good understaning of your environment and the requirements of your web apps, servers, and operating system... Thanks and regards, Carl -Original Message- From: Nate Rock [mailto:[EMAIL PROTECTED] Sent: 03 December 2005 14:58 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: How much memory will Tomcat 5.5/Java 5 support? -XX:+AggressiveHeap usage for JVM? This email is pointed almost directly for Carl Oliver, since he seems to be someone who knows his virtual memory settings, but I figure Joe Reger might get something out of it too ;) Evidently this setting by iteself instructs the JVM to push memory use to the limit, and is only recommended for use on boxes containing a single JVM with nothing else running on it (a server running only Tomcat seems to foot the bill) It does a few things that Carl suggested implicitly -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy -Xss256k You can read more about it here: http://java.sun.com/docs/hotspot/gc1.4.2/ From my experience it has made some of our problem servers much more stable, allowing them to run for months without OOM instead of days or weeks allowing us to actually use session replication without the servers going bananas ;) We also used to have our Max memory set at -Xms1300mb and -Xmx1300mb, but I have found that when using the -XX+Aggressive heap the JVM memory usage rarely tops 1024MB because it's cleaned out much more efficiently. Carl what is your take on this? I realize it uses a bit more CPU because of the adaptive size and parallelGC, but on duel Xeon boxes CPU usually isn't the limiting factor (at least in our case). What gains/loss do you see over using -XX:AggressiveHeap (dynamic, adjustible settings) vs hard coding fixed settings like you suggest? -rOcK -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: Saturday, December 03, 2005 7:43 AM To: 'Tomcat Users List'; [EMAIL PROTECTED] Subject: RE: How much memory will Tomcat 5.5/Java 5 support? Hi Joe. Well, heres how I run it - and remember this is all dependent on the beakdown of requirements of the following: 1. Web app memory needs - how memory intensive are your web apps within Tomcat going to be? 2. Concurrent connections (tcp threads) for incoming requests - how busy will the web apps be? 3. Are you running DB connections? Are you using a Connection pool? How long will each db connection take to return? 4. Are you running OTHER applications/servers on the server which will require memory? E.g. RDBMS Server 5. Always be aware that the native OS will also need memory - thus you cannot just give it all to Tomcat! So, heres one of my scenarios: Server: Quad Xeon 2GB RAM OS: Windows 2000 Server (32 bit) Applications/Servers: Tomcat 5.0.28 (with 40 web apps/contexts/classloaders) MSSQL Server 2000 My Tomcat runtime switches are as follows: -Xms768m//assign all the JVM heap at startup to 768mb -Xmx768m//assign max JVM heap -Xss128k//set the native thread stack size memory allocation down from windows def of 1024kb - very useful -XX:+UseParallelGC //parralel GC - makes use of the multiple processors -XX:MaxPermSize=256m//up the perm gen space (used for classloading etc) from def 64mb - also useful
RE: memory limit for tomcat?
I would alos suggest leaving an equal amount (or thereabouts) of RAM to the OS for native allocation. I found - after months of fighting, that assigning too much to the JVM heap can also have detrimental effects. Another thing to look at is to drop the native stack size allocated to threads - the default on Windows is 1024k as far as my research found - thus within the 2GB allocation of memory to a single process that would limit the number of threads that can be spawned within that space. This is set with the -Xssxxxk setting - I have set mine to -Xss128k - which 'theoretically' would allow 8 times (a VERY rough estimate) the number of threads within the allocated heap. One other setting that I found useful was the perm gen space allocation - for classloading etc. The default I believe is 64MB, however, if you have a large number of webappclassloaders within your Tomcat space - pushing this up would be useful - especially if you trigger redeploys etc. This can be set with the -XX:MaxPermSize=xxm setting - the value of which should be determined based on total OS RAM and JVM heap allocations. Anyway, those just some things that I found assisted with my memory issues! Regards, Carl -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: 02 December 2005 23:09 To: Tomcat Users List Subject: RE: memory limit for tomcat? From: joon yoo [mailto:[EMAIL PROTECTED] Subject: memory limit for tomcat? The server is going to be upgraded to 2GB's of RAM, exactly what is the limit of the amount of memory that can be allocated to tomcat and still run stably? The limit is a function of the OS and JVM you're using and anything else running on the box, not Tomcat itself. Windows normally gives each process a 2 GB virtual space to play in, and then scatters various dlls through it to guarantee not having contiguous space. Without going to great pains, the largest heap you can use on a Windows server is around 1.3 - 1.5 GB. If you set the -Xmx value to something that large, watch your paging rate carefully to make sure you don't start thrashing. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ssl deployment recommendations
I concur. I use tomcat without Apache and mod_jk due to the fact that in my testing it worked far better! SSL no problem either! Rgds, Carl -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: 26 November 2005 19:05 To: Tomcat Users List Subject: Re: ssl deployment recommendations Chris Pat wrote: Sorry I was not clear. It is for inbound connections to client browsers. Where do I begin? I assume I need to front it with Apache which means modjk, correct? Why would you assume that? You need to configure your server.xml's Connector elements properly and install your certificate -- Tomcat works just fine as a standalone Web server, including handling SSL. And, hopefully, you begin with the Fine Manual :-) -- http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html HTH, -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filters
Greetings. I have a questions regarding Filter servlets. If a request is made for a non-existent/non *.jsp or servlet URI - will the Filter be instantiated? Reason I ask is because I want to interect old bookmarked requests for an old site - which has been migrated to a new tomcat based JSP site - however the old site was ASP based. Many users of the old site would have bookmarked something like: /index.asp?PageID=16 or something similar - and I am hoping to be able to intercept that - using a Filter seemed a logical choice - and send back a redirect to the new URL /some.jsp for those requests. Thanks in advance, Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filters
AH. Damn, my aplogies - the mapping! Of course - *slaps forhead* :) Thanks a stack! Rgds, Carl -Original Message- From: Reynir Hubner [mailto:[EMAIL PROTECTED] Sent: 25 November 2005 14:23 To: Tomcat Users List Subject: Re: Filters -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi, Sure, you can map your filter on to /* or something like that. That way you can intercept any URL you like and either rewrite, or redirect. It doesn't matter if your URL reads /something/something/default.asp or not, if you know how to handle that url from your filter (usually done by reading config from file or database). If you are using mod_jk then you might have to change your mapping in to tomcat. I've been implementing this by using filters for a long time, never had problems with it. hope it helps - -reynir Carl Olivier wrote: Greetings. I have a questions regarding Filter servlets. If a request is made for a non-existent/non *.jsp or servlet URI - will the Filter be instantiated? Reason I ask is because I want to interect old bookmarked requests for an old site - which has been migrated to a new tomcat based JSP site - however the old site was ASP based. Many users of the old site would have bookmarked something like: /index.asp?PageID=16 or something similar - and I am hoping to be able to intercept that - using a Filter seemed a logical choice - and send back a redirect to the new URL /some.jsp for those requests. Thanks in advance, Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDhx5K19KgIQihNwgRAjtxAJ9SjYarLFkzoBNAWHc6OeLUiD3S6QCgqN9v BzHRkrnr2XJC1jQ6VKEoDH8= =JLxP -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDK Date version 49.0 vs 48.0 problem
It appears you are running the 1.4 javac using 1.5 rt.jar library. Ensure that you have your compiler (JDK home) set up correctly. Regards, Carl -Original Message- From: Daxin Zuo [mailto:[EMAIL PROTECTED] Sent: 22 November 2005 20:26 To: Tomcat Users List Subject: JDK Date version 49.0 vs 48.0 problem I recently download jdk 1.5. When I compile the java code with JBuilder 9, I get the error: CreateCustomer.java: cannot access java.util.Date,bad class file: C:\Sun\AppServer\jdk\jre\lib\rt.jar\java\util\Date.class,class file has wrong version 49.0, should be 48.0,Please remove or make sure it appears in the correct subdirectory of the classpath. at line 3, column 18 My program ran well before with jdk 1.4, and Tomcat 5. Please help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDK Date version 49.0 vs 48.0 problem
Hmm sorry, but just thought of another option/potential cause here. Try and clean out your cimpilation directory (the classes output location) - may be classes there that are already compiled which require 1.4 rt libs - clear that all out and rebuild your entire source tree from scratch using 1.5. Regards, Carl -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: 22 November 2005 20:33 To: 'Tomcat Users List' Subject: RE: JDK Date version 49.0 vs 48.0 problem It appears you are running the 1.4 javac using 1.5 rt.jar library. Ensure that you have your compiler (JDK home) set up correctly. Regards, Carl -Original Message- From: Daxin Zuo [mailto:[EMAIL PROTECTED] Sent: 22 November 2005 20:26 To: Tomcat Users List Subject: JDK Date version 49.0 vs 48.0 problem I recently download jdk 1.5. When I compile the java code with JBuilder 9, I get the error: CreateCustomer.java: cannot access java.util.Date,bad class file: C:\Sun\AppServer\jdk\jre\lib\rt.jar\java\util\Date.class,class file has wrong version 49.0, should be 48.0,Please remove or make sure it appears in the correct subdirectory of the classpath. at line 3, column 18 My program ran well before with jdk 1.4, and Tomcat 5. Please help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat WAP/WML
Greetings This may be a very stupid question, but I am busy researching serving WML content to WAP devices - from my existing Tomcat (5.0.28) server - from existing web apps - as the content is shared - standard HTML/HTTP via JSP - would like to provide a WAP/WML access point to the same site/content. Has anyone had experience with this - and who would be able to point me in the right direction? Thanks in advance, Carl
RE: Tomcat on Mac
Greetings. Ok, well I can verify that it breaks every time when the http://www.jfree.org/jfreechart/index.php JFreeChart library is used to dynamically render a graph from data. I am unsure exactly where in the code this is happening, will step through and provide additional information as I have it. I am using jfreechart 0.9.20. Regards, Carl -Original Message- From: Edoardo Panfili [mailto:[EMAIL PROTECTED] Sent: 08 November 2005 15:50 To: Tomcat Users List Subject: Re: Tomcat on Mac Carl Olivier ha scritto: Greetings. I am having a problem with my Tomcat server (5.0.28) running on Mac XServe. Not sure if anyone here can help, but trying my luck... output from /usr/bin/sw_vers below: ProductName:Mac OS X Server ProductVersion: 10.4.2 BuildVersion: 8C47 java - version output: java version 1.4.2_09 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232) Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode) It seems when anything (well a lot?) executing withing the JVM requiring any java imaging libs, or access to a default toolkit for image processing causes this (or similar errors) to occur - and result in the java process exiting! Log entries from Tomcat log file at the time of process exit and failure: Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() Exception in declaration() 2005-11-08 15:05:17.195 java[5522] CFLog (0): CFMessagePort: bootstrap_register(): failed 1100 (0x44c), port = 0x5a20f, name = 'Processes-2.5522' See /usr/include/servers/bootstrap_defs.h for the error codes. 2005-11-08 15:05:17.196 java[5522] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (Processes-2.5522) CFMessagePortCreateLocal failed (name = Processes-2.5522 error = 0) The java runtime switches I am using are below: -Xms784m -Xmx784m -Xss128k -XX:+UseParallelGC -XX:MaxPermSize=196m -XX:+DisableExplicitGC -Djava.awt.headless=true Does anyone have any idea as to why this is happening, or what could potentially cause this? One my application (Servlet) that works with bitmap images hangs in the same way (java VM exits). Ther error don't occurs overy times, is not easily reproducible. There is a bug report at apple 3844767:1.4.2_05-141.3:java vm crash when using javax.image 19-Oct-2004 06:11 PM But no solution. Now I am using SVG, o very alternative vay. I'd like to change my server. output from /usr/bin/sw_vers below: ProductName:Mac OS X ProductVersion: 10.3.9 BuildVersion: 7W98 java - version output: java version 1.4.2_09 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-233) Java HotSpot(TM) Client VM (build 1.4.2-56, mixed mode) Edoardo Panfili -- [EMAIL PROTECTED] AIM: edoardopn Jabber: [EMAIL PROTECTED] tel:075 9142766 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]