Re: Problem with Tomcat 6 cluster
Hi Jason, Copied the file content here: [Mon Sep 14 13:58:08 2009][2436:4032] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 13:58:09 2009][2436:4032] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 13:58:11 2009][3572:3316] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 13:58:11 2009][3572:3316] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:08:29 2009][544:2340] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:08:30 2009][544:2340] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:08:30 2009][564:3268] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:08:30 2009][564:3268] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:09:35 2009][1472:3776] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:09:35 2009][1472:3776] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:09:35 2009][3604:3792] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:09:36 2009][3604:3792] [info] mod_jk.c (2825): mod_jk/1.2.26 initialized [Mon Sep 14 14:13:31 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:31 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.046875 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:32 2009]balancer LB-IP 0.078125 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.00 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.125000 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.078125 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.125000 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.046875 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.171875 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.187500 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.156250 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:33 2009]balancer LB-IP 0.031250 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.093750 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.031250 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.109375 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.078125 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.062500 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.046875 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.031250 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.031250 [Mon Sep 14 14:13:45 2009]balancer LB-IP 0.093750 [Mon Sep 14 14:13:46 2009]balancer LB-IP 0.171875 [Mon Sep 14 14:13:46 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:13:46 2009]balancer LB-IP 0.953125 [Mon Sep 14 14:15:07 2009]balancer LB-IP 0.015625 [Mon Sep 14 14:15:21 2009]balancer LB-IP 3.312500 [Mon Sep 14 14:15:40 2009][3604:2000] [info] jk_ajp_common.c (1347): (worker1) all endpoints are disconnected, detected by connect check (6), cping (0), send (0) [Mon Sep 14 14:15:41 2009][3604:2000] [info] jk_connect.c (566): connect to worker1IP:8009 failed (errno=61) [Mon Sep 14 14:15:41 2009][3604:2000] [info] jk_ajp_common.c (869): Failed opening socket to (worker1IP:8009) (errno=61) [Mon Sep 14 14:15:41 2009][3604:2000] [error] jk_ajp_common.c (1359): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=61) [Mon Sep 14 14:15:41 2009][3604:2000] [info] jk_ajp_common.c (2186): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1) [Mon Sep 14 14:15:42 2009][3604:2000] [info] jk_connect.c (566): connect to worker1IP:8009 failed (errno=61) [Mon Sep 14 14:15:42 2009][3604:2000] [info] jk_ajp_common.c (869): Failed opening socket to (worker1IP:8009) (errno=61) [Mon Sep 14 14:15:42 2009][3604:2000] [error] jk_ajp_common.c (1359): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=61) [Mon Sep 14 14:15:42 2009][3604:2000] [info] jk_ajp_common.c (2186): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2) [Mon Sep 14 14:15:42 2009][3604:2000] [error]
Tomcat hangs on startup
I'm running Tomcat 6.0.18 on Debian Linux (Lenny). Tomcat is configured to start automatically through the init process, but it hangs using 95+% of the CPU and won't respond to /etc/init.d/tomcat stop. I have to kill the process. I've tried manually starting it as root with /etc/init.d/tomcat start and with /opt/tomcat/bin/startup.sh but the same thing happens. The last entry in catalina.date.log in all cases is INFO: Overriding property struts.configuration.xml.reload old value false new value:true However, if I cd to the directory /op/tomcat/bin and run ./startup.sh from there Tomcat starts normally. Has anyone got an idea as to what might be going on? Regards -- View this message in context: http://www.nabble.com/Tomcat-hangs-on-startup-tp25530597p25530597.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
Christopher Schultz wrote: ... What is the source of that file name? Is it hard-coded into your Java code? If so, how? Did you just type fichié.txt into your .java file, or did you use \uxyz syntax to specify the UNICODE character you intended? If you are reading the filename from a remote client, then all the request URI encodings and all that stuff are definitely relevant (ion spite of my previous statements to the contrary). ... Honestly, I think the above should not be a problem. ... Christopher, what I am trying to say is that such matters are horrible, because *everything* matters. One cannot even be sure that the logfile message, as seen by the user and as pasted in the email to the list, and as further seen by the reader on this list, is really how the message is physically stored in the logfile. That's because in-between, there can be umpteen layers of decoding/encoding which can make matters really confusing. (Even the encoding used by the process which writes the logfile may matter, because fichié.txt may already have been re-encoded right there.) Your note about making sure, in the source code of the program, that the filename is really made out of the bytes which the OP thinks it is made of, is a good example. If, to create this program source, one uses an editor which is set to save its files in the iso-latin-1 charset, then fichié.txt will be saved, in the program source, as a string of 10 bytes. Conversely, if one uses an editor set to save its files in Unicode/UTF-8, then this same string will be saved as 11 bytes (the é occupying 2 bytes). Then comes the compiler.. I don't know how a Java compiler handles source code respectively saved as an iso-8859-1 encoded file, or as a UTF-8 encoded file. How does it tell the difference ? does it make assumptions based on the locale it is running under ? About the creation and subsequent finding of a file : Generally-speaking, filesystems are encoding agnostic, in the precise sense that : - if on a given platform and with a given programming language, you arrange for a string variable S to contain a precise series of bytes (for example, the UTF-8 encoding of the string fichié.txt, 11 bytes long) - if you then use that variable as the name of a file which you create on disk - then no matter where this file directory ultimately resides, the name of the file in it will generally be these same exact 11 bytes. - if you then, from the same platform and using the same programming languages, use this same variable A as the name of a file which you try to open, it will work. However, as soon as you deviate from the strict case above, what looks to you like fichié.txt /may/ not be the same series of bytes anymore, and that's where the problems start. How the filename will look like is however another matter, depending on what you use to display it and from where you do it. In the case of Sylvie (and I am talking here about the final issue she is trying to handle, not just about the test case) - presumably, some (other) users and/or applications, running on some (other) platform and using some (other) tools, are creating files inside of a Windows host's directory. One item of interest here would be to know how these files are created, and if that process is consistent (meaning, are these files always created by the same programs, running always on the same platform, using the same encoding etc..). That is to make sure that when a file named fichié.txt is created there by whatever, it will always be created the same way, with a name of either 10 or 11 bytes (it does not matter which, just that it be consistent). - then, some program created by Sylvie, has to access that directory, and pick up files from there. So this program may have to know how a filename fichié.txt will be encoded in that directory (either as 10 or 11 bytes). It also does not matter which, as long as Sylvie's program has a way to consistently spell this name correctly. The problem is generally unsolvable, if the original entry in the directory can be created in several ways, because there are multiple agents capable of creating it, and these agents use inconsistent encodings. The issue can be simpler, if Sylvie's program just opens the directory, reads the filenames that it finds there (whatever their encoding is), into some variable, and then just uses this variable as the filename to open the file and that's it. But if, in Sylvie's program, the filename itself has to be compared to some pre-defined other string stored in the program, and some action taken or not whether it is considered equal or not, then there may be a problem. Yet another aspect to consider, is whether Sylvie is really testing the right thing. For instance, when Sylvie runs her Java test program, she does this from inside a Linux session, which is set for a specific locale. However, the Tomcat server may well be started under a different
Re: Tomcat hangs on startup
RogerV wrote: I'm running Tomcat 6.0.18 on Debian Linux (Lenny). Tomcat is configured to start automatically through the init process, but it hangs using 95+% of the CPU and won't respond to /etc/init.d/tomcat stop. I have to kill the process. I've tried manually starting it as root with /etc/init.d/tomcat start and with /opt/tomcat/bin/startup.sh but the same thing happens. The last entry in catalina.date.log in all cases is INFO: Overriding property struts.configuration.xml.reload old value false new value:true However, if I cd to the directory /op/tomcat/bin and run ./startup.sh from there Tomcat starts normally. Has anyone got an idea as to what might be going on? Use kill -3 to take a couple of thread dumps ~15s apart when it hangs. Compare the thread dumps to see which thread(s) is(are) stuck. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Log4j
Hi, I want to use Log4j and log from different web apps to one directory - tomcat_home/output/logs/{webapp_context}_service.log What should be the configuration in log4j.properties? I am currently using log4j.appender.xml.file=${catalina.base}/output/logs/service.log What I want is to append app_context in the file name. Thanks, Nishant - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat hangs on startup
On 22.09.2009 10:29, Mark Thomas wrote: RogerV wrote: I'm running Tomcat 6.0.18 on Debian Linux (Lenny). Tomcat is configured to start automatically through the init process, but it hangs using 95+% of the CPU and won't respond to /etc/init.d/tomcat stop. I have to kill the process. I've tried manually starting it as root with /etc/init.d/tomcat start and with /opt/tomcat/bin/startup.sh but the same thing happens. The last entry in catalina.date.log in all cases is INFO: Overriding property struts.configuration.xml.reload old value false new value:true However, if I cd to the directory /op/tomcat/bin and run ./startup.sh from there Tomcat starts normally. Has anyone got an idea as to what might be going on? Use kill -3 to take a couple of thread dumps ~15s apart when it hangs. Compare the thread dumps to see which thread(s) is(are) stuck. And if you use something like ps -L you can identify the thread number of the thread using the CPU time. That number on most OSes corresponds either to the tid or the nid value shown in the header lines before each thread stack of the dump. The tid and id are in hex though. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
André, I follow your tutorial and all outputs in Widows Explorer, DOS Command Window and Linux Window are consistents concerning file names display. For locale set under Linux, here is the output: LANG=fr_FR.UTF-8 LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=fr_FR.UTF-8 LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8 LC_ADDRESS=fr_FR.UTF-8 LC_TELEPHONE=fr_FR.UTF-8 LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=fr_FR.UTF-8 LC_ALL= I just remind that I have these lines in my tomcat auto-start script : LC_ALL=fr_FR export LC_ALL André Warnier a écrit : The problem is generally unsolvable, if the original entry in the directory can be created in several ways, because there are multiple agents capable of creating it, and these agents use inconsistent encodings. That's my case. Actually, entries in the Windows shared should become from everywhere, with I suppose various encoding. In fact, files I need to process are stored in an external support (CD, USB...) and under Windows, I share the corresponding drive. Then, this shared drive becomes the directory I mount under my Linux system. Note that it is a key requierement having the external support loaded under Windows system ONLY. The issue can be simpler, if Sylvie's program just opens the directory, reads the filenames that it finds there (whatever their encoding is), into some variable, and then just uses this variable as the filename to open the file and that's it. I don't understand your point ? I just try to open my file and read it with a FileInputStream. Sylvie - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log4j
2009/9/22 Nishant Chandra nishant.chan...@gmail.com: I want to use Log4j and log from different web apps to one directory - tomcat_home/output/logs/{webapp_context}_service.log What should be the configuration in log4j.properties? I am currently using log4j.appender.xml.file=${catalina.base}/output/logs/service.log What I want is to append app_context in the file name. IIRC, there is no way to obtain the application context path as an environment variable. You should configure Log4j using its APIs, using a ServletContextListener. Probably the best way is to load the log4j.properties file and modify only the property that refers to the path of the file, then configure Log4j. Antonio - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
Please help us beta test Apache Tomcat support in the forthcoming Excelsior JET 7.0 release. Excelsior JET is a compliant Java SE 6 implementation (JVM) with an ahead-of-time native code compiler. Version 7.0 will enable you to compile Apache Tomcat together with your Web applications into a native code executable and distribute it without the original class/WAR files and without dependency on the JDK. The latest Excelsior JET 7.0 beta 2 supports Tomcat 5.0, 5.5, and 6.0 and is available for Windows and Linux. More information and sample app (Pebble 2.3.2 on Tomcat 6.0): http://www.excelsior-usa.com/protect-java-web-applications.html Beta downloads (no registration required): http://www.excelsior-usa.com/jetdlbeta.html We are eagerly awaiting your feedback and questions at j...@excelsior-usa.com. Thank you and best regards, Dmitry Leskov Excelsior LLC
Re: Create FileInputStream in servlet from remote file with accentuated character name
Sylvie Perrin wrote: André, I follow your tutorial and all outputs in Widows Explorer, DOS Command Window and Linux Window are consistents concerning file names display. That's good. For locale set under Linux, here is the output: LANG=fr_FR.UTF-8 LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=fr_FR.UTF-8 LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8 LC_NAME=fr_FR.UTF-8 LC_ADDRESS=fr_FR.UTF-8 LC_TELEPHONE=fr_FR.UTF-8 LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=fr_FR.UTF-8 LC_ALL= That's good too. I just remind that I have these lines in my tomcat auto-start script : LC_ALL=fr_FR export LC_ALL Thuis, you should probably change, to be the same as your own locale fr_FR.UTF-8 above. André Warnier a écrit : The problem is generally unsolvable, if the original entry in the directory can be created in several ways, because there are multiple agents capable of creating it, and these agents use inconsistent encodings. That's my case. Actually, entries in the Windows shared should become from everywhere, with I suppose various encoding. In fact, files I need to process are stored in an external support (CD, USB...) and under Windows, I share the corresponding drive. Then, this shared drive becomes the directory I mount under my Linux system. Note that it is a key requierement having the external support loaded under Windows system ONLY. The issue can be simpler, if Sylvie's program just opens the directory, reads the filenames that it finds there (whatever their encoding is), into some variable, and then just uses this variable as the filename to open the file and that's it. I don't understand your point ? I just try to open my file and read it with a FileInputStream. Allright. Let me see if I understand correctly your basic issue (not the test program, but the real application you need to create). - miscellaneous agents create files, on some media, which is later connected to a Windows system and becomes a shared directory. You do not control these agents, nor the file names that they choose to put there. - your application, running (later) under Tomcat, is supposed to read these files and do something with them. I suppose that you do not know in advance, what the names of these files will be, and you just have to take what is there. Is that correct ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
Hi, I think it's not a good idea especially when application are subject to modification frequetly or if we plan to deploy a new application on the server. Tomcat has a very interesting feature which allows user to load application on fly without closing the server. But If I compile tomcat and webapps into single package, I will lost this feature. I see that's a very limited functionnality. Regards Ramzi On Tue, Sep 22, 2009 at 7:41 AM, Excelsior Java Team j...@excelsior-usa.com wrote: Please help us beta test Apache Tomcat support in the forthcoming Excelsior JET 7.0 release. Excelsior JET is a compliant Java SE 6 implementation (JVM) with an ahead-of-time native code compiler. Version 7.0 will enable you to compile Apache Tomcat together with your Web applications into a native code executable and distribute it without the original class/WAR files and without dependency on the JDK. The latest Excelsior JET 7.0 beta 2 supports Tomcat 5.0, 5.5, and 6.0 and is available for Windows and Linux. More information and sample app (Pebble 2.3.2 on Tomcat 6.0): http://www.excelsior-usa.com/protect-java-web-applications.html Beta downloads (no registration required): http://www.excelsior-usa.com/jetdlbeta.html We are eagerly awaiting your feedback and questions at j...@excelsior-usa.com. Thank you and best regards, Dmitry Leskov Excelsior LLC
Re: [ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
Hi, I think it's not a good idea especially when application are subject to modification frequetly or if we plan to deploy a new application on the server. Tomcat has a very interesting feature which allows user to load application on fly without closing the server. But If I compile tomcat and webapps into single package, I will lost this feature. I see that's a very limited functionnality. I can imagine such functionality be very userfull for ISV, since upgrading those is often more tedious anyway. Apart from that I see little to no use of such a product Regards, Serge Fonville On Tue, Sep 22, 2009 at 3:20 PM, ramzi khlil ramzi.atv...@gmail.com wrote: Hi, I think it's not a good idea especially when application are subject to modification frequetly or if we plan to deploy a new application on the server. Tomcat has a very interesting feature which allows user to load application on fly without closing the server. But If I compile tomcat and webapps into single package, I will lost this feature. I see that's a very limited functionnality. Regards Ramzi On Tue, Sep 22, 2009 at 7:41 AM, Excelsior Java Team j...@excelsior-usa.com wrote: Please help us beta test Apache Tomcat support in the forthcoming Excelsior JET 7.0 release. Excelsior JET is a compliant Java SE 6 implementation (JVM) with an ahead-of-time native code compiler. Version 7.0 will enable you to compile Apache Tomcat together with your Web applications into a native code executable and distribute it without the original class/WAR files and without dependency on the JDK. The latest Excelsior JET 7.0 beta 2 supports Tomcat 5.0, 5.5, and 6.0 and is available for Windows and Linux. More information and sample app (Pebble 2.3.2 on Tomcat 6.0): http://www.excelsior-usa.com/protect-java-web-applications.html Beta downloads (no registration required): http://www.excelsior-usa.com/jetdlbeta.html We are eagerly awaiting your feedback and questions at j...@excelsior-usa.com. Thank you and best regards, Dmitry Leskov Excelsior LLC
Re: [ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
On Tue, Sep 22, 2009 at 1:41 PM, Excelsior Java Team j...@excelsior-usa.com wrote: Please help us beta test Apache Tomcat support in the forthcoming Excelsior JET 7.0 release. Excelsior JET is a compliant Java SE 6 implementation (JVM) with an ahead-of-time native code compiler. Version 7.0 will enable you to compile Apache Tomcat together with your Web applications into a native code executable and distribute it without the original class/WAR files and without dependency on the JDK. Wouldn't that make the application slower? I assume this compiled code can't be uncompiled and optimized by the hotspot, so it is not for performance. As for preventing decompilation, how many people/companies are actually delivering a war which they need to protect from decompiling? How many people would install such a product, one they can't configure anymore, one that is even infectable by viruses? This just sounds plain wrong :-) regards Leon - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
Leon Rosenberg wrote: ... As for preventing decompilation, how many people/companies are actually delivering a war which they need to protect from decompiling? How many people would install such a product, one they can't configure anymore, one that is even infectable by viruses? This just sounds plain wrong :-) Leon, I can't comment on the speed aspect etc.. But I have a number of corporate customers who have sub-contracted their IT infrastructure to an external service company. In my experience these external people then, usually, tend to adopt the umbrella attitude, whereby they want every other external software supplier to supply their software in a manner that will cause themselves the least work and the least trouble. In other words, their ideal is that the software be delivered in the form of a single executable, pre-parameterised so that they don't even have to choose options in an installer, and that they would not bear any responsibility if anything should not work as expected. They are certainly not interested in even having to think about tricky customising options. I am not saying that these are my preferred kind of customers. (I prefer smart ones, up to a point). But this is a use case for the proposed package, it seems to me. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [ANN] Compile Tomcat Web apps into native Windows/Linux executables (beta)
On Tue, Sep 22, 2009 at 4:12 PM, André Warnier a...@ice-sa.com wrote: Leon Rosenberg wrote: ... As for preventing decompilation, how many people/companies are actually delivering a war which they need to protect from decompiling? How many people would install such a product, one they can't configure anymore, one that is even infectable by viruses? This just sounds plain wrong :-) Leon, I can't comment on the speed aspect etc.. But I have a number of corporate customers who have sub-contracted their IT infrastructure to an external service company. In my experience these external people then, usually, tend to adopt the umbrella attitude, whereby they want every other external software supplier to supply their software in a manner that will cause themselves the least work and the least trouble. In other words, their ideal is that the software be delivered in the form of a single executable, pre-parameterised so that they don't even have to choose options in an installer, and that they would not bear any responsibility if anything should not work as expected. They are certainly not interested in even having to think about tricky customising options. I am not saying that these are my preferred kind of customers. (I prefer smart ones, up to a point). But this is a use case for the proposed package, it seems to me. I work with external operations departments a lot. Many of them aren't the brightest but they all manage to a) untar a previously configured and tared tomcat and b) replace a war file or untar and relink a package. And they all learned shutdown.sh and startup.sh. However, in most companies I observe that operation takes over tomcat configuration (playing with gc and memory settings etc) and development simply delivers a war, which is injected with configuration by the operation department. But well, people may still find this feature useable :-) regards Leon - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: what does j_security_check do in clustering?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rex, On 9/20/2009 11:26 PM, Rex Wang wrote: I am using clustering, and the security checking process can not complete if the session affinity = false. Looks like the login name and password are posted to another node, and some times I got a 400 error HTTP Status 400 - Invalid direct reference to form login page. Hmm... I don't know how Tomcat does clustering, but if you are getting responses like that (Invalid direct reference), then either Tomcat requires session affinity for clustered authentication or there is a bug somewhere. Technically, I believe that Tomcat requires a session in order to store your original request so it can be re-played after successful authentication. In that case, I would have expected the session to be replicated across the cluster before the request for j_security_check was submitted. Could you please post your cluster configuration? Can you confirm that your sessions are correctly replicated when you *are* able to login successfully? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq44RsACgkQ9CaO5/Lv0PAWogCfXV66Um820X7bmrwzi7/N81vH /5QAni16WrBB28m+jbXm+fS6cEs6qN1/ =IFe7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 9/22/2009 4:00 AM, André Warnier wrote: what I am trying to say is that such matters are horrible, because *everything* matters. Eh.. well, yeah. :) Your note about making sure, in the source code of the program, that the filename is really made out of the bytes which the OP thinks it is made of, is a good example. If, to create this program source, one uses an editor which is set to save its files in the iso-latin-1 charset, then fichié.txt will be saved, in the program source, as a string of 10 bytes. Conversely, if one uses an editor set to save its files in Unicode/UTF-8, then this same string will be saved as 11 bytes (the é occupying 2 bytes). Then comes the compiler.. I don't know how a Java compiler handles source code respectively saved as an iso-8859-1 encoded file, or as a UTF-8 encoded file. How does it tell the difference ? does it make assumptions based on the locale it is running under ? javac is documented to use the platform default encoding (for /Java/), which may not be the default encoding of your editor. :( http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html Without any interference from me, my compiler chooses ANSI_X3.4-1968 which is roughly Latin-1, so any funny business in there like Thử nghiệm Tiếng Việt isn't going to fly. It's always best in Java source files to use something as close to ASCII as possible and use the \u encoding of any special UNICODE characters. The OP won't cough-up the source code, though, so we don't even know if this is a source code problem or an HTTP-request-parameter interpretation problem. One item of interest here would be to know how these files are created, and if that process is consistent (meaning, are these files always created by the same programs, running always on the same platform, using the same encoding etc..). That is to make sure that when a file named fichié.txt is created there by whatever, it will always be created the same way, with a name of either 10 or 11 bytes (it does not matter which, just that it be consistent). +1 The problem is generally unsolvable, if the original entry in the directory can be created in several ways, because there are multiple agents capable of creating it, and these agents use inconsistent encodings. Yup. Unless you read the directory entry from the filesystem and guess at the right file (ha!), you might not get the one you want. However, the Tomcat server may well be started under a different locale setting, and this may have an impact as to how each one of them looks at the filename fichié.txt. Unfortunately, the Java API says nothing about the encoding used to read and write filenames. :( Then of course, after the above trivial matter of the filename is resolved, one may have to tackle the matter of how the file contents are encoded. At least the programmer has some measure of control over that. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq45ewACgkQ9CaO5/Lv0PAVsQCgt9YnaEBJhRatVGgsUWjkmLlC 9yEAn03E+uM5bslLUZ1/sC4y3/3z1y0u =pCP2 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
André, Thanks to you, my testcase is now running without any exception. André Warnier a écrit : Sylvie Perrin wrote: I just remind that I have these lines in my tomcat auto-start script : LC_ALL=fr_FR export LC_ALL Thuis, you should probably change, to be the same as your own locale fr_FR.UTF-8 above. The cause was the LC_ALL variable in my script starting tomcat. I set it to fr_FR.UTF-8 as you suggest and now, my test is OK ! Allright. Let me see if I understand correctly your basic issue (not the test program, but the real application you need to create). - miscellaneous agents create files, on some media, which is later connected to a Windows system and becomes a shared directory. You do not control these agents, nor the file names that they choose to put there. - your application, running (later) under Tomcat, is supposed to read these files and do something with them. I suppose that you do not know in advance, what the names of these files will be, and you just have to take what is there. Is that correct ? You perfectly undestood requirements of my real application. I know that I will expect others wonderful problems :-) Thank you again for your great help. Sylvie. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Log4j
I had a similar problem with log4j. We host our webapp for various customers, an instance (host) per customer, therefore the same code for each customer. I tried sharing log4j.jar in shared/lib, but found all customer loading into the same log file - very confusing. My solution was to put log4j.jar in WEB-INF/lib of each instance, along with individual log4j.properties files and setting different file paths in the properties files. Only solution I could find. -Original Message- From: Antonio Petrelli [mailto:antonio.petre...@gmail.com] Sent: Tuesday, September 22, 2009 6:02 AM To: Tomcat Users List Subject: Re: Log4j 2009/9/22 Nishant Chandra nishant.chan...@gmail.com: I want to use Log4j and log from different web apps to one directory - tomcat_home/output/logs/{webapp_context}_service.log What should be the configuration in log4j.properties? I am currently using log4j.appender.xml.file=${catalina.base}/output/logs/service.log What I want is to append app_context in the file name. IIRC, there is no way to obtain the application context path as an environment variable. You should configure Log4j using its APIs, using a ServletContextListener. Probably the best way is to load the log4j.properties file and modify only the property that refers to the path of the file, then configure Log4j. Antonio - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log4j
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeffrey, On 9/22/2009 11:00 AM, Jeffrey Janner wrote: My solution was to put log4j.jar in WEB-INF/lib of each instance, along with individual log4j.properties files and setting different file paths in the properties files. Only solution I could find. I believe this is the best solution to this problem. It allows the webapp to have control over its own logging, which is nice. You can package a log4j.properties file along with your webapp and configure it however you like. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq4558ACgkQ9CaO5/Lv0PDwdACgkBeSmO2gU+YFXrgKNL/P4/0I VxMAniVkA4PKQPNaXhXxuy4ViK7gJ/mo =CC3S -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sylvie, On 9/22/2009 11:01 AM, Sylvie Perrin wrote: The cause was the LC_ALL variable in my script starting tomcat. I set it to fr_FR.UTF-8 as you suggest and now, my test is OK ! I wonder if Java uses the file.encoding system property (which is set by the portion of $LC_ALL after the .) to convert bytes returned from the filesystem into filenames and vice versa. Yeah, that appears to be the case: import java.io.*; public class FileEncodingTest { public static void main(String[] args) throws Exception { System.out.println(Using file.encoding= + System.getProperty(file.encoding)); File file = new File(\u03c0); // That's a lowercase Greek pi Writer out = new FileWriter(file); out.write(A test file\n); out.close(); file = new File(.); File[] files = file.listFiles(); for(int i=0; ifiles.length; ++i) { file = files[i]; System.out.print(file.getName()); System.out.print(\tunicode: ); byte[] bytes = file.getName().getBytes(UnicodeBigUnmarked); // Trust me for(int j=0; jbytes.length; ++j) { String hex = Integer.toHexString(bytes[j]); if(1 == hex.length()) System.out.print(0); System.out.print(hex); System.out.print( ); } System.out.println(); } } } Output on my system: $ java FileEncodingTest Using file.encoding=ANSI_X3.4-1968 FileEncodingTest.class unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 63 00 6c 00 61 00 73 00 73 FileEncodingTest.java unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 6a 00 61 00 76 00 61 ? unicode: 00 3f $ LC_ALL=en_US.UTF-8 java FileEncodingTest Using file.encoding=UTF-8 FileEncodingTest.class unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 63 00 6c 00 61 00 73 00 73 FileEncodingTest.java unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 6a 00 61 00 76 00 61 ? unicode: 00 3f ? unicode: 03 c0 (/this correctly emitted the glyph for pi/) Then, for good measure: $ java FileEncodingTest Using file.encoding=ANSI_X3.4-1968 FileEncodingTest.class unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 63 00 6c 00 61 00 73 00 73 FileEncodingTest.java unicode: 00 46 00 69 00 6c 00 65 00 45 00 6e 00 63 00 6f 00 64 00 69 00 6e 00 67 00 54 00 65 00 73 00 74 00 2e 00 6a 00 61 00 76 00 61 ? unicode: 00 3f ?? unicode: ff fd ff fd (/this did not/) So, when running in ANSI_X3.4-1968-mode, Java takes the codepoint for pi (0x03c0) and destroys it (note the two-character filename where the first byte is NUL). I'm not really even sure how it does that... I'd have expected some broken sign-extension or something but I have no idea how 0x03c0 becomes 0x003f. When running in UTF-8 mode, the correct code point is used for the filename and read-back correctly using listFiles. When running again in ANSI mode, the original (incorrect) filename is (predictably) read- back in the same way as the original, but the filename with the correct code point is again garbled (0x03c0 - 0xfffdfffd). Somebody needs to write a virus that just converts everything to UTF-8 so we can be done with it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq47lAACgkQ9CaO5/Lv0PCDjwCfWTArE2PRo2XTeBgd3yGD+AyZ dCUAnAo8aSsYUdgT/eJBvqMjWA0KzXwF =OEyH -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat6 and allowLinking problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel, On 9/21/2009 8:23 PM, Daniel Blumenthal wrote: I'm trying to use symlinks during development, but for some reason the allowLinking attribute doesn't seem to be working for me. I'm using Tomcat6 on a Mac Mini. First, I added it to my application's META-INF/context.xml file: Context allowLinking=true This is the proper way to do this, so focus on this solution. Shut down Tomcat, and make sure there is no file in conf/Catalina/[hostname]/yourapp.xml. If one exists, Tomcat will prefer that one instead of the one packaged in your webapp's META-INF/context.xml. That didn't work, so I added it to $CATALINA_HOME/conf/context.xml. Yeah, don't do that: it will enable linking in ALL your webapps (but apparently doesn't work in your case for some reason). There's rarely a reason to modify conf/context.xml. Finally, I made sure that $CATALINA_HOME/conf/Catalina/localhost/myapp.xml had it. Hmm... you DID re-start, right? Still no luck. What are you trying to do (obviously use symlinks, but please be specific) and what does Tomcat do rather than what you expect? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq493sACgkQ9CaO5/Lv0PDU1wCfekyojARcc9heHdMT7FxgY6YP JPYAmwZdA+vKWHKyGjLZNQyzqLe9/mgc =SHyK -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
webapps examples and security manager
Hi there, I installed tomcat5 via Fink on Snow Leopard 10.6.1 kernel 64 bits: amadeus[2249]:/sw/var/log/tomcat5% $CATALINA_HOME/bin/catalina.sh version Using CATALINA_BASE: /sw/var/tomcat5 Using CATALINA_HOME: /sw/var/tomcat5 Using CATALINA_TMPDIR: /sw/var/tomcat5/temp Using JRE_HOME: /Library/Java/Home Server version: Apache Tomcat/5.5.26 Server built: Jan 28 2008 01:35:23 Server number: 5.5.26.0 OS Name:Mac OS X OS Version: 10.6.1 Architecture: x86_64 JVM Version:1.6.0_15-b03-219 JVM Vendor: Apple Inc. Tomcat's webapps examples works fine, but then I wanted to use security manager. I put that: export CATALINA_OPTS=-DTOMCAT5LAUNCH=true -Djava.security.manager -Djava.security.policy=$CATALINA_HOME/conf/catalina.policy then it still works but I don't like what I see in log catalina.out: 2009-09-22 16:34:41.010 java[24510:1603] CFPreferences: user home directory at file://localhost/sw/var/empty/ is unavailable. User domains will be volatile. Could not load Logmanager org.apache.juli.ClassLoaderLogManager java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) [snip] at org.apache.catalina.startup.Bootstrap.clinit(Bootstrap.java:54) Can't load log handler 1catalina.org.apache.juli.FileHandler java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [snip] My catalina.policy is this (didn't touch it yet): // These permissions apply to javac grant codeBase file:${java.home}/lib/- { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions grant codeBase file:${java.home}/jre/lib/ext/- { permission java.security.AllPermission; }; // These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre grant codeBase file:${java.home}/../lib/- { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions when // ${java.home} points at $JAVA_HOME/jre grant codeBase file:${java.home}/lib/ext/- { permission java.security.AllPermission; }; // == CATALINA CODE PERMISSIONS === // These permissions apply to the launcher code grant codeBase file:${catalina.home}/bin/commons-launcher.jar { permission java.security.AllPermission; }; // These permissions apply to the daemon code grant codeBase file:${catalina.home}/bin/commons-daemon.jar { permission java.security.AllPermission; }; // These permissions apply to the commons-logging API grant codeBase file:${catalina.home}/bin/commons-logging-api.jar { permission java.security.AllPermission; }; // These permissions apply to the server startup code grant codeBase file:${catalina.home}/bin/bootstrap.jar { permission java.security.AllPermission; }; // These permissions apply to the JMX server grant codeBase file:${catalina.home}/bin/jmx.jar { permission java.security.AllPermission; }; // These permissions apply to JULI grant codeBase file:${catalina.home}/bin/tomcat-juli.jar { permission java.util.PropertyPermission java.util.logging.config.class, read; permission java.util.PropertyPermission java.util.logging.config.file, read; permission java.lang.RuntimePermission shutdownHooks; permission java.io.FilePermission ${catalina.base}${file.separator}conf${file.separator}logging.properties, read; permission java.util.PropertyPermission catalina.base, read; permission java.util.logging.LoggingPermission control; permission java.io.FilePermission ${catalina.base}${file.separator}logs, read, write; permission java.io.FilePermission ${catalina.base}${file.separator}logs${file.separator}*, read, write; permission java.lang.RuntimePermission getClassLoader; // To enable per context logging configuration, permit read access to the appropriate file. // Be sure that the logging configuration is secure before enabling such access // eg for the examples web application: // permission java.io.FilePermission ${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties, read; }; // These permissions apply to the servlet API classes // and those that are shared across all class loaders // located in the common directory grant codeBase file:${catalina.home}/common/- { permission java.security.AllPermission; }; // These permissions apply to the container's core code, plus any additional // libraries installed in the server directory grant codeBase
Re: webapps examples and security manager
Alan wrote: snip/ Any help would be more than appreciated. And when you try with a more recent version? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log4j
Thanks. This should work. I hope there was better logging infrastructure in terms of compressing the file, ftp, log service, archival etc. Nishant On Tue, Sep 22, 2009 at 8:35 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeffrey, On 9/22/2009 11:00 AM, Jeffrey Janner wrote: My solution was to put log4j.jar in WEB-INF/lib of each instance, along with individual log4j.properties files and setting different file paths in the properties files. Only solution I could find. I believe this is the best solution to this problem. It allows the webapp to have control over its own logging, which is nice. You can package a log4j.properties file along with your webapp and configure it however you like. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq4558ACgkQ9CaO5/Lv0PDwdACgkBeSmO2gU+YFXrgKNL/P4/0I VxMAniVkA4PKQPNaXhXxuy4ViK7gJ/mo =CC3S -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Nishant Chandra Hyderabad, India Cell : +91 9949828480 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: webapps examples and security manager
Thanks for your reply. Not yet, which one would suggest me please? Alan On Tue, Sep 22, 2009 at 17:27, Mark Thomas ma...@apache.org wrote: Alan wrote: snip/ Any help would be more than appreciated. And when you try with a more recent version? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
On 2009-09-22, at 11:33, Christopher Schultz ch...@christopherschultz.net wrote: Somebody needs to write a virus that just converts everything to UTF-8 so we can be done with it. I hear you can contract out that sort of work these days. :-) -- Len - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: webapps examples and security manager
From: Alan [mailto:alanwil...@gmail.com] Subject: Re: webapps examples and security manager Not yet, which one would suggest me please? The latest, always (6.0.20). - 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.
Deploying Tomcat on Windows CE
Hi, We have a web application that runs on Tomcat 6x. We want to deploy this application on a symbol MC 3090 device running windows CE as the OS. Would it be possible to deploy Tomcat 6x on Windows CE and run our application on that? Thanks, Ajay
RE: Deploying Tomcat on Windows CE
From: Ajay Kapur [mailto:ajay.ka...@appsassociates.com] Subject: Deploying Tomcat on Windows CE We have a web application that runs on Tomcat 6x. We want to deploy this application on a symbol MC 3090 device running windows CE as the OS. Would it be possible to deploy Tomcat 6x on Windows CE and run our application on that? Tomcat is pure Java, so if you've got a 1.5-compliant JRE it's theoretically possible. I don't think Java ME will suffice. http://dilbert.com/strips/?F=1CharIDs=ViewType=FullAfter=09%2F06%2F1989Before=09%2F06%2F1989Order=s.DateStripPerPage=9x=25y=10CharFilter=Any - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
Christopher Schultz wrote: ... Then of course, after the above trivial matter of the filename is resolved, one may have to tackle the matter of how the file contents are encoded. At least the programmer has some measure of control over that. Not if she doesn't know what they have been created with though. But let's leave that for a later stage, and first deal with the filenames. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
Sylvie Perrin wrote: ... - your application, running (later) under Tomcat, is supposed to read these files and do something with them. I suppose that you do not know in advance, what the names of these files will be, and you just have to take what is there. Is that correct ? You perfectly undestood requirements of my real application. I know that I will expect others wonderful problems :-) Ok, then we need Christopher's Java knowledge now. Christopher, how does one, in Java, read a directory item by item ? We need this kind of thing : - open the directory - while (variable fn = next directory item) { - next if item is not a regular file - open the file named fn - do something to that file - close the file - delete the file ? } - close the directory And (just to anticipate the next issue), Sylvie, does your program actually need to read the content of the file and do something with that content ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Deploying Tomcat on Windows CE
Ajay Kapur wrote: Hi, We have a web application that runs on Tomcat 6x. We want to deploy this application on a symbol MC 3090 device running windows CE as the OS. Would it be possible to deploy Tomcat 6x on Windows CE and run our application on that? Probably. How much are you willing to pay ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Deploying Tomcat on Windows CE
Could you give me a ballpark estimate of what it could cost and how long the development would take? Thanks, Ajay From: André Warnier a...@ice-sa.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 22, 2009 3:32:07 PM Subject: Re: Deploying Tomcat on Windows CE Ajay Kapur wrote: Hi, We have a web application that runs on Tomcat 6x. We want to deploy this application on a symbol MC 3090 device running windows CE as the OS. Would it be possible to deploy Tomcat 6x on Windows CE and run our application on that? Probably. How much are you willing to pay ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 9/22/2009 3:24 PM, André Warnier wrote: Ok, then we need Christopher's Java knowledge now. Or you could look at the API ;) Christopher, how does one, in Java, read a directory item by item ? See my other message on this thread which includes source code to do just that. And (just to anticipate the next issue), Sylvie, does your program actually need to read the content of the file and do something with that content ? Yeah, remember to use a Reader and specify the character encoding. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq5KHMACgkQ9CaO5/Lv0PBmwgCfSkP+muADl9MZz8wBoGyr2509 jloAoIqaM5pl46EV7PQyhVA2G3pXiCJl =5MnR -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
Christopher Schultz wrote: ... I wonder if Java uses the file.encoding system property (which is set by the portion of $LC_ALL after the .) to convert bytes returned from the filesystem into filenames and vice versa. Yeah, that appears to be the case: Christopher, your detailed analysis is impressive and undoubtedly accurate, but beyond what I can swallow right now in Java and after 2 glasses of Spanish wine. So let me ask a simple question : - a file named fichié.txt has been created in a directory, by a process that spoke iso-8859-1 (so the filename is 10 bytes long). - a Tomcat runs in a process whose locale is set to UTF-8, and an application inside this Tomcat reads the filename from the directory into a Java String variable S. What happens ? - does the application get an exception due to invalid encoding ? - if not, why not ? - if not, what is now the content, in bytes, of variable S ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Create FileInputStream in servlet from remote file with accentuated character name
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 9/22/2009 3:58 PM, André Warnier wrote: your detailed analysis is impressive and undoubtedly accurate, but beyond what I can swallow right now in Java and after 2 glasses of Spanish wine. It's probably better than having 2 pints of Belgian beer. Wow. So let me ask a simple question : - a file named fichié.txt has been created in a directory, by a process that spoke iso-8859-1 (so the filename is 10 bytes long). Ok. - a Tomcat runs in a process whose locale is set to UTF-8, and an application inside this Tomcat reads the filename from the directory into a Java String variable S. What happens ? - does the application get an exception due to invalid encoding ? No. The results of my other test suggest that you basically just get garbage characters in the filename. - if not, why not ? Good question. Maybe the JVM authors decided that garbage characters were better than an inaccessible file (and I tend to agree with that trade-off). - if not, what is now the content, in bytes, of variable S ? Heh. Beats me. I couldn't understand how the UTF-8 filename had been mangled when in ANSI mode, so I'm not sure if such mangling is reversible. I wonder if you could re-encode the filename something like this: String encoding = System.getProperty(file.encoding); String filename = file.getName(); // gets you junk String recoded = new String(filename.getBytes(encoding), UTF-8); Of course, this only works if: 1. the file was originally written in UTF-8 mode 2. The ANSI mangling that has occurred is reversible using the above method (duh) If you have some suspicion as to the encoding used to encode the filename in the first place, you could re-code the filename several times and attempt a match (using String.equals). Better yet, you could re-code the filename you /think/ you have into a String and then use that to check against the filesystem. I dunno. This is pretty ugly. Again, setting everything to UTF-8 dramatically reduces headaches in these areas. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq5L04ACgkQ9CaO5/Lv0PAlGQCdEjzO/3Ikf1ooQDVmkpzOiLl1 j0IAn1NiU8tbcdMGDra6thzvPFYml1m3 =yOp/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org