Regarding tomcat installation
Hi , I want to install tomcat 5.5 in my home PC. Which distribution should i download from apache website , as there are many versions available. I downloade windows installer service , but am not able to start , stop the server as there is no batch file available in that version. It meant i have to run it as a service everytime. Also tell me how to configure my each applications to differnt ports for example (app1 - 8080, app2 - 9080, app3 - 9081) etc using tomcat 5.5. What exactly is binary distribution how to go about installing it. Reply me ASAP. Thanks in advance. Regards, Arun.
Re: Problem mod_jk.so (1.2.26) 100% process (Tomcat 5.5.26 + Apache 2.2.9)
Estevam Henrique Portela Mota e Silva schrieb: Hi, Install - Apache 2.2.9 (ok!), Tomcat 5.5.26 (ok!) e JDK 1.5.0_15 *Entered link with the Tomcat happened was that Tomcat5.exe has process is 100%. It is the problem MSVCRT.dll* * Details MSVCRT.dll* Tamanho: 335 KB (343.040 bytes) Versão: 7.0.2600.5512 operating system: Win Xp Sp3 e already installed all the windows update.I already heard that the problem in Windows Service Pack 3. If you know what happens tomcat5.exe? Please generate a few Java Thread Dumps, so we can see, in which code regions your CPU stays. If you are running Tomcat via the bat files, do catalina.bat run dump.log Reproduce the problem, and then press a Ctrl+Break in the DOS box t generate the dump. Wait a few seconds and press it a second time and then maybe a third time. Have a look at the new file dump.log. Regards, Rainer - 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: JNDI realm strange problem(Tomcat 6.0.16)
hello chris, yes, our ldap server and tomcat server are both up for 24 hours and 7 days. yes, restarting tomcat server, problem vanishes. thank you, On Fri, 2008-06-20 at 10:20 -0400, Christopher Schultz wrote: king again? -- Kumar Gaurav Srivastava A B Technologies SDF Building, Mudule 417 Sector - V, SaltLake Kolkata, 700 091, India Phone: +91.33.2357.7172 - 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: Regarding tomcat installation
- Original Message - From: Arun Raj Ramkumar [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, June 23, 2008 8:16 AM Subject: Regarding tomcat installation Hi , I want to install tomcat 5.5 in my home PC. Which distribution should i download from apache website , as there are many versions available. I downloade windows installer service , but am not able to start , stop the server as there is no batch file available in that version. It meant i have to run it as a service everytime. Also tell me how to configure my each applications to differnt ports for example (app1 - 8080, app2 - 9080, app3 - 9081) etc using tomcat 5.5. What exactly is binary distribution how to go about installing it. Reply me ASAP. Thanks in advance. Regards, Arun... For some strange reason, I've also noticed that some of the later installer versions are missing the script files. In theory all you should need is the EXE version and you done. If the script are missing, download the zip file (same version) as well, and copy all the stuff in the bin to your installation... you'll get your scripts. ZIP files in theory run anywhere. EXE files in theory, should be easy to install on windows. The later versions of 5.5.25 are already well tried and tested and should work well. The 6 versions are a little newer, and under development, but in theory should be stable, except for weird things like missing script files ;) Your idea of ports is wrong, all the applications run on the same port of your choosing, normally port 8080 when testing and port 80 when in production. A browser by default uses port 80, so having a million apps on a million ports would drive your users nuts ;) The applications are separated by a context /YourAppName etc. When you get going type localhost:8080 into your browsr and play with the samples and noting the URI of the various applications... Welcome to TC... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nginx Front End
Hello, I'm currently using Apache 2.2 and mod_proxy_ajp to load balance across 3 tomcat servers. I'm considering looking at nginx as Apache seems somewhat resource intensive. Has anyone on the list tried this? Does nginx support (or need to support) ajp13? S. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UTF-8 handling differs between two servlets within the same application
Hi, we are developing an application, where we experience an interesting UTF-8 related behaviour. For the development the team mostly uses Tomcat, since the deployment is much faster and nicer. All tests are repeated on WebSphere, because that is what our customer runs. We are running a Tomcat environment Tomcat 6.0.16 Java 1.6 - 6 Struts 1.2.9 RHEL 4 and Windows XP / SP2 and a WebSphere environment WebSphere 6.0.2.17 Java 1.4 (shipped with WS) Struts 1.2.9 RHEL 4 There is a login action and an action where the user can change his password. Both forms use the post-method. Content of both HTML-pages is declared as UTF-8. We use an encoding filter (Tomcat only) as described in: http://wiki.apache.org/tomcat/Tomcat/UTF-8 Funny thing is: One of the servlets (login) works as expected. Username and password are in proper UTF-8 encoding. The other servlet does not receive proper UTF-8. This way the password-hashes are corrupted if the user types in non-ANSI chars (i.e. every char that needs multibyte encoding in UTF-8). The user then cannot log into the application. In both cases the filter code is executed, we verified that with a debugger. Tracing the client-server communication with WireShark shows that the Web-Browser sends identical password data as a result of both forms. In the request object on the other hand the strings differ if a special character was entered. We checked that with a debugger by setting a breakpoint in the encoding filter. We added URIEncoding=UTF-8 in the connector, as suggested in various posts we found googling the problem... unfortunately to no avail. If I'm not totally mistaken there is no application code run before the filter, so either we are making a mistake that has slipped us (quite possible) or we might have found a rare bug in Tomcat. On WebSphere the same code works without a problem. I would appreciate any kind of hint, since developing on Tomcat is much more fun than on WebSphere. Thanks for your help in advance and with kind regards, Christoph. _ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidungedt=1ptnrid=230 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Windows Task Manager - tomcat processes
Hi! If I have more than one tomcat instance installed and started, how do I now wich process in task manager corresponds to the tomcat instance? In task manager I only see things like that: tomcat5.exe tomcat5.exe tomcat5.exe Thanks a lot A.
Re: Changing roles on the fly
Lyallex wrote: On Sat, Jun 21, 2008 at 12:41 PM, Mark Thomas [EMAIL PROTECTED] wrote: Johnny Kewl wrote: - Original Message - From: Lyallex [EMAIL PROTECTED] Allowing a user to add a role is simple enough. Is it? Yes. snip ... If you change web.xml, yes TC will restart. However, you probably know the roles you want and the resources you want to protect, just not which users have which roles. Exactly, in my application there is a business requirement to allow certain user to add certain roles on the fly. I know what these roles are and the resources they protect, all this is predefined. When a user adds a role I log them out (They are warned about this and are ready for it) when they log in again they have the additional role, all this is relatively trivial to implement as is the elected removal of a role which works in exactly the same way. Are you using 'tomcat-users.xml' to manage roles and authentication? If so, why not move that stuff into a DB, (and use DataSourceRealm instead of MemoryRealm)? p The problem comes when I want to remove certain privileges from a user who may already be logged in. I can remove the role in the persistance store easily enough but I need a way to get a handle on the session and invalidate it so that he next time the user tries to access a protected resource they have to log in again. Look at how the manager webapp access the list of sessions. You should be able to use similar code. Note you'll need to make your webapp privileged. You might want a separate admin webapp. Yes, I've sort of come that that conclusion myself, I might try the JMX route as it's something I've never done before and it's fun to learn new stuff. If the client (who pays me after all) starts grizzling I can look at the HttpSessionListener thing recommended by Chris earlier. Thanks to all for taking the time to reply. This list truly is 'the dogs' --Lyallex Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: UTF-8 handling differs between two servlets within the same application
Hi. Christoph Pirkl wrote: [...] Not being a Tomcat/Websphere expert myself, but having had to track down similar problems before, just a couple of notes : If this is true : Both forms use the post-method. then the userid and password are sent in the body of the request, not in the URI. and thus this We added URIEncoding=UTF-8 in the connector, as suggested in various posts we found googling the problem... unfortunately to no avail. .. should not have any effect, because if the name matches the function, it would affect only the URI, not the body. On the other hand : Content of both HTML-pages is declared as UTF-8. How exactly ? There are 3 elements that can play a role : a) the HTTP header Content-type: that comes from the server, along with the html form b) a possible meta http-equiv=Content-type .. tag in the html document containing the form c) a Accept-charset= attribute in the form tag itself You can see (a) easily with, for instance, Firefox plus the add-on LiveHTTPHeaders. (b) and (c) can be seen with view page source. In Firefox, this will also show you what charset Firefox thinks the page is. I am not saying that this is your problem, just that it could be, and that you should make 100% sure of the above elements before you look further in Tomcat/Websphere problems. A slight difference in any of the above, could cause the browser to send things to the server a bit differently. There are also differences between browsers in that respect, IE versions in particular being often inconsistent. André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help in Tomcat 6.0
Hi, I installed Tomcat 6.0, but whenever we run the JSP file, I am getting the following error: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory with some stack trace. But the same page, I am able to run in Tomcat 5.5 What could be the problem ? Please help me. Or If you give me some sample page which runs in Tomcat 6.0, it will be fine. Regards, Ajay
Re: UTF-8 handling differs between two servlets within the same application
Christoph; We used to have the same issue two years ago with older version of tomcat 4.x . And yes it was working just nice with Websphere. We resolved that but just adding a filter that would always set the encoding to utf8. namely ... in web.xml filter filter-nameCharEncoding/filter-name filter-classcom.company.ipo.utils.CharSetFilter/filter-class /filter filter-mapping filter-nameCharEncoding/filter-name servlet-nameaction/servlet-name /filter-mapping and the class is ... public class CharSetFilter implements Filter { public void destroy() { } public void doFilter(ServletRequest request , ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(UTF-8); chain.doFilter(request,response); } public void init(FilterConfig arg0) throws ServletException { } } On Mon, Jun 23, 2008 at 1:38 PM, Christoph Pirkl [EMAIL PROTECTED] wrote: Hi, we are developing an application, where we experience an interesting UTF-8 related behaviour. For the development the team mostly uses Tomcat, since the deployment is much faster and nicer. All tests are repeated on WebSphere, because that is what our customer runs. We are running a Tomcat environment Tomcat 6.0.16 Java 1.6 - 6 Struts 1.2.9 RHEL 4 and Windows XP / SP2 and a WebSphere environment WebSphere 6.0.2.17 Java 1.4 (shipped with WS) Struts 1.2.9 RHEL 4 There is a login action and an action where the user can change his password. Both forms use the post-method. Content of both HTML-pages is declared as UTF-8. We use an encoding filter (Tomcat only) as described in: http://wiki.apache.org/tomcat/Tomcat/UTF-8 Funny thing is: One of the servlets (login) works as expected. Username and password are in proper UTF-8 encoding. The other servlet does not receive proper UTF-8. This way the password-hashes are corrupted if the user types in non-ANSI chars (i.e. every char that needs multibyte encoding in UTF-8). The user then cannot log into the application. In both cases the filter code is executed, we verified that with a debugger. Tracing the client-server communication with WireShark shows that the Web-Browser sends identical password data as a result of both forms. In the request object on the other hand the strings differ if a special character was entered. We checked that with a debugger by setting a breakpoint in the encoding filter. We added URIEncoding=UTF-8 in the connector, as suggested in various posts we found googling the problem... unfortunately to no avail. If I'm not totally mistaken there is no application code run before the filter, so either we are making a mistake that has slipped us (quite possible) or we might have found a rare bug in Tomcat. On WebSphere the same code works without a problem. I would appreciate any kind of hint, since developing on Tomcat is much more fun than on WebSphere. Thanks for your help in advance and with kind regards, Christoph. _ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidungedt=1ptnrid=230 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards, Youssef
RE: UTF-8 handling differs between two servlets within the same application
Hi Youssef, thank you for your tip, but we are already using a filter that does exactly the same thing. We also set the character encoding in the reset and validation methods of all action forms. Is it possible, that this character encoding filter is called too late, i.e. when the submitted request parameters are already processed? Kind regards, Christoph. Date: Mon, 23 Jun 2008 15:54:36 +0300 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: UTF-8 handling differs between two servlets within the same application Christoph; We used to have the same issue two years ago with older version of tomcat 4.x . And yes it was working just nice with Websphere. We resolved that but just adding a filter that would always set the encoding to utf8. namely ... in web.xml CharEncoding com.company.ipo.utils.CharSetFilter CharEncoding action and the class is ... public class CharSetFilter implements Filter { public void destroy() { } public void doFilter(ServletRequest request , ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(UTF-8); chain.doFilter(request,response); } public void init(FilterConfig arg0) throws ServletException { } } On Mon, Jun 23, 2008 at 1:38 PM, Christoph Pirkl wrote: Hi, we are developing an application, where we experience an interesting UTF-8 related behaviour. For the development the team mostly uses Tomcat, since the deployment is much faster and nicer. All tests are repeated on WebSphere, because that is what our customer runs. We are running a Tomcat environment Tomcat 6.0.16 Java 1.6 - 6 Struts 1.2.9 RHEL 4 and Windows XP / SP2 and a WebSphere environment WebSphere 6.0.2.17 Java 1.4 (shipped with WS) Struts 1.2.9 RHEL 4 There is a login action and an action where the user can change his password. Both forms use the post-method. Content of both HTML-pages is declared as UTF-8. We use an encoding filter (Tomcat only) as described in: http://wiki.apache.org/tomcat/Tomcat/UTF-8 Funny thing is: One of the servlets (login) works as expected. Username and password are in proper UTF-8 encoding. The other servlet does not receive proper UTF-8. This way the password-hashes are corrupted if the user types in non-ANSI chars (i.e. every char that needs multibyte encoding in UTF-8). The user then cannot log into the application. In both cases the filter code is executed, we verified that with a debugger. Tracing the client-server communication with WireShark shows that the Web-Browser sends identical password data as a result of both forms. In the request object on the other hand the strings differ if a special character was entered. We checked that with a debugger by setting a breakpoint in the encoding filter. We added URIEncoding=UTF-8 in the connector, as suggested in various posts we found googling the problem... unfortunately to no avail. If I'm not totally mistaken there is no application code run before the filter, so either we are making a mistake that has slipped us (quite possible) or we might have found a rare bug in Tomcat. On WebSphere the same code works without a problem. I would appreciate any kind of hint, since developing on Tomcat is much more fun than on WebSphere. Thanks for your help in advance and with kind regards, Christoph. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards, Youssef _ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidungedt=1ptnrid=230 - 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: Windows Task Manager - tomcat processes
From: Andrew Hole [mailto:[EMAIL PROTECTED] Subject: Windows Task Manager - tomcat processes If I have more than one tomcat instance installed and started, how do I now wich process in task manager corresponds to the tomcat instance? Since each Tomcat must be using distinct ip:port combinations, you can use netstat -ano to determine the process id for the each Tomcat's port. - 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]
Re: UTF-8 handling differs between two servlets within the same application
On Mon, Jun 23, 2008 at 4:29 PM, Christoph Pirkl [EMAIL PROTECTED] wrote: Hi Youssef, thank you for your tip, but we are already using a filter that does exactly the same thing. We also set the character encoding in the reset and validation methods of all action forms. I don't think you need to encode again in the reset or validation. I am not quite sure if calling setCharacterEncoding twice would be the problem here. but just try to remove the redundant ones. Is it possible, that this character encoding filter is called too late, i.e. when the submitted request parameters are already processed? Not sure, but if you have other filters they might process the request before your encoding filter. Kind regards, Christoph. Date: Mon, 23 Jun 2008 15:54:36 +0300 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: UTF-8 handling differs between two servlets within the same application Christoph; We used to have the same issue two years ago with older version of tomcat 4.x . And yes it was working just nice with Websphere. We resolved that but just adding a filter that would always set the encoding to utf8. namely ... in web.xml CharEncoding com.company.ipo.utils.CharSetFilter CharEncoding action and the class is ... public class CharSetFilter implements Filter { public void destroy() { } public void doFilter(ServletRequest request , ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(UTF-8); chain.doFilter(request,response); } public void init(FilterConfig arg0) throws ServletException { } } On Mon, Jun 23, 2008 at 1:38 PM, Christoph Pirkl wrote: Hi, we are developing an application, where we experience an interesting UTF-8 related behaviour. For the development the team mostly uses Tomcat, since the deployment is much faster and nicer. All tests are repeated on WebSphere, because that is what our customer runs. We are running a Tomcat environment Tomcat 6.0.16 Java 1.6 - 6 Struts 1.2.9 RHEL 4 and Windows XP / SP2 and a WebSphere environment WebSphere 6.0.2.17 Java 1.4 (shipped with WS) Struts 1.2.9 RHEL 4 There is a login action and an action where the user can change his password. Both forms use the post-method. Content of both HTML-pages is declared as UTF-8. We use an encoding filter (Tomcat only) as described in: http://wiki.apache.org/tomcat/Tomcat/UTF-8 Funny thing is: One of the servlets (login) works as expected. Username and password are in proper UTF-8 encoding. The other servlet does not receive proper UTF-8. This way the password-hashes are corrupted if the user types in non-ANSI chars (i.e. every char that needs multibyte encoding in UTF-8). The user then cannot log into the application. In both cases the filter code is executed, we verified that with a debugger. Tracing the client-server communication with WireShark shows that the Web-Browser sends identical password data as a result of both forms. In the request object on the other hand the strings differ if a special character was entered. We checked that with a debugger by setting a breakpoint in the encoding filter. We added URIEncoding=UTF-8 in the connector, as suggested in various posts we found googling the problem... unfortunately to no avail. If I'm not totally mistaken there is no application code run before the filter, so either we are making a mistake that has slipped us (quite possible) or we might have found a rare bug in Tomcat. On WebSphere the same code works without a problem. I would appreciate any kind of hint, since developing on Tomcat is much more fun than on WebSphere. Thanks for your help in advance and with kind regards, Christoph. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards, Youssef _ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidungedt=1ptnrid=230 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards, Youssef
Re: Tomcat Connection Pooling - wait_timeout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, Martin wrote: | I see autoReconnect functionality in mysql-connector-java-5.1.6.tar.gz | driver distro located at | http://ftp.plusline.de/mysql/Downloads/Connector-J/ Why not go to the canonical source? http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html The autoReconnect feature has been in the driver since 1.1 (before it was known as Connector/J). | I dont see autoreconnect supported in | mysql-connector-java-3.0.15-ga-bin.jar | $MYSQL_HOME/mysql-connector-3.0.15-GAgrep -S -l autoreconnect *.* | http://drc-dev.ohiolink.edu/browser/fedora-core/trunk/lib/mysql-connector-java-3.0.15-ga-bin.jar?rev=56 | here is the testcase which extercises the 5.1.6 functionality: | Properties props = new Driver().parseURL(BaseTestCase.dbUrl, null); | props.setProperty(autoReconnect, true); | | | | FWIW | Martin- | - Original Message - From: Christopher Schultz | [EMAIL PROTECTED] | To: Tomcat Users List users@tomcat.apache.org | Sent: Saturday, June 21, 2008 11:33 AM | Subject: Re: Tomcat Connection Pooling - wait_timeout | | | Thomas, | | Thomas Haines wrote: | | mysql connector 5.1.6 | | Is that a pre-release version, or did 5.1 become GA recently? | | | ERROR (21-06-08 07:59) [servlets.ViewEmail] | | com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last | packet | | successfully received from the server was 46859 seconds ago.The last | | packet sent successfully to the server was 46859 seconds ago, which is | | longer than the server configured value of 'wait_timeout'. You should | | consider either expiring and/or testing connection validity before use | | in your application, increasing the server configured values for client | | timeouts, or using the Connector/J connection property | | 'autoReconnect=true' to avoid this problem. | | That's strange... the error message says use autoReconnect but the | driver documentation says don't use autoReconnect anymore. In either | case, you're better off setting a validationQuery attribute in your | Resource that can check for good connections (like 'SELECT 1'). | | | a) downgrade to MySQL Connector/J 5.0.8 and see if this fixes it; | | This may fix your problem, but probably not. The problem with | autoReconnect is that it doesn't fix your current connection for the | current query -- your first post-disconnect query will fail, and then | the next one will succeed. | | | b) add a while (!verified attempts2) type loop in getConnection() | | method to query the DB using a minimal query and then catch the first | | dead connection. | | Using 'validationQuery' achieves the same goal without modifying your | code (which is always nice). | | | I'm not overly keen on introducing the additional overhead of querying | | the DB just to check if it is valid every time a request is made for a | | connection. Does anyone have any thoughts on how I might debug/solve | | this issue? | | I think your options are to use a validationQuery (like just about | everyone else) or to create connections from scratch whenever you need | them. 'SELECT 1' overhead is very low. | | I seem to recall that newer versions of the MySQL driver could ping the | server or something like that to keep connections alive. Check the | documentation for your driver version to see if there's anything like | that. | | | I've searched widely on Google to no avail. Interestingly, | | there is another instance of tomcat communicating with MySQL on the | | machine, exactly the same configuration, that doesn't suffer these | | woes. | | What are the differences? Is it possible that the db connection just | never times out (because it gets light, regular traffic)? | | -chris | - - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] | | | - | To start a new topic, e-mail: users@tomcat.apache.org | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfvbYACgkQ9CaO5/Lv0PC2oACgpmvNzIJa/azxVqxOgo+hQGs2 LHYAn3kp4DpeTC2tq8oHXM4YM83/Ubuw =bnb9 -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]
Re: Tomcat Connection Pooling - wait_timeout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, Martin wrote: | I see autoReconnect functionality in mysql-connector-java-5.1.6.tar.gz | driver distro located at | http://ftp.plusline.de/mysql/Downloads/Connector-J/ Why not just go to the canonical source? MySQL's website has everything you need. | I dont see autoreconnect supported in | mysql-connector-java-3.0.15-ga-bin.jar | $MYSQL_HOME/mysql-connector-3.0.15-GAgrep -S -l autoreconnect *.* | http://drc-dev.ohiolink.edu/browser/fedora-core/trunk/lib/mysql-connector-java-3.0.15-ga-bin.jar?rev=56 You should try the -i switch. Or, you could save yourself a lot of time and read the documentation: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html The autoReconnect feature has been in the driver since version 1.1, which was before it was called Connector/J. The documentation says: The use of this feature is not recommended, because it has side effects related to session state and data consistency when applications don't handle SQLExceptions properly, and is only designed to be used when you are unable to configure your application to handle SQLExceptions resulting from dead and stale connections properly. Alternatively, investigate setting the MySQL server variable wait_timeout to some high value rather than the default of 8 hours. (paragraph break added by me). | FWIW Very little, in fact. :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfvjYACgkQ9CaO5/Lv0PCbyQCbBqWluOesJIafZ/VL/qERdUlN BHIAoIWt2hviLMSePjKPoHE0fKnsZgjs =6zbw -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]
RE: [Logging] Facility Specific Properties
From: Rainer Jung [mailto:[EMAIL PROTECTED] Subject: Re: [Logging] Facility Specific Properties if (myLogger.getLevel() = Level.WARNING) { myLogger.warn('This is a warning'); } More precisely: if (log.isDebugEnabled()) log.debug(SOMETHING); I think one of the confusing things about the current logging environment is the lack of documentation about the mapping between commons-logging and java.util.logging levels and APIs, as implemented by JULI. For example, c-l has six logging levels, whereas as j.u.l has seven; some of the mappings are obvious, some are not. (Yes, I did find the mappings in the DirectJDKLog.java source.) In the above snippet from the last two e-mails, Ole uses java.util.logging APIs, and Rainer responds with commons-logging; it's not clear when it's appropriate to use one or the other. - 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]
java.lang.LinkageError
Hi! I have a problem with the configuration of the logs in Tomcat (it puts the logs in Windows/System32) and also I get an error that doesn't let me start the service: 16:24:20,234 (Thread-1) ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/authz]] - StandardWrapper.Throwable java.lang.LinkageError: java/util/logging/LogRecord at com.evidian.security.authz.local.audit.AuditFilter.isLoggable(AuditFilter.java:25) at com.evidian.security.authz.tools.ThreadLocalLogHandler.isLoggable(ThreadLocalLogHandler.java:106) at com.evidian.security.authz.tools.ThreadLocalLogHandler.publish(ThreadLocalLogHandler.java:83) at java.util.logging.Logger.log(Unknown Source) at java.util.logging.Logger.doLog(Unknown Source) at java.util.logging.Logger.logp(Unknown Source) at org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java:91) at org.apache.commons.logging.impl.Jdk14Logger.debug(Jdk14Logger.java:103) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1215) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at com.evidian.security.authz.server.AuthorizationServlet.init(AuthorizationServlet.java:158) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4087) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:800) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:695) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) 16:24:20,250 (Thread-1) ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/authz]] - La servlet /authz a généré une exception load() javax.servlet.ServletException: Servlet.init() pour la servlet Evidian Authorization Service a généré une exception at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1109) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4087) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:800) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:695) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440) at
Re: Tomcat Connection Pooling - wait_timeout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas, Thomas Haines wrote: | I've used the validation query within the Resource as you suggested. | This has stopped the first connection after a while is a dead one | problem, and all is well in the land of my webapp! I was reading the changelog for Connector/J this morning (have to see if 5.1.6 will cause us any problems upgrading from 5.0.8) and I saw this in the 5.0.8 changes: Specifying a validation query in your connection pool that starts with /* ping */ _exactly_ will cause the driver to instead send a ping to the server and return a fake result set (much lighter weight), and when using a ReplicationConnection or a LoadBalancedConnection, will send the ping across all active connections. So, you might be able to lessen the performance impact of your velicationQuery queries by using the indicated query which seems a bit lighter wright. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfwZQACgkQ9CaO5/Lv0PBsVgCgjQIBdGw/DXTcJVTv+Bz2Smzr blwAn1QgSlCOoaH53JsN5uItgb8amPof =m07b -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]
Re: UTF-8 handling differs between two servlets within the same application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Youssef, Youssef Mohammed wrote: | I don't think you need to encode again in the reset or validation. I am not | quite sure if calling setCharacterEncoding twice would be the problem here. | but just try to remove the redundant ones. At best, calling setCharacterEncoding after parameters have been read does nothing. At worst, it will throw an IllegalStateException (which would be better, IMO). | Is it possible, that this character encoding filter is called too late, | i.e. when the submitted request parameters are already processed? | | Not sure, but if you have other filters they might process the request | before your encoding filter. Absolutely. If another filter before your utf8 filter calls anything like request.getParameter, then the parameters will be read using the current encoding. You should make sure that your filter is the first one to run in the chain. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfwx8ACgkQ9CaO5/Lv0PCTHwCffZtngxoYN+xlPDJEos/eNBYc AJYAnAj8q8Qs/t9TNsBjxyc09zIsNfZx =Qe0B -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]
Re: Nginx Front End
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stephen, Stephen Nelson-Smith wrote: | I'm considering looking at nginx as Apache seems somewhat resource | intensive. Has anyone on the list tried this? Does nginx support (or | need to support) ajp13? If Nginx can do HTTP proxying, you can use that instead of ajp13 if you wish. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfw5UACgkQ9CaO5/Lv0PDPwACfRKzmt2P5we/Z0/qwxHS7CkVM kjQAnjw8RpTAxbd5YgfaaPK5/0MI5Ogo =kt8P -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]
Tomcat 6.0.16 on Java SE 6 Update 6
Hi Stars, I want to use / install Tomcat 6.0.16 employing Java SE 6 update 6. The documentation on http://tomcat.apache.org/tomcat-6.0-doc/appdev/installation.html says that Tomcat 6.0 was designed to run on J2SE 5.0. Will it run properly on Java SE 6 update 6? Is anyone using the same set up as i would like to use? Thanks in advance. Regards Rakesh D. From Chandigarh to Chennai - find friends all over India. Go to http://in.promos.yahoo.com/groups/citygroups/
Re: Tomcat 6.0.16 on Java SE 6 Update 6
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rakesh, rakesh dharangaonkar wrote: | I want to use / install Tomcat 6.0.16 employing Java SE 6 update 6. | The documentation on | | http://tomcat.apache.org/tomcat-6.0-doc/appdev/installation.html | | says that Tomcat 6.0 was designed to run on J2SE 5.0. | | Will it run properly on Java SE 6 update 6? Yes. The documentation should probably say designed to run on J2SE 5.0 /or later/.. | Is anyone using the same set up as i would like to use? I don't personally use J2SE 6, but many on the list do use it with Tomcat 6 with no problems. Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhfxoMACgkQ9CaO5/Lv0PBOQwCgprgPY3T5AZ4zpY3A8xW/OxkP fRgAn1RO3oH2BrOC9xGF/GsoPd7fEwKP =2YjG -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]
Tomcat 6.0 Clustering
Hi Guys, I have a web application which runs on Tomcat. There will be at any given time a maximum of 20 users. So, the traffic is not much. However, the application is kind of mission critical and therefore, we can not afford any downtime. I am thinking Clustering would be an option where if one server goes down, the other picks up. Could any one please suggest what would be the best option. Also, if you could point me to a good tutorial to accomplish this. may be a step-by-step example. Thank you, --Sam - 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: Tomcat 6.0 Clustering
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sam, Shamshad Ansari wrote: | I have a web application which runs on Tomcat. There will be at any | given time a maximum of 20 users. So, the traffic is not much. | However, the application is kind of mission critical and therefore, we | can not afford any downtime. I am thinking Clustering would be an | option where if one server goes down, the other picks up. Is it acceptable for users to have to re-login in the event of a server failure? If so, you can just set up simply clustering via mod_jk, which binds a particular session to a single back-end machine. You don't have to use distributable sessions or worry about sending data around the cluster so the data is available everywhere just in case a server goes down. | Could any one please suggest what would be the best option. Also, if | you could point me to a good tutorial to accomplish this. may be a | step-by-step example. You should definitely start here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html There is quite a bit of information in there, including background info and step-by-step instructions. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf0SIACgkQ9CaO5/Lv0PB5nACfaGFZgtF+CX1OMH96jAB5DOh8 A+wAmwcr/WX6QMn5DqhahKRO0tb9QGMK =imH8 -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]
Re: [Logging] Facility Specific Properties
SNIP Close to that. Since Catalina and localhost are names of elements in server.xml, and those names can be changed, this logger name is generated dynamically. So you won't find it verbosely in the code. Look at method logName() in ContainerBase.java. Thanks for the tip - I will do. No, the call log.info(SOMETHING) will need to calculae something, before it really calls the error method of the logger, which then immediately might notice, that the configured log level doesn't allow handling an info message. Now SOMETHING is quite often not a simple string, but e.g. a localised message, an exception text, a string concatenation containing some variable data etc. Java will first calculate SOMETHING, before it jumps into the logger method. If you have a lot of debug log statements, which get called during every request, it will have a noticeable impact on performnce. OK - I get it ... hopefully :-). We want to do something like: if (log.isDebugEnabled()) { //Calculate SOMETHING - Very expensive String SOMETHING = SOMETHINGA + SOMETHINGELSE; log.debug(SOMETHING); } So if we are only interested in SEVERE messages, then it seems like it would be a good thing to set all of the Tomcat loggers to only log severe messages? Is there a simple way to do that? I would think that the Tomcat loggers get their log level from a root logger, and that if I set the log level on that logger, then it automatically sets it on all the other loggers, unless I directly override the logging level as with Facility specific properties? Warnings are not frequent enough to justify the if statement. So I assume the logic is that most running instances will be interested in warnings, hence just skip the if? SNIP Because I know that I'll only be doing myLogger.warn('This is really severe'); type messages. Then if someone wanted to make my logging calls really efficient they could just set the level of my logger to SEVERE and since I only make warn calls on myLogger, all the calls will be as efficient as possible with Java logging...without removing the logging statement completely that is? Hmmm, didn't get the point. That's OK. I didn't either :-). SNIP But: the loggers with the strange names ...Catalina...localhost...mycontext are generated for each context, and can be used by the webapp developer as part of the servlet API (the context logger). So the webapp producer might have some documentation, what kind of log messages he creates at which level. OK - so /mywebapp could grab the Logger for the /manager context and make logging calls on it, which assuming the default configuration would end up in the manager prefixed log? head on why I'd want to muck around with the Facility Specific Properties...Maybe the documentation just mentioned them to say Here - See - You can Muck! and then didn't say anything else because theres no point in mucking...? Yes, maybe. I guess when the day comes for mucking, I'll know it :-). Thanks again, - Ole - 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: UTF-8 handling differs between two servlets within the same application
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Youssef, Youssef Mohammed wrote: Guys, I am sorry to butt in again, but are you *really* sure that the problem is not earlier in the chain than what you think ? I have read the article at the link given earlier : http://wiki.apache.org/tomcat/Tomcat/UTF-8 and I am quite sure that what is said in that article is wrong, or at least incomplete. The article seems to assume that whatever the browser sends is always iso-8859-1, and that at the server level you can then just go and decode it into utf-8. That is wrong, I can assure you. Browsers will send utf-8 if the right conditions are met, and you will corrupt that data if you force it through a second encoding/decoding. Browsers will also sometimes send iso-8859-1, if you are not careful or if the browser is buggy. It happens. (iso-8859-1 is the default in HTTP, so if you do not specify things diferent, that is what you'll get). In an ideal world, when a browser sends a string parameter via a POST, each parameter value should be enclosed in a part with a header and a content. The header of the part should have a line Content-type: text/plain; charset=x and the content of that part should then be in that charset encoding. The receiving server should decode each part of the POST, and if it does it's job right, should look at the Content-type header, and use it to decode the corresponding parameter into Unicode (if it isn't yet so), because that is what the request.getParameter() would expect to receive, since Java's internal charset is Unicode. I know you may have examined the value sent, using some snooping software. But even if the value is the same in terms of bytes, but the Content-type header is different, the final result may not be what you expect. It is quite possible that Tomcat's innards do not do things correctly when they decode a POST, and just deliver the raw parameter value as received. But that would surprise me, and I would submit that it would then be a bug. André - 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: Tomcat 6.0 Clustering
Thanks Chris, Re-login may be accepted. I will follow your instruction and the URL you provided. Thanks again, --Sam On Mon, Jun 23, 2008 at 12:36 PM, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sam, Shamshad Ansari wrote: | I have a web application which runs on Tomcat. There will be at any | given time a maximum of 20 users. So, the traffic is not much. | However, the application is kind of mission critical and therefore, we | can not afford any downtime. I am thinking Clustering would be an | option where if one server goes down, the other picks up. Is it acceptable for users to have to re-login in the event of a server failure? If so, you can just set up simply clustering via mod_jk, which binds a particular session to a single back-end machine. You don't have to use distributable sessions or worry about sending data around the cluster so the data is available everywhere just in case a server goes down. | Could any one please suggest what would be the best option. Also, if | you could point me to a good tutorial to accomplish this. may be a | step-by-step example. You should definitely start here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html There is quite a bit of information in there, including background info and step-by-step instructions. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf0SIACgkQ9CaO5/Lv0PB5nACfaGFZgtF+CX1OMH96jAB5DOh8 A+wAmwcr/WX6QMn5DqhahKRO0tb9QGMK =imH8 -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] - 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: Windows Task Manager - tomcat processes
I've found Process Explorer miles better than the built in Task Manager Windows provides. It'll provide all the info you need to know which is which: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx --David Andrew Hole wrote: Hi! If I have more than one tomcat instance installed and started, how do I now wich process in task manager corresponds to the tomcat instance? In task manager I only see things like that: tomcat5.exe tomcat5.exe tomcat5.exe Thanks a lot A. - 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: UTF-8 handling differs between two servlets within the same application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, André Warnier wrote: | I am sorry to butt in again, but are you *really* sure that the problem | is not earlier in the chain than what you think ? | I have read the article at the link given earlier : | http://wiki.apache.org/tomcat/Tomcat/UTF-8 | and I am quite sure that what is said in that article is wrong, or at | least incomplete. The article seems to assume that whatever the browser | sends is always iso-8859-1, and that at the server level you can then | just go and decode it into utf-8. That is wrong, I can assure you. You're right: you can't just assume that the incoming data is UTF-8. The problem is that browsers often do not send a Content-Type encoding string along with all POST requests. They /should/, but sometimes they do not. In these cases, the server is left to guess. Guessing is hard, but most browsers act somewhat predictably... | Browsers will send utf-8 if the right conditions are met, and you will | corrupt that data if you force it through a second encoding/decoding. | Browsers will also sometimes send iso-8859-1, if you are not careful or | if the browser is buggy. It happens. (iso-8859-1 is the default in | HTTP, so if you do not specify things differently, that is what you'll get). Most browsers will send request #1 in the same encoding that was used for response #0. That is, if a page is encoded in UTF8, then the encoding using to submit from that page (unless otherwise specified) will use the same encoding -- even if that encoding is not specified in the Content-Type header. | In an ideal world, when a browser sends a string parameter via a POST, | each parameter value should be enclosed in a part with a header and a | content. The header of the part should have a line | Content-type: text/plain; charset=x | and the content of that part should then be in that charset encoding. parting is not required, here. You just encode the whole POST with the same encoding, and use the standard Content-Type header including the encoding. Now, back to the server. No server should ever clobber an encoding specified by the client. The filter example on this page needs to be fixed so that the encoding is only set if one is not detected. This is a BIG BUG in the filter shown on that page, and someone should fix it (maybe I will... I just registered for the Wiki). If you /know/ that your pages are being sent in UTF-8 and you make a reasonable assumption that requests with no Content-Type encoding will use the encoding of the previous response, then the filter listed on the aforementioned page is acceptable (again, with a check for an existing content type encoding). | It is quite possible that Tomcat's innards do not do things correctly | when they decode a POST, and just deliver the raw parameter value as | received. But that would surprise me, and I would submit that it would | then be a bug. Tomcat does, in fact, decode the parameters properly. That's what the setCharacterEncoding parameter does -- it sets the character encoding that will be used by any Reader used to read the request's body. Your code does not have to do anything special. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf4xkACgkQ9CaO5/Lv0PBWuACePccDgzP9kudNTq6v7d88qe98 KowAoILM6V+uJESshpiSQOGfAnvdDGA1 =4a8J -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]
Re: [Logging] Facility Specific Properties
Ole Ersoy wrote: No, the call log.info(SOMETHING) will need to calculae something, before it really calls the error method of the logger, which then immediately might notice, that the configured log level doesn't allow handling an info message. Now SOMETHING is quite often not a simple string, but e.g. a localised message, an exception text, a string concatenation containing some variable data etc. Java will first calculate SOMETHING, before it jumps into the logger method. If you have a lot of debug log statements, which get called during every request, it will have a noticeable impact on performnce. OK - I get it ... hopefully :-). We want to do something like: if (log.isDebugEnabled()) { //Calculate SOMETHING - Very expensive String SOMETHING = SOMETHINGA + SOMETHINGELSE; log.debug(SOMETHING); } Close, because of the if, we would usually simply do if (log.isDebugEnabled()) { //Calculate something very expensive log.debug(SOMETHINGA + SOMETHINGELSE); } but it has nearly the same meaning and behaviour as your more explicit example. The concatenation will be done before actually calling the debug method. So if we are only interested in SEVERE messages, then it seems like it would be a good thing to set all of the Tomcat loggers to only log severe messages? Is there a simple way to do that? I would think that the Tomcat loggers get their log level from a root logger, and that if I set the log level on that logger, then it automatically sets it on all the other loggers, unless I directly override the logging level as with Facility specific properties? Should be .level = SEVERE But even with the default config, Tomcat doesn't log much. So keeping the default usually is safer, because you actually don't know, how individual developers decide between using error and severe. So at least error should be logged to. If there is a sub component, that logs to much, you should restrict this component and not the whole server. Warnings are not frequent enough to justify the if statement. So I assume the logic is that most running instances will be interested in warnings, hence just skip the if? Exactly. For log.warn(), developers don't use the isWarnEnabled() idiom. But: the loggers with the strange names ...Catalina...localhost...mycontext are generated for each context, and can be used by the webapp developer as part of the servlet API (the context logger). So the webapp producer might have some documentation, what kind of log messages he creates at which level. OK - so /mywebapp could grab the Logger for the /manager context and No it would grab the logger for the context, which will automatically be the one for [/mywebapp] and not [/manager]. It can't log to the logger of another context. Look at javax.servlet.ServletContext.log(). make logging calls on it, which assuming the default configuration would end up in the manager prefixed log? So now you should be able to write an improved version of the logging documentation page ;) Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pointers in tomcat
Hi! I have a web page that is deployed as ROOT.war. In my web app I have created a connector for https that points to the www.mysite.com. My problem is that I also want it to point to mysite.com without the www. I have only bought www.mysite.com from thawte so the browser complains about the mysite.com. Is there anyway of redirecting mysite.com to www.mysite.com? -- View this message in context: http://www.nabble.com/Pointers-in-tomcat-tp18075070p18075070.html 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: Pointers in tomcat
You should get your registor (thawte) to add the redirect to your domain. No need to change webapp. Walter -Original Message- From: Mathias P.W Nilsson [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 1:18 PM To: users@tomcat.apache.org Subject: Pointers in tomcat Hi! I have a web page that is deployed as ROOT.war. In my web app I have created a connector for https that points to the www.mysite.com. My problem is that I also want it to point to mysite.com without the www. I have only bought www.mysite.com from thawte so the browser complains about the mysite.com. Is there anyway of redirecting mysite.com to www.mysite.com? -- View this message in context: http://www.nabble.com/Pointers-in-tomcat-tp18075070p18075070.html 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] - 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: UTF-8 handling differs between two servlets within the same application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, Christopher Schultz wrote: | The filter example on this page needs to be | fixed so that the encoding is only set if one is not detected. This is a | BIG BUG in the filter shown on that page, and someone should fix it | (maybe I will... I just registered for the Wiki). Okay, I have fixed the filter to it does not clobber client-specified character encoding. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf64sACgkQ9CaO5/Lv0PAXjQCeJ79ftq4Ai5q2QTtnwBkifLtp weoAnjeNcpDtzExJvCSQWGvwOGE98lEM =SAzM -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]
Re: Pointers in tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mathias, Mathias P.W Nilsson wrote: | I have a web page that is deployed as ROOT.war. In my web app I have created | a connector for https that points to the www.mysite.com. My problem is that | I also want it to point to mysite.com without the www. I have only bought | www.mysite.com from thawte so the browser complains about the mysite.com. Is | there anyway of redirecting mysite.com to www.mysite.com? Did you really only buy WWW.MYSITE.COM and not just MYSITE.COM? I didn't know you could buy a sub-level without buying a top-level. Every site I've purchased in the past has been of the form MYSITE.COM and then I was free to define *.MYSITE.COM to my choosing. If you really don't own MYSITE.COM, then there's nothing you can do to get it to redirect to WWW.MYSITE.COM. If, as I suspect, you *do* own MYSITE.COM, you just need to set up a default virtual host and have it redirect to WWW.MYSITE.COM. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf7JgACgkQ9CaO5/Lv0PD7HgCaA+PBVRE6zSdOviaVqAilrooj kCsAoJqaOI6j0JNzkfA61N4XVWUWZ+Wb =pMku -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]
RE: Pointers in tomcat
On second thought, is thawte who registered your domain or did they just provide your server certificate? Where ever you registered your domain is where you can get them to do the redirect. I think there is a small fee for this service. Walter -Original Message- From: Mathias P.W Nilsson [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 1:18 PM To: users@tomcat.apache.org Subject: Pointers in tomcat Hi! I have a web page that is deployed as ROOT.war. In my web app I have created a connector for https that points to the www.mysite.com. My problem is that I also want it to point to mysite.com without the www. I have only bought www.mysite.com from thawte so the browser complains about the mysite.com. Is there anyway of redirecting mysite.com to www.mysite.com? -- View this message in context: http://www.nabble.com/Pointers-in-tomcat-tp18075070p18075070.html 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] - 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: Pointers in tomcat
I own the domain but didn't buy a wildcard certificate. So the only thing that works is www.mysite.com for the certificate. When I type mysite.com I get to the same server but it is not ssl enabled -- View this message in context: http://www.nabble.com/Pointers-in-tomcat-tp18075070p18075744.html 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: Pointers in tomcat
How can I do this? My web app points to ROOT.war. Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaswww.mysite.com/Alias Aliasmysite.com/Alias /Host If you're hitting the same server through both URLs then your DNS sounds like it's fine. So now you just need to configure your application to redirect requests from http://mysite.com to http://www.mysite.com.You could do this using the urlRewriteFilter:- http://tuckey.org/urlrewrite/ Or alternatively if you're using Apache you could do it through mod_rewrite. Cheers, Phil. - 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: UTF-8 handling differs between two servlets within the same application
André Warnier wrote: It is quite possible that Tomcat's innards do not do things correctly when they decode a POST, and just deliver the raw parameter value as received. But that would surprise me, and I would submit that it would then be a bug. As far as I am aware, Tomcat correctly decodes parameters for all versions in all cases (provided the client sends sensible input). If you have a test case that doesn't work, that would be a bug and should be added to Bugzilla. Mark - 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: java.lang.LinkageError
From: Fátima Milla Olaya [mailto:[EMAIL PROTECTED] Subject: java.lang.LinkageError Hi! I have a problem with the configuration of the logs in Tomcat (it puts the logs in Windows/System32) and also I get an error that doesn't let me start the service: Don't suppose you'd want to tell us the version of Tomcat you're using? As well as the JDK/JRE version? java.lang.LinkageError: java/util/logging/LogRecord at com.evidian.security.authz.local.audit.AuditFilter.isLoggable(AuditFilter.java:25) According to the API doc for LinkageError: Subclasses of LinkageError indicate that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class. Looks like code in *your* product - not Tomcat - is causing the exception. Perhaps you're compiling on one JDK version and trying to run with another that's not compatible. - 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]
RE: Pointers in tomcat
The Thawte certificate is not you domain registration. Your domain registration is separate from the certificate. Since I don't know the actual domain name you are refering to, I can't look up who did you domain registration. By the way www.mysite.com is a working website, is this your actual website or is it snyltarna.se? Anyway, the people that registered your domain (network solutions, godady, thawte, etc.) can provide the redirect as a separate service (goes with domain not security certificate). Walter -Original Message- From: Mathias P.W Nilsson [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 1:50 PM To: users@tomcat.apache.org Subject: RE: Pointers in tomcat I own the domain but didn't buy a wildcard certificate. So the only thing that works is www.mysite.com for the certificate. When I type mysite.com I get to the same server but it is not ssl enabled -- View this message in context: http://www.nabble.com/Pointers-in-tomcat-tp18075070p18075744.html 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] - 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: Pointers in tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mathias, Mathias P.W Nilsson wrote: | If, as I suspect, you *do* own MYSITE.COM, you just need to set up a | default virtual host and have it redirect to WWW.MYSITE.COM. | | | How can I do this? My web app points to ROOT.war. | | Host name=localhost appBase=webapps | unpackWARs=true autoDeploy=true | xmlValidation=false xmlNamespaceAware=false | Aliaswww.mysite.com/Alias | Aliasmysite.com/Alias | /Host Unfortunately, Tomcat doesn't really have anything like Apache httpd's RedirectPermanent directive that you can assign at the server (or virtual host) level. Instead, you have to create a tiny webapp that does this for you: 1. Create a Host that matches only mysite.com and does not alias www.mysite.com. You might want to make this one the default, so you catch any other hostnames that come in. 2. Create a ROOT webapp for that host and ... 3. Use a url rewriting library like http://tuckey.org/urlrewrite/ or write your own simple redirection code 4. Deploy your real application on a the Host that matches only www.mysite.com. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhf+ZAACgkQ9CaO5/Lv0PA5CACdFkkRK9c5+i9KPhgMb+y61jM4 x9MAnRJ1kSm4FJlTMr1mC4ArhQS2Rs6j =FVve -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]
Re: [Logging] Facility Specific Properties
SNIP I think one of the confusing things about the current logging environment is the lack of documentation about the mapping between commons-logging and java.util.logging levels and APIs, as implemented by JULI. For example, c-l has six logging levels, whereas as j.u.l has seven; some of the mappings are obvious, some are not. (Yes, I did find the mappings in the DirectJDKLog.java source.) I hope the mappings are all inclusive from java.util.logging's perspective so that if I set the a level to INFO I get info, plus possibly some other level's that are greater than INFO? In other words something that should be mapped to info, does not end up corresponding to say FINE, and is thus left out? I also assume that the if developers stick to levels that are common to both java.util.logging and commons-logging, the mapping is straightforward? It's only an issue when attempting to read tomcat log statements or adding new ones right? In the above snippet from the last two e-mails, Ole uses java.util.logging APIs, and Rainer responds with commons-logging; it's not clear when it's appropriate to use one or the other. I would think that it's always appropriate to use commons logging within Tomcat and anything (java.util.logging, log4j, or commons-logging) goes for webapps? Ole - 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: UTF-8 handling differs between two servlets within the same application
Mark Thomas wrote: André Warnier wrote: It is quite possible that Tomcat's innards do not do things correctly when they decode a POST, and just deliver the raw parameter value as received. But that would surprise me, and I would submit that it would then be a bug. As far as I am aware, Tomcat correctly decodes parameters for all versions in all cases (provided the client sends sensible input). If you have a test case that doesn't work, that would be a bug and should be added to Bugzilla. Mark To the Original Poster : 1) We have it thus by a Tomcat authority (above) that Tomcat correctly decodes the POST parameters, IF they are submitted correctly by the browser. That means that it should not be necessary to add a filter, nor to literally specify a request character set, IF the form parameters are being submitted correctly by the browser. 2) You are seeing a different thing in your application, where parameters (in this case the userid or password from the form), do NOT come in as you expect (iow proper Unicode reflecting what the user typed in the form). 3) There are only two possible conclusions : a) the parameters from the form are not being submitted properly by the browser, whatever the reason is. b) the parameters are being submitted properly by the browser, but there is a bug in Tomcat. I would imagine that if Tomcat had a bug in that respect, it would affect a lot of applications, and would have been all over this forum and others many times already. That does not seem to be the case. So I would suggest that what you would need to investigate first is : are the parameters *really* coming in properly from the browser ? If not, there are many possible reasons, which can be checked out one by one and eliminated. In the process, it will also make the application more robust. And it would also make your life easier if you could avoid a filter, and if the same application would work properly under both Tomcat and Websphere. If you agree, a question to start in that process : In the login page, the form element should have the following attributes : form method=POST enctype=multipart/form-data accept-charset=UTF-8 ... Does it ? Ref : http://www.w3.org/TR/html401/interact/forms.html#submit-format and in particular : 17.13.4 Form content types (among other things, the spec says that this is the only valid way to submit non-ascii data - such as passwords containing accented characters) André - 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 resources
Hi people! I´m working with tomcat for years, in intranet envoiroment. And now i need to put some works in anothers servers, and then i talk about tomcat with another people, but most servers admins tell me that TomCat need too much resoruces from machines. Is that right ?? Thanks for your response. Marcos - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Faster resource servlet
Hi! I have made a resource servlet to handle static content outside of tomcat, wicket. It looks like this package se.edgesoft.hairless.web.resource; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.context.support.WebApplicationContextUtils; import se.edgesoft.hairless.application.HairlessApplicationSettings; /** * Resource servlet for getting images and flash movies * @author Mathias Nilsson * */ public class FileResourceServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static ServletConfig config; File file; protected Object getBean(String name) { Object obj = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext()).getBean(name); return obj; } public void destroy() { config = null; } public ServletConfig getServletConfig() { return config; } public String getServletInfo() { return Resource servlet for Hairless; } public void init(ServletConfig servletConfig ) throws ServletException { config = servletConfig; } public HairlessApplicationSettings getHairlessApplicationSettings(){ return (HairlessApplicationSettings)getBean( hairlessApplicationSettings ); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { file = new File( getHairlessApplicationSettings().getFileResourcePath() , request.getRequestURI().replace( request.getContextPath(), ) ); ServletContext context = getServletConfig().getServletContext(); String mimetype = context.getMimeType( file.getAbsolutePath() ); response.setContentType( (mimetype != null) ? mimetype : application/octet-stream ); response.setContentLength( (int)file.length() ); int length = 0; ServletOutputStream op = response.getOutputStream(); byte[] bbuf = new byte[1024]; DataInputStream in = new DataInputStream(new FileInputStream(file)); while ((in != null) ((length = in.read(bbuf)) != -1)) { op.write(bbuf,0,length); } in.close(); op.flush(); op.close(); } catch (Exception e) { //e.printStackTrace(); } } } Maybe I'm missing something but I think it is a little slow. Should I take something more into consideration? -- View this message in context: http://www.nabble.com/Faster-resource-servlet-tp18079759p18079759.html 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: UTF-8 handling differs between two servlets within the same application
Mark Thomas wrote: I tend to use the following as a starting point to check my config is OK. It is also useful to compare headers etc for your application against the headers from this simple test case. http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q4 This is a bit outside the scope of this thread, but as someone confronted with this kind of character sets issues in the web all the time, I feel I have to say that the comment at the beginning of that example can be misleading, and in my view should be taken out. It is of a nature to induce people into doing things they should not, and which would always bite them back in the end. (For the same reason, I believe that all the methods or parameters dealing with URI encoding should be banned). I can make a long case, but the summary is : don't use GET with forms, if you want to have any luck with applications that may have to handle input characters other than US-ASCII (as all web applications will have to, sooner or later; think of smileys). The situation is already confusing enough with POSTed forms, without adding extra problem sources. The HTML 4.01 spec (and, I suspect, the XHTML also) mentions this as follows, in the same RFC, same section : Note. The get method restricts form data set values to ASCII characters. Only the post method (with enctype=multipart/form-data) is specified to cover the entire [ISO10646] character set. (http://www.w3.org/TR/html401/interact/forms.html#submit-format 17.13.4 Form content types ) Also see RFC3986. André - 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: [Logging] Facility Specific Properties
SNIP No it would grab the logger for the context, which will automatically be the one for [/mywebapp] and not [/manager]. It can't log to the logger of another context. Look at javax.servlet.ServletContext.log(). OOh - OK - The gears are starting to turn...maybe. The context logger configuration configures the ServletContext logger. I just erased that from my To understand list, since it seems I could just use a pre configured logger per Servlet, but it's good to know. make logging calls on it, which assuming the default configuration would end up in the manager prefixed log? So now you should be able to write an improved version of the logging documentation page ;) Well after having spent a few days reading java logging stuff, commons logging, LogManager stuff, and the Logging for Dummies thread, I'd say that the Tomcat Logging Official documentation hits the nail right on the head. It's about as brief and concise as can be (I'm still going to put in a ticket for a spelling mistake and the context stuff at the end), and gives all the necessary little hooks that someone can branch off on to figure out what's going on. I think the primary cause of panic for Squirl brained individuals, like myself, is that once the branching begins there's a massive (Keep in mind - squirrel brain) amount of information that has to be analyzed and Felt/Experienced. For instance I spent time playing with java logging to get a reasonable grip after reading through some tutorials and the overview. So what I'll do is go through the Logging for Dummies thread again and this thread and come with with additions to the logging FAQ on the wiki. I'll do my best to put in an answer + example, but I might need help still. Thanks again. Hope to have a list compiled asap! Ole - 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: server resources
- Original Message - From: Marcos Molina [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, June 23, 2008 11:49 PM Subject: server resources Hi people! I´m working with tomcat for years, in intranet envoiroment. And now i need to put some works in anothers servers, and then i talk about tomcat with another people, but most servers admins tell me that TomCat need too much resoruces from machines. Is that right ?? Thanks for your response. Marcos Marcos, you can find the answer for yourself... google for Java vs PHP You'll find a healthy dose of pro, cons, bias, prejudice, hatred, groupies, and marketing? Java is heavier on a machine... its got to load up the JVM. ... that initial hit is probably in the order of 200 megs versus 50... then its what the app does. PHP is more widely used, its easier for easy stuff. But if a SP tells me that I got to learn another language, vs buying another 500 m chip, or hosting our box... I'd just change my SP ;) Retraining staff costs a hell of a lot more. Find a SP that specializes in hosting Tomcat... from the sounds of things your SP doesnt know Java. Actually TC should do that... list all TC friendly SP's. Then if you talking to a .Net SP... Tomcats really going to suck... its free ;) Google, for the swings and balances... the answer depends very much on the fan club you talking to ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: server resources
assuming you'll want to manage multiple resources such as DB connection(pools) and/or webservices and/or JMS Messaging Queues havent heard about Apache PHP's ability to multi-thread? anyone? Martin - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, June 23, 2008 7:28 PM Subject: Re: server resources - Original Message - From: Marcos Molina [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, June 23, 2008 11:49 PM Subject: server resources Hi people! I´m working with tomcat for years, in intranet envoiroment. And now i need to put some works in anothers servers, and then i talk about tomcat with another people, but most servers admins tell me that TomCat need too much resoruces from machines. Is that right ?? Thanks for your response. Marcos Marcos, you can find the answer for yourself... google for Java vs PHP You'll find a healthy dose of pro, cons, bias, prejudice, hatred, groupies, and marketing? Java is heavier on a machine... its got to load up the JVM. ... that initial hit is probably in the order of 200 megs versus 50... then its what the app does. PHP is more widely used, its easier for easy stuff. But if a SP tells me that I got to learn another language, vs buying another 500 m chip, or hosting our box... I'd just change my SP ;) Retraining staff costs a hell of a lot more. Find a SP that specializes in hosting Tomcat... from the sounds of things your SP doesnt know Java. Actually TC should do that... list all TC friendly SP's. Then if you talking to a .Net SP... Tomcats really going to suck... its free ;) Google, for the swings and balances... the answer depends very much on the fan club you talking to ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [Logging] Facility Specific Properties
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ole, Ole Ersoy wrote: | I hope the mappings are all inclusive from java.util.logging's | perspective so that if I set the a level to INFO I get info, plus | possibly some other level's that are greater than INFO? In other words | something that should be mapped to info, does not end up corresponding | to say FINE, and is thus left out? Yes. The level chosen really means this level and above -- it's not specifically that level and that level only. | I would think that it's always appropriate to use commons logging within | Tomcat and anything (java.util.logging, log4j, or commons-logging) goes | for webapps? Tomcat uses commons-logging internally and then your choice of real loggers to actually do the job. In your webapps, you can use (that is, write into your own code) commons-logging or log4j or Java's logging or whatever you want. If you use commons-logging and the same logger across all web applications, you get the benefit of all logging for the entire server (internals + webapps) being set up in one place. If you separate them (which I recommend), you get the benefit of logging configuration for a particular application being bundled with that application (which sort of follows the self-contained principle of applications. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhgPRcACgkQ9CaO5/Lv0PBtSwCfQl+hau6bgp+XSgI35PexhHBm SJAAn2Ku7yDaCgflfP3Zsu0F37LEbPBW =F9Fn -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]
Re: [Logging] Facility Specific Properties
Found this helpful http://tomcat.apache.org/tomcat-5.5-doc/logging.html default logging is commons-logging with known limitation to Engines and Hosts this limitation of JDK Logging appears to be the genesis of per-web application logging as the configuration is per-VM to overcome these limitations as well as the ability to configure in Appenders (socket/file etc) replace with Log4j http://logging.apache.org/log4j/1.2/index.html FWIW Martin - Original Message - From: Christopher Schultz [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, June 23, 2008 8:17 PM Subject: Re: [Logging] Facility Specific Properties -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ole, Ole Ersoy wrote: | I hope the mappings are all inclusive from java.util.logging's | perspective so that if I set the a level to INFO I get info, plus | possibly some other level's that are greater than INFO? In other words | something that should be mapped to info, does not end up corresponding | to say FINE, and is thus left out? Yes. The level chosen really means this level and above -- it's not specifically that level and that level only. | I would think that it's always appropriate to use commons logging within | Tomcat and anything (java.util.logging, log4j, or commons-logging) goes | for webapps? Tomcat uses commons-logging internally and then your choice of real loggers to actually do the job. In your webapps, you can use (that is, write into your own code) commons-logging or log4j or Java's logging or whatever you want. If you use commons-logging and the same logger across all web applications, you get the benefit of all logging for the entire server (internals + webapps) being set up in one place. If you separate them (which I recommend), you get the benefit of logging configuration for a particular application being bundled with that application (which sort of follows the self-contained principle of applications. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhgPRcACgkQ9CaO5/Lv0PBtSwCfQl+hau6bgp+XSgI35PexhHBm SJAAn2Ku7yDaCgflfP3Zsu0F37LEbPBW =F9Fn -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] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat 5.5 loads a blank page
Hi, I'm new to this newsgroup and have a vexing problem. I run tomcat using the startup script, for ex. /usr/share/tomcat5.5/bin startup.sh and everything startsup with no errors, ie: Using CATALINA_BASE: /usr/share/tomcat5.5 Using CATALINA_HOME: /usr/share/tomcat5.5 Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp Using JRE_HOME: /usr/lib/jvm/java-6-sun but if I go to localhost:8180 a blank page is displayed with no errors in catalina.out. Here's the output from catalina.out when I startup tomcat as above: [EMAIL PROTECTED]:~# tail -f /usr/share/tomcat5.5/logs/catalina.out Jun 23, 2008 5:56:50 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8180 Jun 23, 2008 5:56:50 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Jun 23, 2008 5:56:50 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/58 config=null Jun 23, 2008 5:56:50 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Jun 23, 2008 5:56:50 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 599 ms As I said I get the blank page when going to localhost:8180, and nothing added to catalina.out, so no help in figuring this problem out. As a comparison, I get the normal index.html page displayed when I go to /usr/local/tomcat/apache-tomcat-6.0.14/bin and run the startup script there and go to localhost:8080. (i have both tomcats installed. I'll explain more on this later) I did a search and there is actually no index.html page in my tomcat5.5 installation. I installed this version from the ubuntu(gutsy) repositories using apt-get. The /usr/share/tomcat5.5/webapps directory is empty there whereas the other, /usr/local/tomcat/apache-tomcat-6.0.14/webapps/ROOT/index.html, isn't. Not sure this matters, though. It seems like the home directories for the 2 tomcat installations are set up a bit differently: [EMAIL PROTECTED]:~# ls /usr/share/tomcat5.5/ bin common conf doc logs server shared temp webapps work versus [EMAIL PROTECTED]:~# ls /usr/local/tomcat/apache-tomcat-6.0.14 bin lib logsRELEASE-NOTES temp work conf LICENSE NOTICE RUNNING.txtwebapps Now to the reason I'm using tomcat5.5 instead of the latest version. I'm trying to do web development using eclipse. I had to install eclipse using apt-get also. (After a week of trying to get the latest version of eclipse working from a manual download, I gave up) So I have eclipse 3.2.2 WTP with tomcat5.5 and I have a sample webapp that I did using an eclipse tutorial, and everything seems to work, I can start tomcat server from eclipse with no errors, but the same thing happens. When I go to load the jsp it's blank. I am totally clueless on this one, so any ideas would be greatly appreciated. Thanks, Adam Posner
RE: tomcat 5.5 loads a blank page
From: Adam Posner [mailto:[EMAIL PROTECTED] Subject: tomcat 5.5 loads a blank page I installed this version from the ubuntu(gutsy) repositories using apt-get. What you're experiencing is why those of us who have been around awhile strongly recommend (aka, insist) you don't try to use the 3rd-party repackaged versions, but rather always get a real Tomcat from the real download location. The repackagers probably have their reasons for doing what they do, but they make it pretty much impossible for anyone other than another user of that particular repackaged version to help you. If you can't use 6.0, try the real 5.5 from here: http://tomcat.apache.org/download-55.cgi - 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]
Re: Faster resource servlet
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Fisher wrote: | Incrementally try larger buffer sizes. Or, better yet, allow the buffer size to be configurable as deployment time as an init-param. | Also, | | response.setContentLength( (int)file.length() ); | | May be expensive, see how long it takes. It should be super fast, since you're just looking at filesystem metadata. The real problem with that line is that it casts a long to an int, and could lose data. Instead of using response.setContentLength, you should use: response.setHeader(Content-Length, String.valueOf(file.length())); This will allow your servlet to work with files larger than 2GiB. A couple of other things I'd like to mention: 0) it would be good to divorce the servlet from Spring and other packages so it can be deployed without dependencies. Whatever hairlessApplicationSettings is could easily be replaced with init-param settings 1) Don't bother setting serialVersionId. Objects of this class will never be instantiated. 2) 'config' should not be static. 3) Having file be a class-level member is has race conditions built right into it. This should be a variable local to the doGet method. 4) Calling String.replace to remove the request URI's context prefix is an expensive operation that is not necessary: just use substring instead. 5) Why are you using a DataInputStream instead of just a bare InputStream? DataInputStream is used to read serialized Java objects from a stream. It's probably performing a lot of extra operations that you simply do not need. I would use a BufferedInputStream instead of a DataInputStream. 6) Don't check for a null input stream every time you go through the loop. Check for null once, and then don't check again. Unless you fear that your pointers will suddenly null-out, it's unnecessary. 7) You need to significantly improve exception handling. Nowhere in your code are the target files checked for existence and 404 errors returned or anything like that. Similarly, you need to ensure that resource leaks do not occur when exceptions do: you don't have any finally clause that closes any open file handles or anything. This is a definite must for anything considered even remotely production-quality. 8) Only catch exceptions that you can actually do anything about (or are required to by the compiler). Your code will catch and silently ignore even things like RuntimeExceptions (like NPEs, etc.) and you really want to know about those. Hope those notes help, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhgaMYACgkQ9CaO5/Lv0PBTcQCeNnXHQQeWpZaRn6r8u7C1oqsK c3EAni1vzBr3qPrzpGoyxOxYhW8bG7z6 =fSw8 -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]
Re: [Logging] Facility Specific Properties
Super - Thanks for the elaboration! - Ole Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ole, Ole Ersoy wrote: | I hope the mappings are all inclusive from java.util.logging's | perspective so that if I set the a level to INFO I get info, plus | possibly some other level's that are greater than INFO? In other words | something that should be mapped to info, does not end up corresponding | to say FINE, and is thus left out? Yes. The level chosen really means this level and above -- it's not specifically that level and that level only. | I would think that it's always appropriate to use commons logging within | Tomcat and anything (java.util.logging, log4j, or commons-logging) goes | for webapps? Tomcat uses commons-logging internally and then your choice of real loggers to actually do the job. In your webapps, you can use (that is, write into your own code) commons-logging or log4j or Java's logging or whatever you want. If you use commons-logging and the same logger across all web applications, you get the benefit of all logging for the entire server (internals + webapps) being set up in one place. If you separate them (which I recommend), you get the benefit of logging configuration for a particular application being bundled with that application (which sort of follows the self-contained principle of applications. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhgPRcACgkQ9CaO5/Lv0PBtSwCfQl+hau6bgp+XSgI35PexhHBm SJAAn2Ku7yDaCgflfP3Zsu0F37LEbPBW =F9Fn -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] - 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: [Logging] Facility Specific Properties
Martin wrote: Found this helpful http://tomcat.apache.org/tomcat-5.5-doc/logging.html default logging is commons-logging with known limitation to Engines and Hosts this limitation of JDK Logging appears to be the genesis of per-web application logging as the configuration is per-VM That sounds great for Tomcat 5. From what I understand Tomcat 6 logging has been overhauled and the java.util.logging implementation was replaced with JULI, which understands how to load per web app configuration files and make the corresponding configuration available via the LogManager to the web app. to overcome these limitations as well as the ability to configure in Appenders (socket/file etc) replace with Log4j http://logging.apache.org/log4j/1.2/index.html I think Appenders are the same as Handlers in java.util.logging. So for those going with Tomcat 6, JULI provides pretty much the same capabilities AFAIK (Socket communication / Handlers / XML Format, etc.). Ole - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]