Re: Advice about Tomcat on x86_64 architecture..
Thank you all for your help, The second reason to use more than on tomcat is so i can stop one and the others still work. I compiled the mod_jk module on the server. In catalina.sh i set JAVA_OPTS to -server -Xms1g -Xmx1g -Xincgc I did test for maximum thread by run jsp with this code, % try { while(true){ new TestThread().start(); } } catch ( OutOfMemoryError e ) {System.out.println(Maximum threads = + TestThread.CREATE_COUNT);} % %! public static class TestThread extends Thread { private static int CREATE_COUNT = 0; public TestThread() { CREATE_COUNT++; } public void run() { try { sleep(Integer.MAX_VALUE); } catch (InterruptedException e) {;} } } % I get Maximum threads = 32684. prt wrote: Hi to all, I have Dell PE 2950 with two Intel xeon dual core 5130 processors. I use this server to run website. I have three tomcat work in balance in mod_jk, and one Apache in front on port 80. The JVM and the tomcat that i have on the server are 32 bit architecture. My question is, Is it good to do so or will be better to install 64 bit architecture JVM and compile tomcat on the server ? Thank you all for help and sorry about my English. -- View this message in context: http://www.nabble.com/Advice-about-Tomcat-on-x86_64-architecture..-tf4048957.html#a11515583 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Advice about Tomcat on x86_64 architecture..
Hi to all, I have Dell PE 2950 with tow Intel xeon dual core 5130 processors. I use this server to run website. I have three tomcat work in balance in mod_jk, and one Apache in front on port 80. The JVM and the tomcat that i have on the server are 32 bit architecture. My question is, Is it good to do so or will be better to install 64 bit architecture JVM and compile tomcat on the server ? Thank you all for help and sorry about my English. -- View this message in context: http://www.nabble.com/Advice-about-Tomcat-on-x86_64-architecture..-tf4048957.html#a11500727 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice about Tomcat on x86_64 architecture..
Hi Christopher, Sorry about the double post. Thank you very much for your help, you very kind. I installed JVM 64-bit Server, so now the tomcat's work with the JVM. Are you sure about that is no need to compile the Tomcat on 64 Bit ? What about the all application, I can develop and compile on 32 bit and then transfer class files to the server ? Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Prt, Please do not post more than once. We forgive spelling and grammar mistakes. There is no reason to re-post your question with trivial changes. prt wrote: I have Dell PE 2950 with tow Intel xeon dual core 5130 processors. I have three tomcat work in balance in mod_jk, and one Apache in front on port 80. Three instances on the same piece of hardware? Why not just run a single instance? Load balancing doesn't get you anything when it's all on the same hardware. The JVM and the tomcat that i have on the server are 32 bit architecture. :( Note that Tomcat is architecture-less. Tomcat is neither 32-bit nor 64-bit. Only the JVM makes these distinctions. Is it good to do so or will be better to install 64 bit architecture JVM and compile tomcat on the server ? You should definitely use a 64-bit JVM on your server. You will have access to much more memory and overall performance should improve significantly. You do not have to recompile anything. Tomcat should work exactly as it does today. Thank you all for help and sorry about my English. No problem. My Hebrew would probably be horrible. ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGkmQU9CaO5/Lv0PARAn5hAKCt5+aOHDnHF64o5Ft1V8bEt2ZNxwCfbJr0 rR3sVgqhGYbIVgUJOmkTF98= =V1oW -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Advice-about-Tomcat-on-x86_64-architecture..-tf4048957.html#a11506856 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JVM environment variable..
Hi to all, I want to set the JVM(1.5) to use timezone Asia/Jerusalem. I try to to set any windows environment variables, JAVA_OPTS to -Duser.timezone=Asia/Jerusalem (Not work) so i try TZ to -Duser.timezone=Asia/Jerusalem (Not work) (Maybe i have to restart windows after changing any environment variables ?) In my servlet i set the timezone like this, TimeZone.setDefault(TimeZone.getTimeZone(Asia/Jerusalem));(Is work) But i want global solution, so i must to set it in the JVM level for all java programs. Any ideas ? Thank you all for try(sorry about my english). -- View this message in context: http://www.nabble.com/JVM-environment-variable..-tf3501266.html#a9778225 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JVM environment variable..
The JDK did not ask for time zone. It use the system local timezone, but i want to use other timezone. Thank you anyway. Rashmi Rubdi-2 wrote: The TimeZone should be set not only at the JVM level but also at other levels such as the Database, Operating System, Web Server etc. When you first installed JDK or JRE , did it not ask what TimeZone yo want to set? There's already a thread for setting TimeZone on Tomcat: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg145602.html -Rashmi On 4/1/07, prt [EMAIL PROTECTED] wrote: In my servlet i set the timezone like this, TimeZone.setDefault(TimeZone.getTimeZone(Asia/Jerusalem));(Is work) But i want global solution, so i must to set it in the JVM level for all java programs. Any ideas ? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/JVM-environment-variable..-tf3501266.html#a9778770 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem in MySQL JNDI Resource..
Hi and thanks for replay, The close Host tag is /Host. I try to put context.xml in webapps/test1/META-INF(removed from server.xml + removed the path=), Context debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource .. . / /Context Now when i try to access via this link http://localhost; i get 404, is not mapp to http://localhost/test1;. And when i try to access via this link http://localhist/test1; I get, org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' Siil is not working, I try to add the path attribute and still is not work. But to access via this slink http://localhist/test1; is not my problem. I have to access via this link http://localhost; and i did it but the problem now is that my MySQL JNDI Resource is not work ??? Caldarale, Charles R wrote: From: prt [mailto:[EMAIL PROTECTED] Subject: Problem in MySQL JNDI Resource.. Host name=localhost appBase=webapps ... Context path=/test1 debug=0 reloadable=true The Context element should not be placed in server.xml, since changing it requires restarting Tomcat. Put it in your webapp's META-INF/context.xml file instead, and remove the path attribute. /host I hope the above is really /Host. I start my Apache tomcat 5 on port 80 and everything work good in http://localhost/test1;. Are you using 5.0 or 5.5? The resource configuration is different for each. Check the Tomcat docs for the appropriate level for details. Now i want to access test1 from this link http://localhost/;. So i changed server.xml to, Context path=/ debug=0 reloadable=true crossContext=true The path attribute should be , not / - but then you shouldn't have the Context element there anyway. To make an app the default app, its name must be ROOT, and it should be placed in [appBase]/ROOT (or [appBase]/ROOT.war). I try to put the mysql Connector jar in common/lib And server/lib And shared/lib but still i get the same error. Do not put the same jar in multiple places - that guarantees you will have problems. Your JDBC driver jar of choice normally goes into common/lib or WEB-INF/lib only. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Problem-in-MySQL-JNDI-Resource..-tf3443968.html#a9610024 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ok, I solved the problem...
Hi to all again, I just changed the path attribute from path=/ to path= in server.xml and is work, Host name=localhost appBase=webapps ... Context path= docBase=test1 debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=user password=pass driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost/mydb/ /Context /Host Now i can access to test1 via this link http://localhost/; and JNDI work. Thank you all for your help. prt wrote: Hi to all, I have in webapps web application name test1. In server.xml i define Resource for MySQL db, Host name=localhost appBase=webapps ... Context path=/test1 docBase=test1 debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=user password=pass driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost/mydb/ /Context /host In test1/WEB-INF/web.xml i define, resource-ref descriptionDB Connection/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I start my Apache tomcat 5 on port 80 and everything work good in http://localhost/test1;. Now i want to access test1 from this link http://localhost/;. So i changed server.xml to, Host name=localhost appBase=webapps ... Context path=/ docBase=test1 debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=user password=pass driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost/mydb/ /Context /host I can access to http://localhost/;, but the JNDI Resource for MySQL is not working and i get this error, org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' I try to put the mysql Connector jar in common/lib And server/lib And shared/lib but still i get the same error. I was googeling for hourse and found non. So can any body help me here please ??? Thank you all. (Sory about my English :) ) -- View this message in context: http://www.nabble.com/Problem-in-MySQL-JNDI-Resource..-tf3443968.html#a9610645 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem in MySQL JNDI Resource..
Hi to all, I have in webapps web application name test1. In server.xml i define Resource for MySQL db, Host name=localhost appBase=webapps ... Context path=/test1 debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=user password=pass driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost/mydb/ /Context /host In test1/WEB-INF/web.xml i define, resource-ref descriptionDB Connection/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I start my Apache tomcat 5 on port 80 and everything work good in http://localhost/test1;. Now i want to access test1 from this link http://localhost/;. So i changed server.xml to, Host name=localhost appBase=webapps ... Context path=/ debug=0 reloadable=true crossContext=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource removeAbandoned=true removeAbandonedTimeout=30 maxActive=100 maxIdle=30 maxWait=1 username=user password=pass driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost/mydb/ /Context /host I can access to http://localhost/;, but the JNDI Resource for MySQL is not working and i get this error, org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' I try to put the mysql Connector jar in common/lib And server/lib And shared/lib but still i get the same error. I was googeling for hourse and found non. So can any body help me here please ??? Thank you all. (Sory about my English :) ) -- View this message in context: http://www.nabble.com/Problem-in-MySQL-JNDI-Resource..-tf3443968.html#a9603852 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] server.xml configuration..
Thank you for your help, If i dont want to remov the jsp files so my solution is good ? Another example is, Uploaded images was stored in products/images under test, i change it to d:\data\products\images buy same solution, added this part to server.xml under the Host tag, Context path=/test/products/images docBase=d:\data\products\images debug=0 crossContext=false/. So when i run this link http://localhost/test/products/images/344.jpg, the image is take from d:\data\products\images\344.jpg. Is there another way to do this with out remove the jsp files ? Thank you all. Li-3 wrote: You can move your jsp files which you would like to secure to WEB-INF/, and use dispatched way to access ... then you can define few error files like 404, 503 or your own error.jspwhich can be handled by your java class wish this helps On 3/6/07, prt [EMAIL PROTECTED] wrote: Hi to all, Where i have to config and what, to prevent direct access to my jsp files ? For example, I have project name test. If i whant to show product data the link is, http://localhost/test?do=showProductData. This link run the index.jsp that is in text, and in index.jsp there is include to actions/showProducData.jsp. To prevent direct access to jsp files that are locate in actions i added this part to server.xml in the host part, Context path=/test/actions docBase=/err debug=0 crossContext=false/ So when i try to do direct access to any jsp in actions is run the index file under err. The problem is when i run the link like this http://127.0.0.1/test?do=showProductData, is not work. If i want to cover this problem i have to add Host section to server.xmlfor 127.0.0.1 and put in it this part Context path=/test/actions docBase=/err debug=0 crossContext=false/. Is there any better solution for this problem ? Thank you all. -- View this message in context: http://www.nabble.com/server.xml-configuration..-tf3353902.html#a9327284 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death. -- View this message in context: http://www.nabble.com/server.xml-configuration..-tf3353902.html#a9328234 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlet Filtering performance..
Hi to all again, I added filter object for all requests url-pattern/*/url-pattern. In the Filter class i check the ServletPath (HttpServletRequest.getServletPath()) and i check if is equals to alist of allowd paths. it is work just perfect. But i think that is damage the performance, is it ? Thank you. -- View this message in context: http://www.nabble.com/Servlet-Filtering---performance..-tf3356429.html#a9334933 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Servlet Filtering performance..
Hi, My list is small only 5 URLS, I save it in (String[]), that load in the Filter init method by init parameter in the web.xml. Every request i take the ServletPath and to this part in function, boolean bRunURL; for(int i = 0, max = sArrAlowd.length; i max !bRunURL; i++) bRunURL = (sServletPath.indexOf(sArrAlowd[i],1) == 1); return bRunURL; U think is ok ? Tim Funk wrote: If your allowed list check is small and simple (and NOT synchronized) - the performance impact is probably not noticeable. If your list of URLS is large - then your check would be based on your check algorithm. (http://en.wikipedia.org/wiki/Big_O_notation) -Tim prt wrote: Hi to all again, I added filter object for all requests url-pattern/*/url-pattern. In the Filter class i check the ServletPath (HttpServletRequest.getServletPath()) and i check if is equals to alist of allowd paths. it is work just perfect. But i think that is damage the performance, is it ? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Servlet-Filtering---performance..-tf3356429.html#a9335687 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Servlet Filtering performance..
Well so you say is good, thank you for your help. I have another problem, I save uploaded images(by users) in folder place at D:\storeg\data\uf\. So when the URL is http://localhost/test/uf/xyz.jpg; then is redirect to D:\storeg\data\uf\xyz.jpg And that so because i cunfigure in server.xml this part between the host tag, Context path=/uf docBase=D:\storeg\data\uf debug=0 crossContext=false/ Is ther way that i can do that by using the filter, how can i redirect the request from the flter when is /uf... to D:\storeg\data\uf... with out loading the image and print it out from the filter ? Thank you. (it take hourse to post amessage, my english is not good, sory) Tim Funk wrote: You won't even notice this code being run. -Tim prt wrote: Hi, My list is small only 5 URLS, I save it in (String[]), that load in the Filter init method by init parameter in the web.xml. Every request i take the ServletPath and to this part in function, boolean bRunURL; for(int i = 0, max = sArrAlowd.length; i max !bRunURL; i++) bRunURL = (sServletPath.indexOf(sArrAlowd[i],1) == 1); return bRunURL; - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Servlet-Filtering---performance..-tf3356429.html#a9339522 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Servlet Filtering performance..
I dont want to handle the display process, just to map it from the filter to D:\storeg\data\uf... But thank you for your solution. Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 prt, prt wrote: I have another problem, You should post a separate message in this case. I save uploaded images(by users) in folder place at D:\storeg\data\uf\. So when the URL is http://localhost/test/uf/xyz.jpg; then is redirect to D:\storeg\data\uf\xyz.jpg I assume you mean it is mapped to d:\.. redirecting to a local file path won't work unless you are running your browser from the application server. And that so because i configure in server.xml this part between the host tag, Context path=/uf docBase=D:\storeg\data\uf debug=0 crossContext=false/ Is there way that i can do that by using the filter, how can i redirect the request from the filter when is /uf... to D:\storeg\data\uf... with out loading the image and print it out from the filter ? You have two options: 1. Map a directory into your URL space (not sure how to do that in Tomcat, but I'm sure that's been covered in the archives). 2. Write an image-serving servlet. Something like this: servlet-mapping url-pattern/ug/*/url-pattern servlet-nameimageServlet/servlet-name /servlet-mapping Your servlet class, written in loose pseudocode: doGet() { String filename = request.getExtraPathInfo(); // You should check for .. and other evil-looking paths filename = D:/storeg/data/ug/ + filename; File f = new File(filename); response.setContentType(whatever/is+appropriate); response.setContentLength(f.length()); FileInputStream in = new FileInputStream(filename); OutputStream out = response.getOutputStream(); byte[] buffer = new byte[1024]; int count = 0; while(1024 == (count = in.read(buffer))) out.write(buffer); out.write(buffer, 0 count); in.close(); out.close(); } Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF7fGd9CaO5/Lv0PARAs09AJ9O85lqIEw+ouuSo3oOJnvWQNkl+wCff4c8 8QYH36U+LBA0jk9GXbt69HQ= =Uz+L -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Servlet-Filtering---performance..-tf3356429.html#a9347741 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
server.xml configuration..
Hi to all, Where i have to config and what, to prevent direct access to my jsp files ? For example, I have project name test. If i whant to show product data the link is, http://localhost/test?do=showProductData. This link run the index.jsp that is in text, and in index.jsp there is include to actions/showProducData.jsp. To prevent direct access to jsp files that are locate in actions i added this part to server.xml in the host part, Context path=/test/actions docBase=/err debug=0 crossContext=false/ So when i try to do direct access to any jsp in actions is run the index file under err. The problem is when i run the link like this http://127.0.0.1/test?do=showProductData, is not work. If i want to cover this problem i have to add Host section to server.xml for 127.0.0.1 and put in it this part Context path=/test/actions docBase=/err debug=0 crossContext=false/. Is there any better solution for this problem ? Thank you all. -- View this message in context: http://www.nabble.com/server.xml-configuration..-tf3353902.html#a9327284 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]