Re: what ist $CATALINA_HOME/server ? (debian)
Am 07.12.2010 22:19, schrieb g f: Did you aptitude install tomcat6? If so why not modify the init.d script that came with that. If not perhaps you want to try to use the debs. apt-get install tomcat6 G AFAIK there isn't such a thing like a tomcat6 package under the debian distribution. And I would have to tackle the debianisms in that script. (jsvc e.g.) -- Christoph P.U. Kukulies - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Getting hold of an IP address
Hi apache-tomcat-6.0.16 jdk1.6.0_03 My application contains instances of javax.servlet.http.HttpSessionListener and javax.servlet.Filter (among other classes of course) My question is, is it possible to obtain the originating IP address of a request from either of these classes I've had a good look around with no luck so far. Thanks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TOMCAT be in Hung state?
1) do you have some scheduled process that deletes the catalina.out every 45 days? usually in linux, when logger open a file and some other process deleted the file, it will not create new file, which i suspect the case in catalina.out 2) probably combined with some part of code swallowing fatal error like such as permgenspace out of memory, you will not anything in catalina.out --- daniel baktiar http://savinggaia.tritiumapps.com - saving the planet is everyone's business! On 8 December 2010 15:40, Karthik Nanjangude karthik.nanjang...@xius-bcgi.com wrote: Hi Spec a) JDK 1.6 b) 2 Web Server Tomcat 5.0.20 (on same O/s with different Startup /shutdown portsshare the same RAM / CPU Processor] c) O/s Linux Red hat [ Linux DTVMS1 2.6.18-128.1.10.el5PAE #1 SMP Wed Apr 29 14:24:53 EDT 2009 i686 i686 i386 GNU/Linux ] 1. RHEL AS 4U6 2. 8*2 GB RAM 3. 4 Processors JAVA_OPTS=-Xms256m -Xmx512m Problem: Tomcat is not responding every 45 days 1) Stops writing Catalina.out, 2) Not responding with any of the jsp pages of the Application, 3) No exceptions raised. and needs restart to over come the situation. Can any body tell me under what circumstances can a TOMCAT be in Hung state? with regards N.S.Karthik
Re: Getting hold of an IP address
2010/12/8 Lyallex lyal...@gmail.com: My application contains instances of javax.servlet.http.HttpSessionListener and javax.servlet.Filter (among other classes of course) My question is, is it possible to obtain the originating IP address of a request from either of these classes ServletRequest.getRemoteAddr() (In a Filter. There is no request in HttpSessionListener). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Getting hold of an IP address
On 8 December 2010 10:04, Konstantin Kolinko knst.koli...@gmail.com wrote: ServletRequest.getRemoteAddr() (In a Filter. There is no request in HttpSessionListener). Best regards, Konstantin Kolinko ahem ... yes, well that was easy wasn't it In my (weak) defense it's been a long while since I did any coding Thank you - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
how to enable Tomcat to handle proprietary TCP streams (non-http data)
Hi I'm writing application composed from few loosely coupled components (dependency injection pattern, all compoments written by my team). First of them listens for connections, spawns new thread (serversocket.accept) receives data in proprietary format and then sends data to next component, next component transforms data (optimizes, creates some packages), and next component sends data further (probably using WebServices or WebDAV). Additionally I need to track/monitor whole application/process by external application placed on user computer (connected thru WebServices) I want to put this whole application on Tomcat. It would perfect if tomcat can accept connection (serversocket.accept), spawn new thread (my my code) and pass socket (input/output streams) to it. then my components can handle whole business logic (maybe with Spring help). How to enable Tomcat to receive propertiary TCP stream (i have external library for this), GenericServlet is for http data and I need something for non-http streams. I've searched for solution and found http://www.mail-archive.com/users@tomcat.apache.org/msg12810.html http://marc.info/?l=tomcat-userm=122193433217430w=2 http://marc.info/?l=tomcat-userm=119569480213083w=2 http://marc.info/?l=tomcat-userm=117289842121590w=2 Is this a good place to start? Should I write my own ProtocolHandler or my own Connector ? Where should I begin ? Best regards, razor - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Issues on startup for tomcat 5.5 on RHEL 5.5
-Original Message- From: Konstantin Kolinko Sent: Wednesday, December 08, 2010 0:29 To: Tomcat Users List Subject: Re: Issues on startup for tomcat 5.5 on RHEL 5.5 2010/12/7 Jason Pyeron jpye...@pdinc.us: The permissions on /usr/share/tomcat5/conf/ are 775 and owned by root.tomcat. It is a bad idea to have the configuration files world-readable. Especially tomcat-uses.xml and server.xml. That is a valid point but not the issue at hand. java.io.IOException: IOException writing to /usr/share/tomcat5/conf/tomcat-users.xml.new What you do not understand in the above message? Tomcat saves the file to a new name, then renames it. I understand the message, it says tomcat cannot write that file. What I do not understand is how it cannot write that file. BTW, it is possible to set readonly=true on the UserDatabase entry in server.xml and Tomcat won't try to write that file. (In Tomcat 6+ readonly flag is true by default). cat /etc/tomcat5/tomcat-users.xml This file is not in /usr/share/tomcat5/conf/ Right, that is a symlink to /etc/tomcat5, which has all the properties as decribed for /usr/share/tomcat5/conf/ (if I had tested /usr/share/tomcat5/conf then the information provided would have been for the symlink and not the target) So the question remains, what could have changed on the RHEL 5.5 system between last week and present to make tomcat complain. Unfortunatly the backups of the system were only on /usr/local and /home so theyt were of no help and the rpm log only indicates a kerbos update. -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: TOMCAT be in Hung state?
Hi do you have some scheduled process that deletes the catalina.out every 45 days? No we do not have any other application doing the same. such as permgenspace out of memory, you will not anything in catalina.out Since the Catalina.out file is not being generated we do not know if the same has happened. [ There is no Console view on Linux Os/ for Tomcat to validate the same. ] With regards karthik -Original Message- From: Daniel Baktiar [mailto:dbakt...@gmail.com] Sent: Wednesday, December 08, 2010 3:34 PM To: Tomcat Users List Subject: Re: TOMCAT be in Hung state? 1) do you have some scheduled process that deletes the catalina.out every 45 days? usually in linux, when logger open a file and some other process deleted the file, it will not create new file, which i suspect the case in catalina.out 2) probably combined with some part of code swallowing fatal error like such as permgenspace out of memory, you will not anything in catalina.out --- daniel baktiar http://savinggaia.tritiumapps.com - saving the planet is everyone's business! On 8 December 2010 15:40, Karthik Nanjangude karthik.nanjang...@xius-bcgi.com wrote: Hi Spec a) JDK 1.6 b) 2 Web Server Tomcat 5.0.20 (on same O/s with different Startup /shutdown portsshare the same RAM / CPU Processor] c) O/s Linux Red hat [ Linux DTVMS1 2.6.18-128.1.10.el5PAE #1 SMP Wed Apr 29 14:24:53 EDT 2009 i686 i686 i386 GNU/Linux ] 1. RHEL AS 4U6 2. 8*2 GB RAM 3. 4 Processors JAVA_OPTS=-Xms256m -Xmx512m Problem: Tomcat is not responding every 45 days 1) Stops writing Catalina.out, 2) Not responding with any of the jsp pages of the Application, 3) No exceptions raised. and needs restart to over come the situation. Can any body tell me under what circumstances can a TOMCAT be in Hung state? with regards N.S.Karthik - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: what ist $CATALINA_HOME/server ? (debian)
Not sure of your distro and your requirements but for squeeze there is: http://packages.debian.org/squeeze/tomcat6 lenny: http://packages.debian.org/lenny/tomcat5.5 Now the script modification is a different story. Cheers, GF On Wed, Dec 8, 2010 at 3:02 AM, Christoph Kukulies k...@kukulies.orgwrote: Am 07.12.2010 22:19, schrieb g f: Did you aptitude install tomcat6? If so why not modify the init.d script that came with that. If not perhaps you want to try to use the debs. apt-get install tomcat6 G AFAIK there isn't such a thing like a tomcat6 package under the debian distribution. And I would have to tackle the debianisms in that script. (jsvc e.g.) -- Christoph P.U. Kukulies - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Issues on startup for tomcat 5.5 on RHEL 5.5
2010/12/8 Jason Pyeron jpye...@pdinc.us: java.io.IOException: IOException writing to /usr/share/tomcat5/conf/tomcat-users.xml.new What you do not understand in the above message? Tomcat saves the file to a new name, then renames it. I understand the message, it says tomcat cannot write that file. What I do not understand is how it cannot write that file. Try to create that file. Maybe that'd give you some additional clue. Maybe the file is already there, or maybe Tomcat runs not under the user that you are expecting (or that user is non a member of the tomcat group). Anyway, I certainly recommend you to set readonly=true. [1] BTW, it is possible to set readonly=true on the UserDatabase entry in server.xml and Tomcat won't try to write that file. (In Tomcat 6+ readonly flag is true by default). [1] http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#UserDatabase_Resources Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TOMCAT be in Hung state?
Am Mittwoch, den 08.12.2010, 13:10 +0530 schrieb Karthik Nanjangude: Hi Spec a) JDK 1.6 b) 2 Web Server Tomcat 5.0.20 (on same O/s with different Startup /shutdown portsshare the same RAM / CPU Processor] c) O/s Linux Red hat [ Linux DTVMS1 2.6.18-128.1.10.el5PAE #1 SMP Wed Apr 29 14:24:53 EDT 2009 i686 i686 i386 GNU/Linux ] 1. RHEL AS 4U6 2. 8*2 GB RAM 3. 4 Processors JAVA_OPTS=-Xms256m -Xmx512m That is a low setting compared to the ram of the machines. But if your application needs only that much, it should be fine. Problem: Tomcat is not responding every 45 days 1) Stops writing Catalina.out, 2) Not responding with any of the jsp pages of the Application, 3) No exceptions raised. and needs restart to over come the situation. Can any body tell me under what circumstances can a TOMCAT be in Hung state? You could try yourself by taking threaddumps at such times: http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F hth Felix with regards N.S.Karthik - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Issues on startup for tomcat 5.5 on RHEL 5.5
-Original Message- From: Konstantin Kolinko Sent: Wednesday, December 08, 2010 9:35 To: Tomcat Users List Subject: Re: Issues on startup for tomcat 5.5 on RHEL 5.5 2010/12/8 Jason Pyeron jpye...@pdinc.us: java.io.IOException: IOException writing to /usr/share/tomcat5/conf/tomcat-users.xml.new What you do not understand in the above message? Tomcat saves the file to a new name, then renames it. I understand the message, it says tomcat cannot write that file. What I do not understand is how it cannot write that file. Try to create that file. Maybe that'd give you some additional clue. Maybe the file is already there, or maybe Tomcat runs not under the user that you are expecting (or that user is non a member of the tomcat group). Maybe I forgot to mention in my original post, that the tomcat user can create and modify files in that directory, further that I checked the selinux log file while the error was happening and there was no relevant output. Anyway, I certainly recommend you to set readonly=true. [1] It is set to readonly now. But there was some change on the system, which caused it to stop working in readwrite mode. Tomcat had been installed and functioning every week for many months now. BTW, it is possible to set readonly=true on the UserDatabase entry in server.xml and Tomcat won't try to write that file. (In Tomcat 6+ readonly flag is true by default). [1] http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.h tml#UserDatabase_Resources I do not have any use for built in user authentication. I will eventually try to disable it entirely. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: enforcing SSL only for external clients
On Tuesday, December 07, 2010 14:34:55 Aggarwal, Ajay wrote: Aggarwal, Ajay wrote: My tomcat application (running on a linux host) has 2 types of clients. Local clients coming on localhost (127.0.0.1) and external clients coming on external interfaces. I want to enforce use of SSL only for external clients. How do I do that? If I use security-constraint I am assuming it will apply to both local as well as external clients. Perhaps Url Rewrite Filter http://www.tuckey.org/urlrewrite can be set up to redirect all http requests to https with the same URL? Something like (not tested) rule condition type=scheme operator=equal^http$/condition condition type=remote-addr operator=notequal127.0.0.1/condition from/(.*)/from to type=permanent-redirect last=truehttps://%{server-name}/$1/to /rule Configure -- Nicholas Sushkin, Senior Software Engineer, Manager of IT Operations Open Finance Aggregation eXchange http://www.aggex.com smime.p7s Description: S/MIME cryptographic signature
Re: enforcing SSL only for external clients
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 12/7/2010 6:02 PM, Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: enforcing SSL only for external clients You will probably need 2 separate Connectors, one for HTTP and the other for HTTPS. I think that's true. It's definitely true: a single connector can't serve both secure and non-secure. ;) You probably need to set the useIPVHosts attribute inside your Connector tags to true. Probably not necessary, nor are multiple Host elements. If the OP /really wants/ to use transport-guarantee, then dual hosts will be necessary. How about just setting the address attribute for the port 80 Connector to 127.0.0.1, and the port 443 Connector to the public IP address, and *do not* set transport-guarantee to CONFIDENTIAL in the web.xml files. I like this solution, unless of course the OP feels strongly about using transport-guarantee. If the web application needs to provide it's own enforcement of these requirements, it can be done with a custom filter or even with Tucky's urlrewrite. That way, the webapp can protect itself instead of having to rely on the (independent) server configuration. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/0T0ACgkQ9CaO5/Lv0PBGUwCgwSlYBCLwTfj3vgMpEo8dq90r 7GgAnRiNlPdKJmVWOY206/a2Ii36zJ8c =XXNO -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how to enable Tomcat to handle proprietary TCP streams (non-http data)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Razor, On 12/8/2010 7:15 AM, razor wrote: I'm writing application composed from few loosely coupled components (dependency injection pattern, all compoments written by my team). First of them listens for connections, spawns new thread (serversocket.accept) receives data in proprietary format and then sends data to next component, next component transforms data (optimizes, creates some packages), and next component sends data further (probably using WebServices or WebDAV). Additionally I need to track/monitor whole application/process by external application placed on user computer (connected thru WebServices) I want to put this whole application on Tomcat. It would perfect if tomcat can accept connection (serversocket.accept), spawn new thread (my my code) and pass socket (input/output streams) to it. So, you want to use Tomcat as a TCP connection handler? Most of the Tomcat code is dedicated to servicing the HTTP services required by the servlet spec -- very little of it merely handles TCP connections. I'm not familiar with the internals of Tomcat (yet) but something like a ProtocolHandler would probably work, though you might end up writing a ton of code to meet Tomcat's requirements. You may find that writing your own connection management code is more straightforward and lightweight than using Tomcat as a container for something other than HTTP-based servlets. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/0jcACgkQ9CaO5/Lv0PAEawCghCxix6MM++HjKTqs8q0V2QiN ND4AoJyRXeUNnr2VUaBm1G6B0NUfziFT =X2hB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Questions about installing APR
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 12/7/2010 12:55 PM, Mark Eggers wrote: man pkg-config From the description of pkg-config: The pkg-config program is used to retrieve information about installed libraries in the system. It is typically used to compile and link against one or more libraries. In short, you don't need to copy the .pc files over. +1 The .so files should be self-contained (other than the series of symlinks created as well) and refer to standard libraries such as libc, etc. It would be worth your time to ensure that the symlinks remain symlinks as you copy them from machine to machine. I think GNU tar can handle symlinks without any special switches, so I recommend using it to grab all the files at once and transfer them to another machine. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/0uAACgkQ9CaO5/Lv0PBWhgCcDsIS2il+x7uJDmJ8yvgCAveH iRUAn02iZfv8mIgL4jO70iC9pNcKFt8+ =PTOG -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how to enable Tomcat to handle proprietary TCP streams (non-http data)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Łukasz, On 12/8/2010 2:23 PM, Łukasz Tołwiński wrote: I'm not sure how to reply to mailing list (am I replying to you or tomcat.users ? ) You succeeded in replying to me, but it's more appropriate to reply to the list. I'm still wondering what libraries should I use, someone proposed Apache Camel, but I'm new to this libraries and my project is urgent. I don't know anything about Apache Camel -- you'll have to ask the Camel folks about your project. I wanted to use Tomcat, because I will use it to send data thru Web Services and expose some statuses for some GUI frontend (swing) thru WebServices too. There's nothing stopping you from launching your own non-HTTP service from within Tomcat during application startup... just remember to properly shut it down when your webapp stops. Then you get the best of both worlds: your web services can run through Tomcat and your proprietary communication protocol can run over another channel/port managed by your webapp. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/3S0ACgkQ9CaO5/Lv0PC6OQCfS6ZYw74/a7V/FPK7EVDRqaYF 96UAniZyvwEvWTclgjoZq0khrx/u+MLm =lQXg -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
HTTP status 404
Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Thanks for the feedback Lava
Re: HTTP status 404
I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). I strongely recommand you to use an IDE such as Netbeans, create a new Java Web Application project, put your html file in the project build it. Netbeans will generate a correct [YourProjectName].war, that you can deploy or extract to see exactly how it was build, what you need to set etc... Victor http://www.voxnucleus.fr 2010/12/8 Lava Saleem lnsal...@ualr.edu Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Thanks for the feedback Lava
Re: HTTP status 404
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lava, Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? On 12/8/2010 2:39 PM, Lava Saleem wrote: I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. I did not modify the web.xml since I don't need the servlets do I need to modify anything? Maybe. HTTP status 404 description the requested resource (/filename/)is not available What URL did you request? What resource did you expect it to serve? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4L4ACgkQ9CaO5/Lv0PAScgCePUhYj8pYL/9Vb3eNZDHncVa3 GAsAoLvpcJjFYd1vb6ufehd41FgB084q =SFt0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Victor, On 12/8/2010 2:45 PM, Victor Kabdebon wrote: I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). You are wrong. Tomcat is designed to serve static files via the DefaultServlet, which is (surprise) enabled by default. I strongely recommand you to use an IDE such as Netbeans - -1 If the OP can't figure out how to place files on the disk, adding an IDE is going to make things so much worse. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4RgACgkQ9CaO5/Lv0PC3ewCgmzrIYL3kkkGLHcCd5x4QKVqC I8UAoK4p3jnNS1XnDO706cZzSVn53FVA =X4w9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how to enable Tomcat to handle proprietary TCP streams (non-http data)
So i can just start my own thread (threads) for receiving non-http data (where to put initialization/starting stuff? as a new servlet ? ) and then my code will put received data in some 'public' synchronized queue/collection or database (like HSQLDB) and other threads/modules (and again, where should i start them? in new servlets?) can process data and at the end next threads have to send data using webservices or/and webdav (a lot of data and i need resume option if something goes wrong) Is my thinking correct ? Regards razor 2010/12/8 Christopher Schultz ch...@christopherschultz.net: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Łukasz, On 12/8/2010 2:23 PM, Łukasz Tołwiński wrote: I'm not sure how to reply to mailing list (am I replying to you or tomcat.users ? ) You succeeded in replying to me, but it's more appropriate to reply to the list. I'm still wondering what libraries should I use, someone proposed Apache Camel, but I'm new to this libraries and my project is urgent. I don't know anything about Apache Camel -- you'll have to ask the Camel folks about your project. I wanted to use Tomcat, because I will use it to send data thru Web Services and expose some statuses for some GUI frontend (swing) thru WebServices too. There's nothing stopping you from launching your own non-HTTP service from within Tomcat during application startup... just remember to properly shut it down when your webapp stops. Then you get the best of both worlds: your web services can run through Tomcat and your proprietary communication protocol can run over another channel/port managed by your webapp. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/3S0ACgkQ9CaO5/Lv0PC6OQCfS6ZYw74/a7V/FPK7EVDRqaYF 96UAniZyvwEvWTclgjoZq0khrx/u+MLm =lQXg -END PGP SIGNATURE- -- Łukasz -- Łukasz - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). Sorry but that's just not correct. Any file in the webapp, but outside of the WEB-INF folder can be delivered by the default servlet without any special settings in web.xml or anywhere else for that matter. --David On 12/8/2010 2:45 PM, Victor Kabdebon wrote: I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). I strongely recommand you to use an IDE such as Netbeans, create a new Java Web Application project, put your html file in the project build it. Netbeans will generate a correct [YourProjectName].war, that you can deploy or extract to see exactly how it was build, what you need to set etc... Victor http://www.voxnucleus.fr 2010/12/8 Lava Saleem lnsal...@ualr.edu Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Thanks for the feedback Lava - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
Christopher, Yes but using tomcat to server html files looks to me like using a hammer to kill a fly. Anyway everybody is free to do what he wants ! Concerning the IDE, its advantage is to be automatic, but in a way it adds an extra layer of difficulty... Victor http://www.voxnucleus.fr 2010/12/8 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Victor, On 12/8/2010 2:45 PM, Victor Kabdebon wrote: I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). You are wrong. Tomcat is designed to serve static files via the DefaultServlet, which is (surprise) enabled by default. I strongely recommand you to use an IDE such as Netbeans - -1 If the OP can't figure out how to place files on the disk, adding an IDE is going to make things so much worse. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4RgACgkQ9CaO5/Lv0PC3ewCgmzrIYL3kkkGLHcCd5x4QKVqC I8UAoK4p3jnNS1XnDO706cZzSVn53FVA =X4w9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
Sorry if I didn't write properly what I wanted to say, but what I was saying is just that if you want to serve only static html files there are many other simpler solutions to do that, that's all. Again even I use it for example to serve .css, .js files on my server so I agree it is 100 % possible to use a tomcat server that way. Victor Kabdebon http://www.voxnucleus.fr 2010/12/8 Victor Kabdebon victor.kabde...@gmail.com Christopher, Yes but using tomcat to server html files looks to me like using a hammer to kill a fly. Anyway everybody is free to do what he wants ! Concerning the IDE, its advantage is to be automatic, but in a way it adds an extra layer of difficulty... Victor http://www.voxnucleus.fr 2010/12/8 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Victor, On 12/8/2010 2:45 PM, Victor Kabdebon wrote: I might be wrong but maybe you need to set something in your web.xml to deliver static files. (basically Tomcat is not designed to run static html files, you can use a combination of Apache serveur + tomcat serveur to do that). You are wrong. Tomcat is designed to serve static files via the DefaultServlet, which is (surprise) enabled by default. I strongely recommand you to use an IDE such as Netbeans - -1 If the OP can't figure out how to place files on the disk, adding an IDE is going to make things so much worse. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4RgACgkQ9CaO5/Lv0PC3ewCgmzrIYL3kkkGLHcCd5x4QKVqC I8UAoK4p3jnNS1XnDO706cZzSVn53FVA =X4w9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Separte http connector for 2 apps.
Hi Experts, I have 2 applications call it app1 and app2 deployed on the same tomcat server (6.0.18). The external client use both of these apps. Right now both the apps use same http connector on port 8080. So threads and corresponding thread setting (like maxThreads, acceptCounts etc) associated with connectors are shared between the 2 apps. That means if the traffic increase for app1 and request for it start to queue up, the app 2 request may suffer delay or time out. Going through the documentation, it seems one way of resolving this would be, to declare 2 separate services in service.xml for the 2 apps. Each service will have its on http connector with appropriate maxThread and acceptCount settings. That way high volume on app1 does not starve or timeout the app2 requests. Also we are thinking of restrict maxthread and accept count on app1 to low value, so that it does not hog processing resources etc. Some other reason we cannot put these apps on different tomcat instance. This would ideal solutions but not possible in this case. Please suggest if there is other or better way of doing it. Thanks in advance Shri.
Re: HTTP status 404
webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib If I read this right, 'filename.htm' is being stored in webapp/filename/WEB-INF/filename.htm inside your .war file. FWIW, WEB-INF has no special meaning except in the top level of your .war archive A .war archive built like this will most likely deploy as a static html folder and everything in it will be available as static files. HTTP status 404 description the requested resource (/filename/)is not available If you wanted to get filename.htm with the structure I think you are describing, you should be requesting /$WEBAPP/webapp/filename/WEB-INF/filename.htm where $WEBAPP is the context your war file is deployed under. Usually $WEBAPP is the name of the war file. For instance if the .war file is myapp.war, the request path to filename.htm under tomcat would most likely be myapp/webapp/filename/WEB-INF/filename.htm To fix a *lot* of problems right off the bat, your war archive should look more like: filename.htm WEB-INF web.xml classes lib META-INF (what ever lives under here) Then the request path (again assuming the war file is named myapp.war) would be /myapp/filename.htm --David On 12/8/2010 2:39 PM, Lava Saleem wrote: Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Thanks for the feedback Lava - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
On Wed, Dec 8, 2010 at 12:05 PM, David Smith david.sm...@cornell.edu wrote: If you wanted to get filename.htm with the structure I think you are describing, you should be requesting /$WEBAPP/webapp/filename/WEB-INF/filename.htm Which (thankfully) won't work, per the spec :-) -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
Hi Chris Thanks for the reply Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? No this one is a different question yes I have read the replies and went through the documentation What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. yes those are the folder path as you may see, I have filename.htm with web.xml with META-INF with classes with lib in a folder called WEB-INF this folder is in a folder called filename, filename is in the webapp folder. What URL did you request? What resource did you expect it to serve? yes I have the url and I can't think of any resources needed thats why Iam asking the question Thanks Lava On Wed, Dec 8, 2010 at 2:47 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lava, Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? On 12/8/2010 2:39 PM, Lava Saleem wrote: I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. I did not modify the web.xml since I don't need the servlets do I need to modify anything? Maybe. HTTP status 404 description the requested resource (/filename/)is not available What URL did you request? What resource did you expect it to serve? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4L4ACgkQ9CaO5/Lv0PAScgCePUhYj8pYL/9Vb3eNZDHncVa3 GAsAoLvpcJjFYd1vb6ufehd41FgB084q =SFt0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --
Re: HTTP status 404
Lava, Please read the following: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html Pay particular attention to: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html#Standard_Directory_Layout (please note the above link is line-wrapped) Here's an example. Each line level is a subdirectory. Comments are in parentheses. Static (top folder - application name) ├── (jsp, html, js, css, etc. - can have subdirectories) ├── META-INF (context.xml, not required - see Tomcat documentation) └── WEB-INF ├── classes (where the java classes you wrote go) ├── lib (where jar files - yours or third party libraries go) └── web.xml (deployment descriptor - read the standard) A minimal Tomcat 6 deployment descriptor for an application containing only static resources could be: ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun. com/xml/ns/javaee/web-app_2_5.xsd display-nameStatic Application/display-name descriptionHTML, CSS, and JS application/description welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app (note again that the third / fourth line of the web-app element is line-wrapped) The index.html file would go under Static (Static-index.html). The web.xml file would go under Static-WEB-INF (Static-WEB-INF-web.xml). You would display this application by copying the entire directory structure to $CATALINA_HOME/webapps, starting Tomcat, and then browse to http://localhost:8080/Static/ (provided you have not changed the default server.xml. If you want to make a war file, then go to the parent directory and issue the following command from the command line: jar tf Static.war Static Please note that case is important. This will create Static.war which can then be deployed using Tomcat's manager application (or copying Static.war to $CATALINA_HOME/webapps). . . . . just my two cents. /mde/ - Original Message From: Lava Saleem lnsal...@ualr.edu To: Tomcat Users List users@tomcat.apache.org Sent: Wed, December 8, 2010 12:12:18 PM Subject: Re: HTTP status 404 Hi Chris Thanks for the reply Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? No this one is a different question yes I have read the replies and went through the documentation What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. yes those are the folder path as you may see, I have filename.htm with web.xml with META-INF with classes with lib in a folder called WEB-INF this folder is in a folder called filename, filename is in the webapp folder. What URL did you request? What resource did you expect it to serve? yes I have the url and I can't think of any resources needed thats why Iam asking the question Thanks Lava On Wed, Dec 8, 2010 at 2:47 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lava, Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? On 12/8/2010 2:39 PM, Lava Saleem wrote: I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. I did not modify the web.xml since I don't need the servlets do I need to modify anything? Maybe. HTTP status 404 description the requested resource (/filename/)is not available What URL did you request? What resource did you expect it to serve? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4L4ACgkQ9CaO5/Lv0PAScgCePUhYj8pYL/9Vb3eNZDHncVa3 GAsAoLvpcJjFYd1vb6ufehd41FgB084q =SFt0 -END PGP SIGNATURE- - 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: HTTP status 404
Lava Saleem wrote: Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Hi. Except the 404 error which your are getting, not much above makes any sense at all. So it is better to forget all that, and start new. You really have to learn to walk before you can run. First, consider the directory structure of a standard Tomcat installation : (CATALINA_HOME) (=CATALINA_BASE) | |- bin (tomcat programs and scripts) |- conf (configuration files) |- lib (global library files) |- logs (logfiles) |- webapps (* web applications *) |- ROOT (the special, top-level, default web application) |- app1 (a web application) |- app2 (another web application) |- ... |- lastapp (another web application) In the above, (CATALINA_HOME) represents the top directory of your Tomcat installation, the one under which the rest of Tomcat is found. For example, on your system it may be C:\tomcat or C:\program files\Apache Software Foundation\tomcat6.0 or /usr/share/tomcat6 or /usr/local/tomcat6 or whatever. The webapps sub-directory is what is important for you now. That is where you will put web applications, composed of static html pages (with or without javascript in them), JSP pages (special html pages with embedded Java code), java servlets (compiled java applications), etc.. The ROOT web application is special. It is the default application. When you use a URL like : http://yourserver.yourcompany.com/abc.html Tomcat is going to look for abc.html under the webapps/ROOT directory. The other subdirectories under webapps are each one separate web application. To access for example the application named app1, you will have to use a URL starting with http://yourserver.yourcompany.com/app1/; For example, if you place a html page named xyz.html in the subdirectory (CATALINA_HOME)/webapps/app1, then the URL to call it up will be http://yourserver.yourcompany.com/app1/xyz.html Under such a web application directory like ../webapps/app1, there is also a structure. It looks like this : (CATALINA_HOME) (=CATALINA_BASE) |- webapps (* dir, top of all web applications *) | |- app1 (dir, contains the web application named app1) - public files (html etc..) - WEB-INF (directory) |- files (private) |- web.xml (configuration file for the application) |- classes (dir.) |- compiled java classes, like servlets |- lib (dir) |- java libraries for this webapp - META-INF (dir.) |- context.xml (more settings for the application) Basically everything under app1 is optional. Tomcat will supply a default if needed. Of course, you will want at least one file under there, to make the execise meaningful. What is in the sub-directories WEB-INF and META-INF, can never be obtained directly by a browser. Tomcat will not allow it. So if you enter the following URL in the browser : http://yourserver.yourcompany.com/app1/WEB-INF/something Tomcat will respond with an error, even if something exists. But to start, I suggest that you just - stop tomcat - create a new sub-directory under ../webapps/, for example myapp. - under that subdirectory, place a file called myfile.html - verify that the ownership and permissions of these files are such that the Tomcat user can read them - start Tomcat - in the browser, enter the URL : http://yourserver.yourcompany.com/myapp/myfile.html and enjoy. Now play around with the above : - create another page mypage2.html, place it alongside myfile.html, start Tomcat and call up the new page in the browser. - then stop Tomcat again, and create another subdirectory under webapps, put something there, start Tomcat and call it up with the browser. - then stop Tomcat again, create a sub-directory WEB-INF under one of your webapps, put something in it, start Tomcat and try to call up that file. When you understand exactly how that works, then go read this page (again) : http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html And then you should come back for more questions about how to make .war files and deploy them properly. (tip : a .war file is just a zip file with the same content as the app1 subdirectory above. It has to be named app1.war, and you have to copy it under /webapps/ for Tomcat to understand what you want).
RE: enforcing SSL only for external clients
Thanks to all who have given different suggestions. Binding HTTP (port 80) to 127.0.0.1 and HTTPS (port 443) to external/public IP will not work for me. My situation is slightly more complicated. For external clients, I want to enforce SSL only on part of my application (certain URLs) not all. I will look into URL Rewrite as suggested by Nicholas. -Ajay
Re: enforcing SSL only for external clients
Aggarwal, Ajay wrote: Thanks to all who have given different suggestions. Binding HTTP (port 80) to 127.0.0.1 and HTTPS (port 443) to external/public IP will not work for me. My situation is slightly more complicated. Now why did I guess that already ? Probably the experience of customer-written specifications. :-) For external clients, I want to enforce SSL only on part of my application (certain URLs) not all. I will look into URL Rewrite as suggested by Nicholas. And when you really take into account all aspects of the requirements (authentication for the externals ?), you may still want to have a second look at the 2 Host possibilities. Mixing SSL and non-SSL parts within the same application is - in my humble view - a recipe for a lot of complications and user inconvenience. (Such as : some browsers will pop up a message to the user, when switching from HTTP to HTTPS and vice-versa) Q: if a part of it, for some category of users, has to go through HTTPS, then what stops you from making it all HTTPS for everyone, internal and external ? Q: what about a simple front-end proxy, which would take care of the HTTPS part for the externals, and connect internally to Tomcat over standard HTTP ? The internals can go around the proxy and access the application directly via HTTP. A minimal Apache httpd, running on the same box, would do that easily. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: enforcing SSL only for external clients
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 12/8/2010 5:01 PM, André Warnier wrote: Aggarwal, Ajay wrote: For external clients, I want to enforce SSL only on part of my application (certain URLs) not all. I will look into URL Rewrite as suggested by Nicholas. Mixing SSL and non-SSL parts within the same application is - in my humble view - a recipe for a lot of complications and user inconvenience. (Such as : some browsers will pop up a message to the user, when switching from HTTP to HTTPS and vice-versa) +1 Other considerations: - - If you want to protect user credentials, you must use SSL during authentication - - If you authenticate using SSL, you will likely lose your session when dropping down to non-secure The best advice is to simply use SSL if you care about the security of your app and your users. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0AAzcACgkQ9CaO5/Lv0PCwFQCeMvpGXtjcoMO1SvoDHC6je2rB C7wAoKuKtaDJnlIdwpYyzDhi+Fi07XCO =Im2l -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: enforcing SSL only for external clients
Most of the application will be over SSL for external clients. There is one part where the clients may upload or download a huge file over HTTP which I don't want to go through SSL. I am thinking uploading/downloading these huge files over SSL will create lot of stress on the server. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, December 08, 2010 5:14 PM To: Tomcat Users List Subject: Re: enforcing SSL only for external clients -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 12/8/2010 5:01 PM, André Warnier wrote: Aggarwal, Ajay wrote: For external clients, I want to enforce SSL only on part of my application (certain URLs) not all. I will look into URL Rewrite as suggested by Nicholas. Mixing SSL and non-SSL parts within the same application is - in my humble view - a recipe for a lot of complications and user inconvenience. (Such as : some browsers will pop up a message to the user, when switching from HTTP to HTTPS and vice-versa) +1 Other considerations: - - If you want to protect user credentials, you must use SSL during authentication - - If you authenticate using SSL, you will likely lose your session when dropping down to non-secure The best advice is to simply use SSL if you care about the security of your app and your users. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0AAzcACgkQ9CaO5/Lv0PCwFQCeMvpGXtjcoMO1SvoDHC6je2rB C7wAoKuKtaDJnlIdwpYyzDhi+Fi07XCO =Im2l -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Separte http connector for 2 apps.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shrikant, On 12/8/2010 3:03 PM, shrikant patel wrote: So threads and corresponding thread setting (like maxThreads, acceptCounts etc) associated with connectors are shared between the 2 apps. That means if the traffic increase for app1 and request for it start to queue up, the app 2 request may suffer delay or time out. Correct. Going through the documentation, it seems one way of resolving this would be, to declare 2 separate services in service.xml for the 2 apps. Correct: Connectors are associated with a Service, a Service has multiple Hosts and each host has any number of deployed webapps. In order to have connectors serve separate webapps exclusively, you actually have two options: 1. Two Services, separate Hosts, Connectors, and deployed webapps 2. Single Service, Host, and webapp with two Connectors: each connector must be on a different IP/port combination so you can have users of one webapp use a specific connector. You can enforce the use of a specific Connector by using a Valve or Filter to check the incoming port number and rejecting requests for the wrong webapp. Each service will have its on http connector with appropriate maxThread and acceptCount settings. That way high volume on app1 does not starve or timeout the app2 requests. If you have other shared resources such as a database, you might still have one webapp affecting the other. Of course, you will be sharing memory and CPU time as well. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0AB9kACgkQ9CaO5/Lv0PDxUgCfQcmWa40Gh5FROWplOWGR8xr8 WxoAoKrJiFRrjeKVzRRs/XZohsL2aUSq =AZ8R -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat dying on its own
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Victor, On 12/6/2010 3:47 PM, Victor Kabdebon wrote: Your Linux may also be involved. If you have some weird configuration of your system, it may kill/shutdown some services / applications. If it's the Linux OOM killer, you should get a syslog message about it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0ACI4ACgkQ9CaO5/Lv0PAAoACfUGhaL6RcYTwuwqwv8SLR47eU cnMAoJlllSFvtHrPUicQVmY/LqH8FXi+ =gAMu -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat dying on its own
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 12/6/2010 3:49 PM, Mark Thomas wrote: On 06/12/2010 20:44, Guillaume Carbonneau wrote: It happens every day or so. Nothing happens before in the log... I'm logging the requests but tomcat dies when there is no traffic it seems. I even tried to bench it with more than 1 requests the other day and it handled the load pretty fine and no crash. I control all the code in my app, there is no System.exit() call There have been cases of libraries calling System.exit() on some error conditions. Isn't there some indication of a System.exit() in catalina.out? If there isn't, we could write an optional Listener that could install a shutdown hook that will complain to stdout if the JVM goes down without Tomcat's permission. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0ACQEACgkQ9CaO5/Lv0PDQ2ACgk8slltfCse1b9Bo5F6m/G/im +mcAnjBW+x3l5MSpOzYOR6Lsy9aluCdL =GbUS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: enforcing SSL only for external clients
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ajay, On 12/8/2010 5:24 PM, Aggarwal, Ajay wrote: Most of the application will be over SSL for external clients. There is one part where the clients may upload or download a huge file over HTTP which I don't want to go through SSL. I am thinking uploading/downloading these huge files over SSL will create lot of stress on the server. FWIW, it's the SSL handshake that is most stressful part of the conversation. Once that's completed, the encryption on both sides is symmetric and fairly low-stress on the connection. I encourage you to benchmark your app under these conditions. It sounds like you are making performance decisions without any data to back them up. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0ACXcACgkQ9CaO5/Lv0PAfoQCgsCjgE9822FdGNbHY5HQ9Xoyw nz4An2YqcUk6m2XQcs4ZpAaWzoDm/WgW =4dCx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Setting listings=true on a per context basis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fergus, On 12/7/2010 9:27 AM, Fergus McMenemie wrote: Thanks for the response. Other than reading the 300 page servlet spec is there a quicker way to accomplish what I want. Of the 354 pages of the Servlet Spec 2.5, only pages 19-154 are worth reading. Before that, it's introductory stuff, and after that it gets into enterprise servlet stuff which Tomcat doesn't support, and most people don't need. I recommend reading the spec in the same way you'd eat an elephant: one bite (byte?) at a time. Mmmm... elephant. In the amount of time you might spend fighting against various contributors to this forum to extract information about the spec and how to do things, you could easily read the spec itself and then come back to hit some other newbie over the head with it :) Further, are you saying that use of catalina/localhost/vendoraDocs.xml is a tomcat only solution. This is just the webapp deployment hints for Tomcat. Chuck's direction to edit WEB-INF/web.xml is entirely portable and defined by the aforementioned quite-readable specification. How do I best standup a set of vendor supplied HTML docs and files for browsing through tomcat. It is not worth setting up IIS for, as we already using tomcat for other purposes. If you have a directory of static files already, you can just drop them into a subdirectory under TOMCAT_HOME/webapps and it will auto-deploy (assuming you have default settings in TOMCAT_HOME/conf/server.xml) into a URL like http://yourhost/dirname/your_files_go_here.html - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0ACz8ACgkQ9CaO5/Lv0PAHjACfXQXbFrlQru/VLYtKzJd5uXXt DRsAnRoQPS/9ixuKobYW+c+rzJ+kStxc =wYkb -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java thread open after Tomcat shutting down
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pix, On 12/7/2010 5:13 AM, pix_siro wrote: # give application 5 seconds to stop itself sleep 2 Fail - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0ADFcACgkQ9CaO5/Lv0PAV5ACeI7L1dygocD6J0gWCQCZrQG5z R80AniRtPygg5cBm5fI7/RvWwfTkKjFM =IXPK -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: enforcing SSL only for external clients
Aggarwal, Ajay wrote: Most of the application will be over SSL for external clients. There is one part where the clients may upload or download a huge file over HTTP which I don't want to go through SSL. I am thinking uploading/downloading these huge files over SSL will create lot of stress on the server. Let me be constructively critical and provide my 2 cent : If we are talking about a standard web application using a standard html interface and standard browsers, then such an upload would be triggered by a POST from a html form with a input type=file in it, right ? If the upload URL (target of the form) is not within the HTTPS protected part, then anyone could access it and post a huge file to your site, no ? That may cause more stress on your server than doing this via HTTPS ever would. Or else, how are you going to ensure that any client uploading a huge file to your server is entitled to do so ? Plus, you may need to know who is doing this, just to know what to do with the file. So you would need a form of authentication that starts under HTTPS, but is valid also when posting the form under HTTP. Not necessarily evident, and in any case not evident with any of the standard Tomcat authentication methods, as Christopher pointed out. Note that there can be ways to achieve a reasonable level of security for doing this kind of thing (reasonable being a flexible concept dependent upon your precise context). But running most of the site under HTTPS except for that upload portion seems leaky to me. Better and cheaper maybe to get a bigger server. You run the risk otherwise to spend more than the difference, trying to find out ways to do this securely, which is what HTTPS provides as a matter of fact. I would run a test, uploading the same file over HTTP and over HTTPS, and measure the system's reaction, to determine really what overhead this causes, percentage-wise, for the server. Decryption should be 99.9% CPU, and in my experience that is a facet where modern servers are rarely overloaded. With huge files, your communication bandwidth is more lilely to be the limiting factor. And if it really overloads the server, then again the solution may be with a front-end which takes care of the HTTPS part. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat dying on its own
On 08/12/2010 22:38, Christopher Schultz wrote: Mark, On 12/6/2010 3:49 PM, Mark Thomas wrote: On 06/12/2010 20:44, Guillaume Carbonneau wrote: It happens every day or so. Nothing happens before in the log... I'm logging the requests but tomcat dies when there is no traffic it seems. I even tried to bench it with more than 1 requests the other day and it handled the load pretty fine and no crash. I control all the code in my app, there is no System.exit() call There have been cases of libraries calling System.exit() on some error conditions. Isn't there some indication of a System.exit() in catalina.out? If there isn't, we could write an optional Listener that could install a shutdown hook that will complain to stdout if the JVM goes down without Tomcat's permission. Been there, tried that. There is no easy way (I could find) to distinguish between a legitimate and illegitimate shut-down. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat dying on its own
Mark Thomas wrote: On 08/12/2010 22:38, Christopher Schultz wrote: Mark, On 12/6/2010 3:49 PM, Mark Thomas wrote: On 06/12/2010 20:44, Guillaume Carbonneau wrote: It happens every day or so. Nothing happens before in the log... I'm logging the requests but tomcat dies when there is no traffic it seems. I even tried to bench it with more than 1 requests the other day and it handled the load pretty fine and no crash. I control all the code in my app, there is no System.exit() call There have been cases of libraries calling System.exit() on some error conditions. Isn't there some indication of a System.exit() in catalina.out? If there isn't, we could write an optional Listener that could install a shutdown hook that will complain to stdout if the JVM goes down without Tomcat's permission. Been there, tried that. There is no easy way (I could find) to distinguish between a legitimate and illegitimate shut-down. Naive suggestion : how about some global flag which the legitimate shutdown paths set (and the others don't know about), and which the hook in question checks ? Other naive suggestion/question : something somewhere already intercepts a System.exit(), if i judge by the shutdown messages of the Connectors. How about making the flag a code or string, which would indicate which legitimate agent triggered it, and which the things which print the Connector shutdown messages obtain and duly add to their shutdown message ? The absence of ditto (or the initialisation content of it) would be a telltale sign. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
deploy log4j
Hello I have an app that work perfectly in my IDE(JBuilder05, yes I know but it work fine), but on deployment I believe it is not reading the log4j with this error: java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Unknown Source) followed by log4j:WARN No appenders could be found for logger I am loading the prop file with this(that works in the IDE) java.util.Properties props = new java.util.Properties(); try { props.load(getClass().getResourceAsStream(/log4j.properties)); } catch (IOException ex) { } PropertyConfigurator.configure(props); //ver03_lfj.setLevel(Level.DEBUG); ver03_lfj.debug(yippie);
Re: deploy log4j
You don't say the following: Tomcat version JRE/JDK version Platform (OS and version) That being said, I use log4j (with or without Apache commons logging) for nearly every web application I run on Tomcat. Short answer: You don't manually read in your properties file with log4j. Read a tutorial on log4j for a more complete explanation. What follows below is an overview. Please refer to the log4j documentation, the log4j javadocs, and tutorials around the Internet for a more complete discussion. Code: In each class that you want to use logging, add the following: package foo; // replace with your package name import org.apache.log4j.Logger; public class MyFoo { // replace with your class name private static final Logger log = Logger.getLogger(MyFoo.class); // note 1 /* * rest of class including log.(message) where is a level */ } note 1: While it is traditional that one uses getLogger(MyFoo.class), which is shorthand for getLogger(clazz.getName()), you can also name your loggers with any legal string. See the javadoc for more information. Properties File: In your properties file, you'll need appenders as well individual lines for non-default logging levels for each logger name. ### direct messages to file foo.log ### log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.File=${catalina.home}/logs/foo.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n # default logging level log4j.rootLogger=warn, file # logging for foo.MyFoo - name matches the logger name log4j.logger.foo.MyFoo.type=info Since there is only a file listed in the appenders, then that's where the logging will go. Note that ${catalina.home} was used for logging. This should probably be ${catalina.base} just in case more than one copy of Tomcat is run from a base installation (see RUNNING.txt). This is a handy way of storing log files. If you're doing some in-IDE testing where ${catalina.home} or ${catalina.base} is not set, then hopefully your IDE will let you pass in a Java parameter. Just set -Dcatalina.home=some-place (or -Dcatalina.base=some-place) while testing. Application Structure: Properties file Package up the application so that log4j.properties gets placed in WEB-INF/classes/log4j.properties. Log4j looks for the properties file in the classpath. Placement in your IDE's project depends on how your IDE packages files. Log4j library Package up the application so that log4j-1.2.15.jar (or whatever version you are using) gets placed in WEB-INF/lib/log4j-1.2.15.jar. Placement in your IDE's project depends on how your IDE packages files. . . . . just my two cents. /mde/ - Original Message From: cpanon cpa...@yahoo.com To: Tomcat users@tomcat.apache.org Sent: Wed, December 8, 2010 8:23:46 PM Subject: deploy log4j Hello I have an app that work perfectly in my IDE(JBuilder05, yes I know but it work fine), but on deployment I believe it is not reading the log4j with this error: java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Unknown Source) followed by log4j:WARN No appenders could be found for logger I am loading the prop file with this(that works in the IDE) java.util.Properties props = new java.util.Properties(); try { props.load(getClass().getResourceAsStream(/log4j.properties)); } catch (IOException ex) { } PropertyConfigurator.configure(props); //ver03_lfj.setLevel(Level.DEBUG); ver03_lfj.debug(yippie); - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
uniqueId of StaticMember
Hello, What exactly the uniqueId of StaticMember class? How is it being used in implementation? Can multiple static nodes have same uniqueId? Any pointers? Thanks,
Re: Setting listings=true on a per context basis
Chris, Thanks very much! On Wed, 08 Dec 2010 17:48:31 -0500, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fergus, On 12/7/2010 9:27 AM, Fergus McMenemie wrote: Thanks for the response. Other than reading the 300 page servlet spec is there a quicker way to accomplish what I want. Of the 354 pages of the Servlet Spec 2.5, only pages 19-154 are worth reading. Before that, it's introductory stuff, and after that it gets into enterprise servlet stuff which Tomcat doesn't support, and most people don't need. I recommend reading the spec in the same way you'd eat an elephant: one bite (byte?) at a time. Mmmm... elephant. In the amount of time you might spend fighting against various contributors to this forum to extract information about the spec and how to do things, you could easily read the spec itself and then come back to hit some other newbie over the head with it :) Yes this is the conclusion I had come to myself. There is no trivial easy way to perform this trivial function. The defaultServlet is great for the utterly trivial but if you want anything marginally more sophisticated then it is no longer a simple case of droping in your content. You then have to understand quite a bit more about the tomcat beast. Dont misunderstand the above, I am very grateful for all the help I have received. Further, are you saying that use of catalina/localhost/vendoraDocs.xml is a tomcat only solution. This is just the webapp deployment hints for Tomcat. Chuck's direction to edit WEB-INF/web.xml is entirely portable and defined by the aforementioned quite-readable specification. I dont edit, control or admin the content I am wanting served. So ensuring the correct WEB-INF/web.xml ends up in the correct place is too big a deal. The customer is a MS house and has zero time for messing about with tomcat configurations. I was hoping for a simple place it in here one line instruction. But I will re visit this if I get the time and space to read those hundred pages you mention. How do I best standup a set of vendor supplied HTML docs and files for browsing through tomcat. It is not worth setting up IIS for, as we already using tomcat for other purposes. If you have a directory of static files already, you can just drop them into a subdirectory under TOMCAT_HOME/webapps and it will auto-deploy (assuming you have default settings in TOMCAT_HOME/conf/server.xml) into a URL like http://yourhost/dirname/your_files_go_here.html Thanks again. == Fergus McMenemieEmail:fer...@twig.me.uk Techmore Limited, Phone:(UK) 07721 37602 Old Stables, Far End, Home: (UK) 01522 810839 Boothby Graffoe, Lincoln, LN5 0LG, England Unix/Mac/Intranets/WWW Analyst Programmer == - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org