Re: Where'd catalina.sh go in 5.5.x ?
I wish they'd put those files back in the .exe distribution, if only to save work for Chuck! -- Len On 10/4/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Subject: Where'd catalina.sh go in 5.5.x ? Where would a change like this be made in Tomcat 5.5.x? In the same places. However, the scripts are not included in the .exe download for some reason, but are in the .zip version. (I haven't checked the .gz one lately.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
On 9/7/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Len Popp [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat/JVM hangs in session.getAttribute / HashMap.get() So if I want to *safely* call session.setAttribute or session.getAttribute I have to make sure the calls are synchronized on session.attributes. Actually no - if you can find _all_ the events that can trigger references or udpates to session attributes, you can synchronize on any object you like. The synchronize blocks internal to Tomcat then become redundant, but they cause no harm. It would take me quite a while to look at all the possible code paths inside Tomcat to figure that out. :-( Another option (as suggested by the HashMap javadoc) is to modify StandardSession to use a HashMap wrappered by Collections.synchronizedMap(). No idea what kind of performance impact that would have, but at least it would limit the changes needed to just one place in one file. - Chuck That would be easier, but I was hoping I wouldn't have to use a hacked version of Tomcat. Thanks for your explanations. -- Len - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
OK, so how do I fix this problem in my application? I can't figure it out. Inside Tomcat, references to the hashmap in question are synchronized on the hashmap object itself, StandardSession.attributes (see org.apache.catalina.session.StandardSession). So if I want to *safely* call session.setAttribute or session.getAttribute I have to make sure the calls are synchronized on session.attributes. But I can't access session.attributes - it's a protected field and I don't see a method that returns it. So I cannot make my setAttribute calls synchronize properly with Tomcat's code. I don't see how I can work around this. Am I missing something? Or do the Tomcat guys have to fix it? -- Len On 9/6/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Arup Vidyerthy [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Does this mean that all session.setAttribute() and session.getAttribute() should always be synchronised That's the conclusion I'm reluctantly coming to, if there is the possibility of multiple threads updating the same session simultaneously. Luckily, you would think that most operations would really be request, not session, related. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: custom valve help ???
If you consider source code to be a tutorial, you can look at the classes in org.apache.catalina.valves. RemoteAddrValve and RequestDumperValve are quite simple and easy to understand. -- Len On 9/2/05, Bovy, Stephen J [EMAIL PROTECTED] wrote: Are there any good tutorials or how-to documents for using and writing a custom valve for tomcat ??? Stephen Bovy Computer Associates 6100 Center Drive Suite 700 Los Angeles, CA 90045 Tel: (310) 957-3930 Fax: (310) 957-3917 e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to access application if I am on VPN
Can you download the DTD to the server and point the config file at the local copy? That must be possible, otherwise you couldn't run an application on an intranet that's not connected to the WWW. -- Len On 8/19/05, Martin Wood [EMAIL PROTECTED] wrote: So, i think the issue is getting tomcat (well, the JVM) to use your proxy. Im not really sure where to start with that tbh. From what i know the jre should just use the IE proxy settings (assuming the control panel still has 'use browser settings' checked.) But i dont know what the standard behaviour is if youre not using the default jre, or a jdk, or if tomcat creates a different set of conditions even if you are just using the jre. I'll have a look around, but hopefully someone else may be able to shed some light on the issue. martin Sunjay Gunda wrote: I was thinking along the same lines of struts unable to reach jakarta.apache.org. But, I can access all the web sites even if I am connected to office through VPN (We do that browsing by using a proxy script path mentioned under Internet Options-Connections-LAN Settings : Use automatic configuration script). After reading your post, I disabled that script (I can't access any websites) and I tried to run my application, but I got the same exception (since, its unable to reach jakarta website). Regarding the option that you mentioned for DNS, I don't have any idea. Since, I am able to access the webpages, I should be able to pass the data back and forth. So, I should be able to do that. But, can you provide a link or some detail information of how to do that? Thanks Sunjay --- Martin Wood [EMAIL PROTECTED] wrote: I think its a basically a DNS / route problem, triggered by the search for a DTD within struts (i think its struts, but dont hold me to that) When you connect to your VPN there is no route to jakarta.apache.org as the error says : java.net.UnknownHostException: jakarta.apache.org At a guess, when you connect to your office VPN you cant browse the web properly either? Im guessing that you are using a PPTP VPN connection within windows. You have a few choices that i can think of 1: Get DNS working via your VPN connection How you go about this depends on what your VPN server is, and if your work will allow traffic through the VPN and back out into the web at their end. 2: Hope that you can do split-tunneling with your VPN client / setup this has some more information on the issue http://www.experts-exchange.com/Security/Firewalls/Q_21246171.html 3: Prevent the lookup for the DTD from struts. I dont know how you would go about this because i dont know struts at all. if anyone else has any ideas id like to hear them. thanks Martin Sunjay Gunda wrote: Tomcat is running on my local machine. Application is using MYSQL database and it is also on my local box. Whenever I connect to office through VPN and try to access the application that is hosted on my local box, then I get this error in addition to what I mentioned before Aug 19, 2005 4:36:30 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Aug 19, 2005 4:36:30 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Aug 19, 2005 4:36:30 PM org.apache.struts.action.ActionServlet initModuleConfig SEVERE: Parsing error processing resource path java.net.UnknownHostException: jakarta.apache.org at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at sun.net.NetworkClient.doConnect(NetworkClient.java:139) at sun.net.www.http.HttpClient.openServer(HttpClient.java:402) at sun.net.www.http.HttpClient.openServer(HttpClient.java:618) at sun.net.www.http.HttpClient.init(HttpClient.java:306) at sun.net.www.http.HttpClient.init(HttpClient.java:267) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:320) at sun.net.www.http.HttpClient.New(HttpClient.java:315) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) at
Re: data push
It's not hard to send data from one Tomcat server to another, but the details are a bit complicated. 1. The basic idea is that Server A will periodically send an HTTP POST request to Server B containing a bunch of data. Server B has a servlet that receives this data. (This is the easiest way, because Tomcat Server B knows how to handle HTTP requests!) 2. It's pretty easy to send HTTP requests to another server using java.net.URL and java.net.URLConnection. 3. However, it seems that POST requests are more complicated. I've only done GET requests myself, but here's an article on how to send a POST request: http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html (That article's kind of old, I'm not sure if it's up to date.) 4. Server A is supposed to send data at random points in time. Does that mean it's done in response to a user request (i.e. in a servlet) or asynchronously (i.e. once an hour, or when a buffer fills up)? It's easy to call your data-sending code from a servlet. If you want to call it asynchronously (outside of a user request) then you'll have to create a separate thread to do it. The easiest way is probably to use a java.util.Timer. 5. To start and shut down a thread properly, you have to use a ServletContextListener. Start the thread (or Timer) in the contextInitialized event and kill it (or call Timer.cancel) on contextDestroyed. Hope this helps! -- Len On 8/10/05, Paul Wallace [EMAIL PROTECTED] wrote: Hi All, I would like server A (TC 5.5) to 'push' streams of data to server B (TC 5.5) at random points in time, and for server B to accept the data when it is received. This is not using request / response, hence I am new to this topic. A couple of questions - what protocol(s) can be used, HTTP? Can anyone point me towards a resource of this nature please? I understand sockets are in the picture - also new to me. Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: data push
If you send the data via HTTP, then Server B processes that HTTP request just like any other. It's exactly the same as if a user sent a POST request by typing the data into a form and clicking Submit. Server B receives the POST request and executes the appropriate servlet to process it. -- Len On 8/10/05, Paul Wallace [EMAIL PROTECTED] wrote: Hi and thanks for that, That's the crux of my question! The data (I am unsure of the protocol it is delivered in) is sent at random points in time i.e not from any request. I wish to create particularly the client (server B) that listens for this data. I (mistakenly) mentioned server A to mimic the data pushes. I can write something to fire off data at intermittent times, but I am more interested in how to capture that data, when no request has been made. This is the reason why I first questioned on Sockets. Perhaps I should have been clearer from the off! thanks Paul. Does that mean it's done in response to a user request (i.e. in a servlet) or asynchronously (i.e. once an hour, or when a buffer fills up)? It's easy to call your data-sending code from a servlet. If you want to call it asynchronously (outside of a user request) then you'll have to create a separate thread to do it. The easiest way is probably to use a java.util.Timer. 5. To start and shut down a thread properly, you have to use a ServletContextListener. Start the thread (or Timer) in the contextInitialized event and kill it (or call Timer.cancel) on contextDestroyed. Hope this helps! -- Len On 8/10/05, Paul Wallace [EMAIL PROTECTED] wrote: Hi All, I would like server A (TC 5.5) to 'push' streams of data to server B (TC 5.5) at random points in time, and for server B to accept the data when it is received. This is not using request / response, hence I am new to this topic. A couple of questions - what protocol(s) can be used, HTTP? Can anyone point me towards a resource of this nature please? I understand sockets are in the picture - also new to me. Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: invalidated session
I'm pretty sure that the finalizers are only called when garbage collection reclaims the objects, and that will be some time after the session is invalidated. Possibly a very long time after, if Tomcat isn't busy and isn't using much memory. -- Len On 7/7/05, Nishant Deshpande [EMAIL PROTECTED] wrote: I store a bunch of objects in my session. After the session timeout, I see the session getting invalidated (via my listener). Now I am expecting to see the finalizers from the objects in the session being called - I'm pretty sure I don't have any other references to them. I don't see the finalizers getting called. Am I missing something? Thanks Nishant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sending redirects to relative/absolute URLs
No, because the HTTP protocol requires an absolute URL in redirect responses. On 5/20/05, Angelov, Rossen [EMAIL PROTECTED] wrote: Hi, Does anybody know why Tomcat always redirects to absolute links? I looked at the implementation and the sendRedirect calls the toAbsolute method which always constructs an absolute URL. Is there any way to make Tomcat return relative URLs the way they were requested for redirecting? Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to do Downtime with a Apache/Tomcat webapp
Hey, maybe *I'm* missing something. :-) I haven't tried this yet. I guess it only works if the web app is unpacked, not in a war file. (That's how my site is currently.) When the site is down it's running a minimal web app that is only using two files - web.xml and the jsp or servlet that's returning the site-down page. All other files and the database are not in use and can be munged at will. The original question mentioned database maintenance in particular. In that case it doesn't really matter what the web app is doing, as long as it's not accessing the database. The idea of using a filter to turn off the app sounds good for this. On 5/16/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: Len, Sounds simple - but maybe I'm missing something. How do I do maintenance on the site context (under webapp) if the context is being used to show this simple page? It may end up being simplest to alter (or swap in) the Apache config file and do a reload. On my site the reload is pretty quick and I do not think it disrupts active Tomcat sessions (in other contexts). Thanks - Richard -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 8:33 AM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Len Popp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to do Downtime with a Apache/Tomcat webapp
I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Len Popp