Re: tomcat manager gui hangs on web-app reload for one web-app not others
PS - my Thunderbird has a "Reply List" button for this mailing list. Mitch On 09/20/2018 09:41 AM, Shawn Heisey wrote: On 9/20/2018 8:30 AM, Bill Harrelson wrote: Looking back through my sent folder I realize that I have been replying directly to people that posted directly to me instead of the list. I see from message headers that you're using Thunderbird. In Options/Advanced, open the config editor and change the setting for "mail.override_list_reply_to" to false. You can do this by double-clicking on the setting. That will fix this so that when you reply to an Apache mailing list, your reply will go to the list. Apache lists use the Reply-To header to indicate where replies should go. See this bug for a heated discussion about the problem: https://bugzilla.mozilla.org/show_bug.cgi?id=1392371 Thanks, Shawn - 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: Not able to start the tomcat 8.5.32 on RHEL7.4
This looks like output from catalina.out. I didn't immediately spot any errors. Look in the other log files for error messages. Mitch On 09/19/2018 07:38 AM, gaurav.kuma...@wipro.com wrote: Hi All, While restarting getting below error and it's failing to deploy web application on RHEL 7.4. Please suggest any resolution to the problem - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Error receiving all sessions in cluster
I apologize. I know see the "sendAllSessions" setting on DeltaManager. Not sure how I missed that the first time. I'll experiment with that. Still would like any insight into question #2. Mitch On 09/18/2018 08:51 AM, Mitch Claborn wrote: 1) Any time the DeltaManager runs into an error deserializing the "all sessions" message, all sessions from the one with the error and later are lost. I realize it must currently be this way because once there is an error in the serialized stream there is no realistic way to find where the next session object begins in the stream. I'd like to be able to configure the Delta Manager to send the "all sessions" message in chunks of N sessions per message, where N can be configured in the XML. Doing this would limit the impact of a problematic session to only those in the same chunk. The final chunk would need some kind of marker so that the receiver knows that all sessions have been received. Any thoughts on this? I don't think it is possible in the current code. How hard would it be to make this change. If I were to code it, would it be considered for acceptance into the base code? 2) Is it possible that a session object could be accessed and used while it is being deserialized in another thread for the "all sessions" message to another host? This might explain the corruption I'm seeing. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Error receiving all sessions in cluster
I continue to have problems of this nature, although not with the exact symptom shown below. I've been able to identify some possible problems in my code that might have been causing some objects in the session to deserialize improperly. I've fixed those and have not seen those specific errors crop up again. I have another error that I'm working on now: some of my own objects serialize to/from JSON and the JSON string in the serialized session object has obviously been corrupted. I can't see how that could have happened, but I'm still working on it. So 2 big questions/ideas: 1) Any time the DeltaManager runs into an error deserializing the "all sessions" message, all sessions from the one with the error and later are lost. I realize it must currently be this way because once there is an error in the serialized stream there is no realistic way to find where the next session object begins in the stream. I'd like to be able to configure the Delta Manager to send the "all sessions" message in chunks of N sessions per message, where N can be configured in the XML. Doing this would limit the impact of a problematic session to only those in the same chunk. The final chunk would need some kind of marker so that the receiver knows that all sessions have been received. Any thoughts on this? I don't think it is possible in the current code. How hard would it be to make this change. If I were to code it, would it be considered for acceptance into the base code? 2) Is it possible that a session object could be accessed and used while it is being deserialized in another thread for the "all sessions" message to another host? This might explain the corruption I'm seeing. PS - here's how I'm discovering the session objects that are in error. I have a channel interceptor that watches for the receipt of the "all sessions" message and writes it to disk then stops watching for that message. I copy that disk file to my development machine where I run a quick-and-dirty program that I wrote that emulates the processing of Delta Manager with some debugging in place so that I can see exactly which session had the problem and which attribute within that session. I'd also like to propose some updates to Delta Manager that would capture that information and put it into the error logging. Mitch On 09/07/2018 04:44 PM, Mitch Claborn wrote: I'm using a cluster with the DeltaManager between two servers on Tomcat 9.0.11. When I restart my "A" server, I sometimes see the error below. Peaking at the code in DeltaManager it appears that there is a problem in the serialized data stream when receiving all of the session data from the "B" server. Any ideas what could be causing this? It seems like that if there was something in a Session object that was not Serializable it would not even make it over the wire. Perhaps if something in a session did not serialize properly? (From the code, it looks like all the sessions in the message after the error are lost, so this is kind of important.) 07-Sep-2018 16:09:53.220 SEVERE [Tribes-Task-Receiver[Catalina-Channel]-6] org.apache.catalina.ha.session.DeltaManager.deserializeSessions IOException while loading persisted sessions: [java.io.StreamCorruptedException: invalid type code: 00] java.io.StreamCorruptedException: invalid type code: 00 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1381) at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1984) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:748) at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:569) at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:613) at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1323) at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1162) at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:917) at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:77) at org.apache.catalina.ha.tc
Re: Cluster session replication performance
https://bz.apache.org/bugzilla/show_bug.cgi?id=62723 Mitch On 09/14/2018 10:10 AM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mitch, On 9/14/18 09:43, Mitch Claborn wrote: On 09/13/2018 08:10 PM, Christopher Schultz wrote: Mitch, On 9/13/18 10:29, Mitch Claborn wrote: On 09/12/2018 11:37 AM, Christopher Schultz wrote: Would you care to submit a documentation patch/PR? Get your name in the ChangeLog and you get the text that makes the most sense to you:) Sure. How do I go about that? That kind of depends upon whether you like Subversion or git better. Do you have a preference? git I've used subversion in the past, but it's been a LONG time. Here's the git mirror: http://tomcat.apache.org/svn.html#Git_Mirror Feel free to clone that or fork it on Github or whatever. If you fork, submit a PR. If you clone, submit a patch using "git diff" attached to a bugzilla issue, or you can email it to the dev mailing list. Bugzilla is a bit nicer, since we can see diffs-in-context from there. The pages for the documentation are in the webapps/docs directory, and they are all XML which get transformed into HTML using XSLT for publication using. It's not really tough to figure out what's going on. So the files you are looking for are webapps/docs/cluster-howto.xml and webapps/docs/config/cluster.xml. If you want to preview your HTML, run "ant build-docs" (you'll need Apache Ant for this, of course) and it will build the documentation webapp. Write back if you need any help. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlubz3wACgkQHPApP6U8 pFjrahAAmmeSzKMh2Eq+gdfiY07ediDxvanbY/ljBr5QzO++OnzbWXubd+s8XQWR yQHBffv+Ff4jD2ksDQDs12slMxkmCtT2LzwXSroZXeqS8DE1WPwb8SF1ujvX05XD toPq6Wm5OfMAGl8rAC01ZSLM8+p1JYJacvnYbouG/+cIopg1xew+y1PryMJ5PyFg rbCr6Bva4cbqM8E/L2ehA/+IqbR5bMnxBFmlxRqzEyX7BrJg4DaFu6A9s5S38j2f IM2Xmc6RM9lfRJv86pWs6gUZv98ty+1TvFQPNFueVcr1H15af47IwZkRlDG5xVEs 1wc6nEpfpHnAkZ90B7juKp3OlmNLIJINWZCZ+4af3cFX12/B4A6VNK5huaul1ybt DEXSCUfpj+8taCYKmYqeisarAaOXvWTY8JP0TUIoz0bQREFUBb91lSTK9kMUK9Gs vLHAS69n+pt9PvWyoiBud0gDDEYj2LLzFkfhPNf/8ZL51HGCq/hxBtFXWFdTCX2q lECc/WEO0GPh24DWikKRLn+aw9pre5308CS5EAIlnr9fVEKx9v0Et9Nrpf7quK/+ POkur3KqaCD8MSbhKtbBqYoVcr2MyXW/YBNaT/io+JGok4677IhMUDHxvA4P+8cM LSdEWT3zFlEanxfYjIE0qY1vS1/vdeIWdDOG+jU89I/MsbEE+Q4= =aFbP -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: Cluster session replication performance
git I've used subversion in the past, but it's been a LONG time. Mitch On 09/13/2018 08:10 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mitch, On 9/13/18 10:29, Mitch Claborn wrote: On 09/12/2018 11:37 AM, Christopher Schultz wrote: Would you care to submit a documentation patch/PR? Get your name in the ChangeLog and you get the text that makes the most sense to you:) Sure. How do I go about that? That kind of depends upon whether you like Subversion or git better. Do you have a preference? - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlubCpsACgkQHPApP6U8 pFjwdBAAmsVEgl/0ItSMfW/W9wM6wyPrKmP2KaVOv6EYVg7v0ioQOkPfengZkTip Jf7aQc6h6G9hoO43+2ZZbedhV/9rWYyMAbO7aCAAB9Jr/fNETcrTYWkJ/g51YYVY Ztx4esCzxrthUu6CMOOqKVb/zi3IsZwmKawJ8tISj02D4JOIHIKJ4I3vJV363Xby oHTuT3LGH8Mu3LuBqf5wsWZV4LsC/19jOHUdCvGr2Jg+vd+x0Vj4nzuNCzNy7b6v ScK2rYHR6itM5PaVuA43IGNbtQ+6GnWxKRsuk6TN/3Yah7Dp0U24CE9TggtSDi0a AdLOuNWhaAXntoHCVhLqbxHuNWklGh7zKHGtMjp+mWhmVmST2nY1wB18YshQRHe4 Ppt7wZW48aKVB2EBdPMe1w9Ko2xJwqrKbNTryro9bP2GS08d2EDo94cTOUg7H77r AYfv+UNUI95SCEaUoqg94oAjfB3NJvCBOYUdT6GOR4hrVR4nhiKs9sgDu8zt++WK 5QAlA5nrS0i6iijpxbz8eziHjTPUgUfuy68N4R0kfWs2O1rmqHzjYKT6/fLRq90E /74wahdz/L5zHJncGE/gysu0yH3l9R5ZGCnANdH4KLtTvKctS6/q2lERiWpPHCPE AL9PHHzYlQbpiBF5AMNkcgxJEcn8Om3YX2j/G/lDrHDn5/IOuyE= =ztkd -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: Cluster session replication performance
Sure. How do I go about that? Mitch On 09/12/2018 11:37 AM, Christopher Schultz wrote: Would you care to submit a documentation patch/PR? Get your name in the ChangeLog and you get the text that makes the most sense to you:) - -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cluster session replication performance
Thanks Mark. I changed to channelSendOptions="2" and the failure rate of my health check program has dropped significantly, down to 1 - 2 per 24 hours. I did quite a bit of reading in the doc before posting this, but your explanation of the options is much better than the doc. I suggest that the doc be updated with your explanation below. I would put it in the following locations: http://tomcat.apache.org/tomcat-9.0-doc/cluster-howto.html#Cluster_Information http://tomcat.apache.org/tomcat-9.0-doc/config/cluster.html#SimpleTcpCluster_Attributes and also in the javadoc for Channel.java Mitch On 09/10/2018 03:15 PM, Mark Thomas wrote: On 10/09/18 17:33, Mitch Claborn wrote: Further information and questions. I created my own interceptor based on ThroughputInterceptor so that I could log the timing of specific sessions to correlate them with the failures in my health check program. I was surprised to find that in those instances where the health check reported a failure, the interceptor reported that the session send was accomplished in < 5 ms, while the health check app is waiting a full 1000 ms between calls to the different tomcat instances. So now I'm more confused than ever. Anyone have any ideas? In a ChannelInterceptor, does when getNext().sendMessage(destination, msg, payload) returns, does that mean that the message has been sent AND received by the recipient member, or does that only indicate a send? You are using: channelSendOptions="8" That means that, as far as the sender is concerned, the message is sent as soon as it has been placed in the queue on the sender for transmission to the other nodes. If you use async sending, the options to enable ACKS don't offer very much - if anything. If you configure channelSendOptions="2" the the sender will block the completion of the current request until all of the receiving nodes have acknowledged that they have received the message. If you configure channelSendOptions="6" the the sender will block the completion of the current request until all of the receiving nodes have acknowledged that they have received and processed the message. There is a trade-off here between throughput on the sender vs reliability of replication if the sender fails. 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: Cluster session replication performance
Further information and questions. I created my own interceptor based on ThroughputInterceptor so that I could log the timing of specific sessions to correlate them with the failures in my health check program. I was surprised to find that in those instances where the health check reported a failure, the interceptor reported that the session send was accomplished in < 5 ms, while the health check app is waiting a full 1000 ms between calls to the different tomcat instances. So now I'm more confused than ever. Anyone have any ideas? In a ChannelInterceptor, does when getNext().sendMessage(destination, msg, payload) returns, does that mean that the message has been sent AND received by the recipient member, or does that only indicate a send? Mitch On 09/06/2018 01:53 PM, Mitch Claborn wrote: I'm using a cluster with the DeltaManager between two servers on Tomcat 9.0.11. I've set channelSendOptions="8" (asynchronous session replication). I have a "health check" app that I run periodically, one of the functions being to check that sessions are being replicated properly. That app 1) Does a GET to tomcat A, calling a Struts action that creates a session and stores a known value in it 2) Waits 2 seconds 3) Uses the session ID cookie from step 1 and makes a call to tomcat B, to an action that retrieves that value from the session 4) Compares the two values from the session to make sure that they are the same. Most of the time this check works fine, but occasionally the call to the second server will find that the session does not exist on that server, presumably because it has not yet replicated there yet. 2 seconds seems a long time for a session to replicate, especially one as small as this one is. If I decrease the amount of wait time at step 2, the failure rate increases. I turned on the ThroughputInterceptor and have the following observations. - Server A has a transmit throughput around 10 MB/sec while B has only around 3 MB/sec. This might be accounted for by the fact that B was the last server to start, so A would have (I think) transmitted all of the sessions at once when B started up, so it might get good throughput from the big send?? Questions: 1. IS 2 seconds a long time to replicate a session? 2. Other than actual network slowness, are there internal issues that could cause the replication to be slow? 3. If so, is there anyway to diagnose those? 4. I'm thinking about writing my own version of ThroughputInterceptor that will give more information on specific messages and timings. Has anyone tried that? In that interceptor can I access the session ID? That would help me correlate timings between my failure reports and the interceptor. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Error receiving all sessions in cluster
I'm using a cluster with the DeltaManager between two servers on Tomcat 9.0.11. When I restart my "A" server, I sometimes see the error below. Peaking at the code in DeltaManager it appears that there is a problem in the serialized data stream when receiving all of the session data from the "B" server. Any ideas what could be causing this? It seems like that if there was something in a Session object that was not Serializable it would not even make it over the wire. Perhaps if something in a session did not serialize properly? (From the code, it looks like all the sessions in the message after the error are lost, so this is kind of important.) 07-Sep-2018 16:09:53.220 SEVERE [Tribes-Task-Receiver[Catalina-Channel]-6] org.apache.catalina.ha.session.DeltaManager.deserializeSessions IOException while loading persisted sessions: [java.io.StreamCorruptedException: invalid type code: 00] java.io.StreamCorruptedException: invalid type code: 00 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1381) at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1984) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:748) at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:569) at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:613) at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1323) at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1162) at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:917) at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:77) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:788) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:771) at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:324) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.messageReceived(TcpPingInterceptor.java:175) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:116) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor.messageReceived(StaticMembershipInterceptor.java:96) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.messageReceived(ThroughputInterceptor.java:86) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:274) at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:261) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:213) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Cluster session replication performance
I'm using a cluster with the DeltaManager between two servers on Tomcat 9.0.11. I've set channelSendOptions="8" (asynchronous session replication). I have a "health check" app that I run periodically, one of the functions being to check that sessions are being replicated properly. That app 1) Does a GET to tomcat A, calling a Struts action that creates a session and stores a known value in it 2) Waits 2 seconds 3) Uses the session ID cookie from step 1 and makes a call to tomcat B, to an action that retrieves that value from the session 4) Compares the two values from the session to make sure that they are the same. Most of the time this check works fine, but occasionally the call to the second server will find that the session does not exist on that server, presumably because it has not yet replicated there yet. 2 seconds seems a long time for a session to replicate, especially one as small as this one is. If I decrease the amount of wait time at step 2, the failure rate increases. I turned on the ThroughputInterceptor and have the following observations. - Server A has a transmit throughput around 10 MB/sec while B has only around 3 MB/sec. This might be accounted for by the fact that B was the last server to start, so A would have (I think) transmitted all of the sessions at once when B started up, so it might get good throughput from the big send?? Questions: 1. IS 2 seconds a long time to replicate a session? 2. Other than actual network slowness, are there internal issues that could cause the replication to be slow? 3. If so, is there anyway to diagnose those? 4. I'm thinking about writing my own version of ThroughputInterceptor that will give more information on specific messages and timings. Has anyone tried that? In that interceptor can I access the session ID? That would help me correlate timings between my failure reports and the interceptor. -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Clustering considerations - single server, multiple Tomcat instances - in the cloud
I'm trying to think through the security implications of this configuration: a single cloud server (Digital Ocean) with 2 Tomcat 8.5 instances in a cluster, for session replication. I can bind the Receiver element to 127.0.0.1, which I think should protect the actual session data from prying eyes. Is that accurate? The multicast-based Membership element seems to be more of a risk. I really like the convenience of the mutlicast setup, but is that a security risk? Should I go with static membership instead? I found this discussion of static membership,but it is a bit old. Does anyone know of a more recent doc? https://kb.vmware.com/selfservice/microsites/search.do?language=en_US=displayKC=2009794 Are there other security considerations that I'm not thinking of? -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Check if a URL exists programatically
2015-07-17 18:48 GMT+03:00 Mitch Claborn mitch...@claborn.net: I spent some time yesterday digging through code without much luck. Today I'm going to experiment with this: getting a Request Dispatcher for the URL from the ServletContext, creating a dummy ServerRequest and ServerResponse object and invoking include(request, response) or forward() on that dispatcher. With luck, I'll be able to get what would be the response from a HEAD or a GET request in some sort of output stream in the response object, then examine that output stream for the result. The way I finally solved this is a bit of a shortcut, but it works. Since our site is completely based on Struts, I'm reading the struts.xml file and matching the action names against the URL returned by google. For those that don't have a specific match, I call a routine in my default action that checks for various dynamically named pages (categories, products, etc). It runs super fast and doesn't need the dummy request and response objects. I was hoping for something that would be framework agnostic, but this will do for now. Thanks all for your help and suggestions. Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Check if a URL exists programatically
On 07/17/2015 10:48 AM, Mitch Claborn wrote: On 07/16/2015 02:19 PM, chris derham wrote: I already have a custom error page. When I detect that a URL returned by google would return a 404, I exclude it from the search results so that the user never sees it. Mitch Mitch, Ok I see now what you mean. Sorry your original email was quite clear. Hmm interesting challenge. Big picture terms, I guess the two obvious choices seem to be to not use google for searching, or parse the google results, and determine the url validity as you are doing. Depending on the urls you use, that could be horrible. Guess that's where you are. Is not using google an option? Please let us know how you resolve it. Chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Doing without google is not an option. We are quite happy with them except for this one, admittedly minor, glitch. I spent some time yesterday digging through code without much luck. Today I'm going to experiment with this: getting a Request Dispatcher for the URL from the ServletContext, creating a dummy ServerRequest and ServerResponse object and invoking include(request, response) or forward() on that dispatcher. With luck, I'll be able to get what would be the response from a HEAD or a GET request in some sort of output stream in the response object, then examine that output stream for the result. I guess I'm giving up on this. I tried the approach described above, but can't seem to make it work. Trying the case of a known-good URL as a baseline. When I invoke displatcher,forward(request,response) my dummy response objects gets called with a sendError(404, /url.html), but I can also see evidence that the code that should run for that URL (a struts action) is running and is returning a good Struts response. When I enable low level logging, it appears to me that the JSP that renders the output is being called, but the output is not making it back to my dummy response object. That sendError() is coming from the DefaultServlet, which is odd because I would think that should not be called as Struts is (should be) intercepting all of the requests. I must be setting something up wrong somewhere. The only next step I can think of is to compile Tomcat for myself so I can debug the execution path from the forward() to figure out what's going on. I can't justify that much time and effort on this. I'm guessing the RequestDispatcher only works down below the filters, which is where Struts is invoked. I welcome any further ideas. -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Check if a URL exists programatically
On 07/16/2015 02:19 PM, chris derham wrote: I already have a custom error page. When I detect that a URL returned by google would return a 404, I exclude it from the search results so that the user never sees it. Mitch Mitch, Ok I see now what you mean. Sorry your original email was quite clear. Hmm interesting challenge. Big picture terms, I guess the two obvious choices seem to be to not use google for searching, or parse the google results, and determine the url validity as you are doing. Depending on the urls you use, that could be horrible. Guess that's where you are. Is not using google an option? Please let us know how you resolve it. Chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Doing without google is not an option. We are quite happy with them except for this one, admittedly minor, glitch. I spent some time yesterday digging through code without much luck. Today I'm going to experiment with this: getting a Request Dispatcher for the URL from the ServletContext, creating a dummy ServerRequest and ServerResponse object and invoking include(request, response) or forward() on that dispatcher. With luck, I'll be able to get what would be the response from a HEAD or a GET request in some sort of output stream in the response object, then examine that output stream for the result. -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Check if a URL exists programatically
Short question: How can I, from within code running under Tomcat, determine if a given URL request to that tomcat instance would result in a 404 or not, without calling back to the Tomcat using an HTTP HEAD or GET? Background: We use google custom search by calling the google server and then formatting the results on our search page. Our range of products is fairly fluid, and there is occasionally a gap between when a product goes away and the google search index is updated, which would result in a 404 if user clicked that link in the search results. (I know that I can ask google to re-index, but I still need to solve this problem.) Rather than write a ton of code for the various types of pages that we have (product, category, etc) I'd like to just be able to call some Tomcat method to determine if the URL that I get back from google would result in a 404 or not. I'm currently calling back to the Tomcat instance using an HTTP HEAD call, but that is a waste of resources and during periods of high volume uses up processing threads that I want to reserve for actual customers. We are using Tomcat 7 with Struts. -- Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Check if a URL exists programatically
On 07/16/2015 01:04 PM, chris derham wrote: Short question: How can I, from within code running under Tomcat, determine if a given URL request to that tomcat instance would result in a 404 or not, without calling back to the Tomcat using an HTTP HEAD or GET? Background: We use google custom search by calling the google server and then formatting the results on our search page. Our range of products is fairly fluid, and there is occasionally a gap between when a product goes away and the google search index is updated, which would result in a 404 if user clicked that link in the search results. (I know that I can ask google to re-index, but I still need to solve this problem.) Rather than write a ton of code for the various types of pages that we have (product, category, etc) I'd like to just be able to call some Tomcat method to determine if the URL that I get back from google would result in a 404 or not. I'm currently calling back to the Tomcat instance using an HTTP HEAD call, but that is a waste of resources and during periods of high volume uses up processing threads that I want to reserve for actual customers. We are using Tomcat 7 with Struts. Mitch, What will you do when you detect a 404? Couldn't you just implement a custom 404 error page, that does what ever it is? Chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org I already have a custom error page. When I detect that a URL returned by google would return a 404, I exclude it from the search results so that the user never sees it. Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Embedded tomcat problem
Tomcat 6.0.29 sun java 1.6.0_20 Ubuntu 10.04 64 bit Seems like this should be simple, but can't get it to work. I'm trying to run a simple embedded Tomcat inside my program. Code for starting the Tomcat is below. It seems to start OK, based on logging messages, but whenever I try to access a page (http://localhost:8000/TestWeb1/index.jsp) using it, I get the standard Tomcat 404 error page with the message The requested resource () is not available.. The page shows up fine in a normal, standalone Tomcat. Any help is appreciated. Been working at this for a while now. The web app I'm trying to run is the very basic one that is generated by NetBeans using the Web Application project. The files in /home/mclaborn/projects/NetBeans/MMServer/TestWeb1/build are web index.jsp META-INF context.xml MANIFEST.MF WEB-INF classes web.xml The context.xml contains ?xml version=1.0 encoding=UTF-8? Context antiJARLocking=true path=/TestWeb1/ web.xml ?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; session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app Code that starts the embedded Tomcat: Embedded tomcat = new Embedded(); tomcat.setName(Catalina); Engine engine = tomcat.createEngine(); engine.setName(Catalina); Host host = tomcat.createHost(localhost, /home/mclaborn/projects/NetBeans/MMServer/TestWeb1/build); engine.addChild(host); engine.setDefaultHost(host.getName()); Context context = tomcat.createContext(/TestWeb1, /home/mclaborn/projects/NetBeans/MMServer/TestWeb1/build/web); host.addChild(context); tomcat.addEngine(engine); Connector l_connector = tomcat.createConnector(0.0.0.0, 8000, false); tomcat.addConnector(l_connector); tomcat.start(); - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embedded tomcat problem
At a guess, you'll need to define the JSP servlet in web.xml if you want to handle JSPs. Same goes for the default servlet and static content. Mark Mark - I owe you one! That was it. Seems like when Tomcat runs standalone, it merges the contents of conf/web.xml into the application's web.xml to define the JSP and default servlets. When running embedded, that doesn't happen. I first copied tomcat's conf/web.xml to mine and that worked great. I then set Catalina home on the Embedded instance with the orignal web.xml and that works also. I'll probably use that second solution long term. Thanks again. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat and Hex characters
This may help. If any of the filters in the chain do any kind of read to the input stream, then the encoding is fixed from that point on. I had a similar problem with Struts in Tomcat. I solved it by putting a filter in the chain ahead of sturts and calling req.setCharacterEncoding(UTF-8); on the ServletRequest before calling the next filter(s). Mitch On 07/13/2010 11:33 AM, Caldarale, Charles R wrote: From: arun kumar [mailto:arunbha...@yahoo.com] Subject: Tomcat and Hex characters What do i have to do to be able to pass hex values of UTF-8 encoded strings that represent characters of foreign languages (like say Chines/Japanese) to my servlet so it is read correctly? Start by studying this (it's non-trivial, and it's not clear how running inside JBoss affects it): http://wiki.apache.org/tomcat/FAQ/CharacterEncoding If that doesn't help, come back to the list and tell us what exact Tomcat version you're using, along with the JVM level and the platform you're on, and the exact changes you've made. Be precise. You should probably try to solve the problem on a standalone Tomcat first, then apply the working config to JBoss, if possible. - 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: cluster error recovered?
What are more reasonable values for those settings? mitch Filip Hanik - Dev Lists wrote: increase your send timeout, 3000 seconds is very aggressive, and you would have to tune away most long GC pauses to not timeout. increase your dropTimeout, it seems you're getting false positives, prolly GC again Filip On 12/11/2009 04:28 PM, Mitch Claborn wrote: tomcat 6.0.20 cluster See output below. There are errors at the beginning. Do the later messages (e.g. INFO: Manager [localhost#]; session state send at 12/11/09 5:16 PM received in 7,894 ms.) indicate that it recovered? Is there a way to somehow determine that the cluster is operational after the tomcat has been running for a while? Mitch Dec 11, 2009 5:16:43 PM org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS app name Catalina Dec 11, 2009 5:16:43 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Dec 11, 2009 5:16:43 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.20 Dec 11, 2009 5:16:43 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.0.0.52:5000 Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Dec 11, 2009 5:16:44 PM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73495212,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ] Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:46 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:47 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:47 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:48 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:49 PM org.apache.catalina.ha.session.DeltaManager start INFO: Register manager to cluster element Engine with name Catalina Dec 11, 2009 5:16:49 PM org.apache.catalina.ha.session.DeltaManager start INFO: Starting clustering manager at Dec 11, 2009 5:16:54 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73504284,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ]] message. Will verify. Dec 11, 2009 5:16:54 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73504284,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ]] Dec 11, 2009 5:16:54 PM org.apache.catalina.ha.tcp.SimpleTcpCluster send SEVERE: Unable to send message through cluster sender. org.apache.catalina.tribes.ChannelException: Operation has timed out(3000 ms.).; Faulty members:tcp://{10, 0, 0, 53}:5000; at org.apache.catalina.tribes.transport.nio.ParallelNioSender.sendMessage(ParallelNioSender.java:97) at org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessage
Re: deadlock in database connection pooling?
Excellent information! I will try those immediately. mitch Christopher Schultz wrote: Mitch, On 12/10/2009 7:43 PM, Mitch Claborn wrote: poolPreparedStatements=true driverClassName=com.mysql.jdbc.Driver validationQuery=select * from operator limit 1 FWIW, this is a non-ideal validation query: 1. It uses SELECT *, which is not particularly efficient. 2. It uses a real table, which means that real data will be selected. 3. It uses a LIMIT, which means that you know that too much data is going to come back. Might I suggest: validationQuery=/* ping */SELECT 1 MySQL Connector/J drivers after a certain version recognize the /* ping */ at the beginning of the query and will execute a low-level connection check that does not involve a query at all! So, you get your validation that the connection is properly connected without all that silly work on the server. If the version of the MySQL driver is NOT new enough, it will execute the SELECT 1 query which consults no tables and executed super fast. You win both ways. testWhileIdle=true testOnBorrow=false testOnReturn=false That's an odd configuration... why test while idle but not when the connection is needed? I suspect that if you set testOnBorrow=true and testWhileIdle=false, you will avoid your deadlock problem. -chris - 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
cluster error recovered?
tomcat 6.0.20 cluster See output below. There are errors at the beginning. Do the later messages (e.g. INFO: Manager [localhost#]; session state send at 12/11/09 5:16 PM received in 7,894 ms.) indicate that it recovered? Is there a way to somehow determine that the cluster is operational after the tomcat has been running for a while? Mitch Dec 11, 2009 5:16:43 PM org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS app name Catalina Dec 11, 2009 5:16:43 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Dec 11, 2009 5:16:43 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.20 Dec 11, 2009 5:16:43 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.0.0.52:5000 Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Dec 11, 2009 5:16:44 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Dec 11, 2009 5:16:44 PM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73495212,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ] Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Dec 11, 2009 5:16:45 PM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:46 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Dec 11, 2009 5:16:46 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:47 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:47 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:48 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost# Dec 11, 2009 5:16:49 PM org.apache.catalina.ha.session.DeltaManager start INFO: Register manager to cluster element Engine with name Catalina Dec 11, 2009 5:16:49 PM org.apache.catalina.ha.session.DeltaManager start INFO: Starting clustering manager at Dec 11, 2009 5:16:54 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73504284,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ]] message. Will verify. Dec 11, 2009 5:16:54 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 0, 53}:5000,{10, 0, 0, 53},5000, alive=73504284,id={103 55 44 -101 55 19 65 -86 -80 19 79 49 -64 64 -48 10 }, payload={}, command={}, domain={}, ]] Dec 11, 2009 5:16:54 PM org.apache.catalina.ha.tcp.SimpleTcpCluster send SEVERE: Unable to send message through cluster sender. org.apache.catalina.tribes.ChannelException: Operation has timed out(3000 ms.).; Faulty members:tcp://{10, 0, 0, 53}:5000; at org.apache.catalina.tribes.transport.nio.ParallelNioSender.sendMessage(ParallelNioSender.java:97) at org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessage(PooledParallelSender.java:53) at org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(ReplicationTransmitter.java:80) at org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelCoordinator.java:78) at org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75) at
deadlock in database connection pooling?
I'm seeing several occurrences of deadlocks in Tomcat like the following. Any clues? Definition of the Resource is below. Found one Java-level deadlock: = http-8081-56: waiting to lock monitor 0x08f50bd0 (object 0x560511f8, a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool), which is held by Timer-0 Timer-0: waiting to lock monitor 0x08f9cea4 (object 0x5669f358, a org.apache.tomcat.dbcp.dbcp.PoolableConnection), which is held by pool-3580-thread-5 pool-3580-thread-5: waiting to lock monitor 0x08f50bd0 (object 0x560511f8, a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool), which is held by Timer-0 Java stack information for the threads listed above: === http-8081-56: at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:916) - waiting to lock 0x560511f8 (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool) at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at com.csc.mm.db.DBUtil.getDBConnection(DBUtil.java:89) (truncated - application code) Timer-0: at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:175) - waiting to lock 0x5669f358 (a org.apache.tomcat.dbcp.dbcp.PoolableConnection) at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:92) at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:82) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.init(DelegatingStatement.java:61) at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:224) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:331) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:312) at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.evict(GenericObjectPool.java:1217) - locked 0x560511f8 (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool) at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1341) at java.util.TimerThread.mainLoop(Unknown Source) at java.util.TimerThread.run(Unknown Source) pool-3580-thread-5: at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.addObjectToPool(GenericObjectPool.java:1136) - waiting to lock 0x560511f8 (a org.apache.tomcat.dbcp.pool.impl.GenericObjectPool) at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.returnObject(GenericObjectPool.java:1076) at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:87) - locked 0x5669f358 (a org.apache.tomcat.dbcp.dbcp.PoolableConnection) at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181) at com.csc.mm.db.DBUtil.executeQuery(DBUtil.java:408) (truncated - application code) Resource name=jdbc/main url=jdbc:mysql://blahblah/blahblah?profileSQL=falseamp;zeroDateTimeBehavior=convertToNull username=ddd password=dd auth=Container type=javax.sql.DataSource initialSize=0 minIdle=0 removeAbandoned=false removeAbandonedTimeout=60 logAbandoned=true maxActive=150 maxIdle=100 maxWait=1 poolPreparedStatements=true driverClassName=com.mysql.jdbc.Driver validationQuery=select * from operator limit 1 testWhileIdle=true testOnBorrow=false testOnReturn=false timeBetweenEvictionRunsMillis=1 numTestsPerEvictionRun=100 minEvictableIdleTimeMillis=60 / - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deadlock in database connection pooling?
Sorry - I was going to put that in and just forgot. Old age strikes again. It is 6.0.20. Can I simply delete the tomcat version of dbcp (jar file) and drop in the 1.3 version from commons? Mitch Claborn 972-954-7341 mi...@claborn.net Caldarale, Charles R wrote: From: Mitch Claborn [mailto:mi...@claborn.net] Subject: deadlock in database connection pooling? I'm seeing several occurrences of deadlocks in Tomcat like the following. Any clues? Definition of the Resource is below. Want to give us a hint about what Tomcat version you're using? Or is Pid's Internet Telepathy required (again)? I believe there's a known deadlock in Commons DBCP 1.2.x levels that is supposed to be fixed in 1.3. Tomcat 6.0.20 uses Commons DBCP 1.2.2, so you /may/ have run into that. - 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
Bad file descriptor serving static file
tomcat 6.0.20 Java(TM) SE Runtime Environment (build 1.6.0_16-b01) linux Debian lenny Getting the error below when serving a static file. It is always the same file (/struts/dojo/struts_dojo.js). (Yes, I know that struts normally serves that, but I had to patch one of the struts files, so tomcat is serving it instead.) The file is quite large, around 540KB. Any thoughts or ideas? java.io.IOException: Bad file descriptor at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.FilterInputStream.read(Unknown Source) at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:2009) at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1755) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:844) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:332) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73) at com.mm.server.framework.struts.FilterWrapper.doFilter(FilterWrapper.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.mm.server.framework.lib.stats.StatsFilter.doFilterInternal(StatsFilter.java:72) at com.mm.server.framework.lib.stats.StatsFilter.doFilter(StatsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:361) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) -- Mitch Claborn 972-954-7341 mi...@claborn.net - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
I played a bit with that approach, but couldn't figure out how to get my valve early enough in the chain. Mitch Christopher Schultz wrote: Mitch, On 8/12/2009 7:08 PM, Mitch Claborn wrote: The answer is: yes, there are times when the response is already committed, so the valve is not a foolproof solution. If the Valve wraps the request with an object that intercepts the addCookie method, then the solution is more viable. Just make sure your Valve gets called before the authenticator code :) -chris - 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: JSESSIONID cookie permanent?
I was able to change the expiration on the cookie with a one line change to org.apache.catalina.connector.Request and it works like I need it to. What is the official way to request an enhancement to allow this to be configurable? mitch Mitch Claborn wrote: The answer is: yes, there are times when the response is already committed, so the valve is not a foolproof solution. mitch Mitch Claborn wrote: I was able to get the cookie permanent with a simple valve, code below. Question: the new cookie will be ignored if the response has already been committed (isCommitted()). In my brief testing, the new cookie is being set, so the response must not be committed. Is it possible that there might be times when the response IS committed when my valve is invoked, causing the new cookie to be ignored? public void invoke(Request request, Response response) throws IOException, ServletException { getNext().invoke(request, response); for (Cookie c : response.getCookies()) { if (Globals.SESSION_COOKIE_NAME.equals(c.getName())) { Cookie l_new = (Cookie) c.clone(); l_new.setMaxAge(Integer.MAX_VALUE); response.addCookie(l_new); } } } Mitch Claborn 972-954-7341 mi...@claborn.net Len Popp wrote: It comes up all the time. The solution is typically to use a separate cookie and *not* tie the persistent data to the browser session, since the browser session is transient. -- Len On Wed, Aug 12, 2009 at 14:54, Mitch Claborn mi...@claborn.net wrote: If I can't find a another way that's what I'll have to do. I would be surprised that this need doesn't come up more frequently. Mitch David Smith wrote: Your best bet is to assign your own cookie. Then on new session creation, look for the cookie and repopulate the new session with shopping cart data. --David Mitch Claborn wrote: My usage is: I store the key to the user's shopping cart in the session. I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Mitch Martin Gainty wrote: anyone know if there is a use-case for sessionId surviving end-of-session? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 12 Aug 2009 12:43:11 -0500 From: mi...@claborn.net To: users@tomcat.apache.org Subject: JSESSIONID cookie permanent? Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1 - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
JSESSIONID cookie permanent?
Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
My usage is: I store the key to the user's shopping cart in the session. I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Mitch Martin Gainty wrote: anyone know if there is a use-case for sessionId surviving end-of-session? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 12 Aug 2009 12:43:11 -0500 From: mi...@claborn.net To: users@tomcat.apache.org Subject: JSESSIONID cookie permanent? Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
I don't have any problem with the session contents (on the tomcat server). I'm in a tomcat cluster and the sessions are replicated between members of the cluster. As long as at least one member of the cluster is running, then the sessions survive. I don't mind if the sessions on the server expire after a number of days. I'm just wanting the user to be able to keep his sessionid across browser sessions. Mitch Hassan Schroeder wrote: On Wed, Aug 12, 2009 at 11:35 AM, Mitch Clabornmi...@claborn.net wrote: My usage is: I store the key to the user's shopping cart in the session. If I understand you correctly, then you would need to serialize the session when it ended, to be able to resurrect it and retrieve that key, or have never-expiring sessions (probably *not* a good idea). I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Why can't you just save the cart key in a persistent cookie? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
If I can't find a another way that's what I'll have to do. I would be surprised that this need doesn't come up more frequently. Mitch David Smith wrote: Your best bet is to assign your own cookie. Then on new session creation, look for the cookie and repopulate the new session with shopping cart data. --David Mitch Claborn wrote: My usage is: I store the key to the user's shopping cart in the session. I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Mitch Martin Gainty wrote: anyone know if there is a use-case for sessionId surviving end-of-session? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 12 Aug 2009 12:43:11 -0500 From: mi...@claborn.net To: users@tomcat.apache.org Subject: JSESSIONID cookie permanent? Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1 - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
I was able to get the cookie permanent with a simple valve, code below. Question: the new cookie will be ignored if the response has already been committed (isCommitted()). In my brief testing, the new cookie is being set, so the response must not be committed. Is it possible that there might be times when the response IS committed when my valve is invoked, causing the new cookie to be ignored? public void invoke(Request request, Response response) throws IOException, ServletException { getNext().invoke(request, response); for (Cookie c : response.getCookies()) { if (Globals.SESSION_COOKIE_NAME.equals(c.getName())) { Cookie l_new = (Cookie) c.clone(); l_new.setMaxAge(Integer.MAX_VALUE); response.addCookie(l_new); } } } Mitch Claborn 972-954-7341 mi...@claborn.net Len Popp wrote: It comes up all the time. The solution is typically to use a separate cookie and *not* tie the persistent data to the browser session, since the browser session is transient. -- Len On Wed, Aug 12, 2009 at 14:54, Mitch Claborn mi...@claborn.net wrote: If I can't find a another way that's what I'll have to do. I would be surprised that this need doesn't come up more frequently. Mitch David Smith wrote: Your best bet is to assign your own cookie. Then on new session creation, look for the cookie and repopulate the new session with shopping cart data. --David Mitch Claborn wrote: My usage is: I store the key to the user's shopping cart in the session. I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Mitch Martin Gainty wrote: anyone know if there is a use-case for sessionId surviving end-of-session? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 12 Aug 2009 12:43:11 -0500 From: mi...@claborn.net To: users@tomcat.apache.org Subject: JSESSIONID cookie permanent? Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSESSIONID cookie permanent?
The answer is: yes, there are times when the response is already committed, so the valve is not a foolproof solution. mitch Mitch Claborn wrote: I was able to get the cookie permanent with a simple valve, code below. Question: the new cookie will be ignored if the response has already been committed (isCommitted()). In my brief testing, the new cookie is being set, so the response must not be committed. Is it possible that there might be times when the response IS committed when my valve is invoked, causing the new cookie to be ignored? public void invoke(Request request, Response response) throws IOException, ServletException { getNext().invoke(request, response); for (Cookie c : response.getCookies()) { if (Globals.SESSION_COOKIE_NAME.equals(c.getName())) { Cookie l_new = (Cookie) c.clone(); l_new.setMaxAge(Integer.MAX_VALUE); response.addCookie(l_new); } } } Mitch Claborn 972-954-7341 mi...@claborn.net Len Popp wrote: It comes up all the time. The solution is typically to use a separate cookie and *not* tie the persistent data to the browser session, since the browser session is transient. -- Len On Wed, Aug 12, 2009 at 14:54, Mitch Claborn mi...@claborn.net wrote: If I can't find a another way that's what I'll have to do. I would be surprised that this need doesn't come up more frequently. Mitch David Smith wrote: Your best bet is to assign your own cookie. Then on new session creation, look for the cookie and repopulate the new session with shopping cart data. --David Mitch Claborn wrote: My usage is: I store the key to the user's shopping cart in the session. I'd like the user to be able to come back a few days from now and still find the items they have placed in their shopping cart. (This is mostly for anonymous users who don't sign in until checkout.) Mitch Martin Gainty wrote: anyone know if there is a use-case for sessionId surviving end-of-session? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 12 Aug 2009 12:43:11 -0500 From: mi...@claborn.net To: users@tomcat.apache.org Subject: JSESSIONID cookie permanent? Is there a way to make the JSESSIONID cookie issued by Tomcat permanent, or at least significantly longer life than end of session ? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org _ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h
Re: Can a Realm communicate with a web application?
Pid wrote: On 22/7/09 19:32, Mitch Claborn wrote: Pid wrote: On 21/7/09 23:23, Mitch Claborn wrote: I am toying with the idea of writing my own Realm for authentication. Much of the code and structures that I need are already present in the web application. Is there any way for the Realm to access Java objects from the web application? They don't appear to share the same class loader. As an alternative is there a mechanism for providing the functionality of a Realm, but within the web application structure? You can define the Realm in your context.xml, (which of course you'll be configuring in the META-INF dir of your web-app, hint hint). I think this will load classes from your web-app classloader. N.B. Check out the localDataSource attribute, if you're also using a web-app specific DataSource. http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#DataSourceRealm p I found that I can define the Realm in the conext.xml in my WEB-INF, but it is not being located - getting java.lang.ClassNotFoundException when the web app deploys/starts. I've triple checked that the class files are there in WEB-INF/classes. I also tried putting in a jar in WEB-INF/ilb. I'm guessing that the Realm is still being loaded in a different class loader. I would guess the Realm is loaded in the common class loader, as defined at http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html. What is the exact CNFE and is there a stacktrace to go with it? You've only got the class in one place at any one time I presume? It's also spelled correctly in the context.xml definition? (you could post that file here, sanitised for passwords if present). p everything looks correctly spelled to me. That class only in one place. find . -name MyRealm.class ./MMWebServer/WEB-INF/classes/com/csc/mm/web/tomcat/MyRealm.class ls webapps/MMWebServer/WEB-INF/classes/com/csc/mm/web/tomcat/ MyRealm.class MyRealm$MyPrincipal.class jarfind MyRealm.class (no results) context.xml ?xml version=1.0 encoding=UTF-8? Context antiJARLocking=true path= Manager pathname= / Realm className=com.csc.mm.web.tomcat.MyRealm / /Context Jul 23, 2009 8:40:10 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive MMWebServer.war Jul 23, 2009 8:40:10 AM org.apache.tomcat.util.digester.Digester startElement SEVERE: Begin event threw exception java.lang.ClassNotFoundException: com.csc.mm.web.tomcat.MyRealm at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205) at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2723) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:624) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:486) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:810) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:740) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:110) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644) at org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:789) at org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:732) at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1009) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.init(StandardContext.java:5398
Re: Can a Realm communicate with a web application?
Pid wrote: On 21/7/09 23:23, Mitch Claborn wrote: I am toying with the idea of writing my own Realm for authentication. Much of the code and structures that I need are already present in the web application. Is there any way for the Realm to access Java objects from the web application? They don't appear to share the same class loader. As an alternative is there a mechanism for providing the functionality of a Realm, but within the web application structure? You can define the Realm in your context.xml, (which of course you'll be configuring in the META-INF dir of your web-app, hint hint). I think this will load classes from your web-app classloader. N.B. Check out the localDataSource attribute, if you're also using a web-app specific DataSource. http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#DataSourceRealm p I found that I can define the Realm in the conext.xml in my WEB-INF, but it is not being located - getting java.lang.ClassNotFoundException when the web app deploys/starts. I've triple checked that the class files are there in WEB-INF/classes. I also tried putting in a jar in WEB-INF/ilb. I'm guessing that the Realm is still being loaded in a different class loader. I would guess the Realm is loaded in the common class loader, as defined at http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html. Any other ideas? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Can a Realm communicate with a web application?
Caldarale, Charles R wrote: From: Mitch Claborn [mailto:mi...@claborn.net] Subject: Re: Can a Realm communicate with a web application? I found that I can define the Realm in the conext.xml in my WEB-INF, The context.xml file (not conext.xml) goes into META-INF, not WEB-INF. Start again. - Chuck My typos. I have/had context.xml in META-INF. Fingers faster than brain today. mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Can a Realm communicate with a web application?
I am toying with the idea of writing my own Realm for authentication. Much of the code and structures that I need are already present in the web application. Is there any way for the Realm to access Java objects from the web application? They don't appear to share the same class loader. As an alternative is there a mechanism for providing the functionality of a Realm, but within the web application structure? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Clustering help
FYI - running one of the instances in a VMWare virtual machine works fine. Mitch Mitch Claborn wrote: Yes to both questions. What a bummer. I'll try running the second instance on a VM an see what happens. Mitch Filip Hanik - Dev Lists wrote: Wait a second, are both your instances on the same machine? Are you running Apache Tomcat 6.0.20 there was a serious regression, with the loopback turned off. https://issues.apache.org/bugzilla/show_bug.cgi?id=47308 Filip On 07/17/2009 08:54 AM, Mitch Claborn wrote: ping 224.0.0.1 PING 224.0.0.1 (224.0.0.1) 56(84) bytes of data. 64 bytes from 192.168.3.254: icmp_seq=1 ttl=255 time=0.895 ms 64 bytes from 192.168.3.254: icmp_seq=2 ttl=255 time=0.693 ms 64 bytes from 192.168.3.254: icmp_seq=3 ttl=255 time=0.686 ms Mitch Filip Hanik - Dev Lists wrote: correct, you're members are not discovering each other. and its purely multicast related. what do you get when you do ping 224.0.0.1 Filip On 07/16/2009 05:16 PM, Mitch Claborn wrote: Not having much luck getting a simple cluster to work. Using nginx as a front end/load balancer against two tomcat instances on the same machine (for now). SuSE Linux 11.1. I see this message in the startup log, making me think the tomcat instances are not talking: INFO: Manager [localhost#/Struts1]: skipping state transfer. No members active in cluster group. I have a simple test page in the web app that shows the session ID and the instance of tomcat that it is hitting (by server port number) and the session id changes whenever ngnix directs the request to a different instance. as far as I can tell, multicast is enabled on eth0: eth0 Link encap:Ethernet HWaddr 00:1D:09:C4:C2:9A inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::21d:9ff:fec4:c29a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 I've added a route for the mulitcast address to eth0: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 228.0.0.4 0.0.0.0 255.255.255.255 UH0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.3.254 0.0.0.0 UG0 0 0 eth0 localhost is mapped to the eth0 interface: ping localhost PING mlcx300 (192.168.3.5) 56(84) bytes of data. 64 bytes from mlcx300 (192.168.3.5): icmp_seq=1 ttl=64 time=0.046 ms I've tried the simple config: Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ as well as the detailed config below. Any pointers or ideas are welcome. Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 Manager className=org.apache.catalina.ha.session.DeltaManager name=MMClusterManatger expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.4 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=5000 autoBind=100 selectorTimeout=100 minThreads=2 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender poolSize=25/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt; statistics=true / Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Here are the cluster related messages from the startup of instance 2: INFO: Cluster is about
Clustering with persistent sessions
The web site we are developing will have at least two tomcat servers behind some kind of load balancer (looking at nginx so far). The requirement is that the session data be completely persistent, even if all of the members of the cluster fail. This will be an extremely rare condition, but it could happen. Any suggestions on the best way to set that up? Surely I'm not the first to have requirements like this. I've played with the tomcat cluster and the DetlaManager and it works fine as long as at least one member of the cluster stays alive, but if all are down at the same time, then session data is lost. There doesn't seem to be any obvious way to configure some kind of persistent storage for the session data. Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Clustering help
ping 224.0.0.1 PING 224.0.0.1 (224.0.0.1) 56(84) bytes of data. 64 bytes from 192.168.3.254: icmp_seq=1 ttl=255 time=0.895 ms 64 bytes from 192.168.3.254: icmp_seq=2 ttl=255 time=0.693 ms 64 bytes from 192.168.3.254: icmp_seq=3 ttl=255 time=0.686 ms Mitch Filip Hanik - Dev Lists wrote: correct, you're members are not discovering each other. and its purely multicast related. what do you get when you do ping 224.0.0.1 Filip On 07/16/2009 05:16 PM, Mitch Claborn wrote: Not having much luck getting a simple cluster to work. Using nginx as a front end/load balancer against two tomcat instances on the same machine (for now). SuSE Linux 11.1. I see this message in the startup log, making me think the tomcat instances are not talking: INFO: Manager [localhost#/Struts1]: skipping state transfer. No members active in cluster group. I have a simple test page in the web app that shows the session ID and the instance of tomcat that it is hitting (by server port number) and the session id changes whenever ngnix directs the request to a different instance. as far as I can tell, multicast is enabled on eth0: eth0 Link encap:Ethernet HWaddr 00:1D:09:C4:C2:9A inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::21d:9ff:fec4:c29a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 I've added a route for the mulitcast address to eth0: Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface 228.0.0.4 0.0.0.0 255.255.255.255 UH0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.3.254 0.0.0.0 UG0 0 0 eth0 localhost is mapped to the eth0 interface: ping localhost PING mlcx300 (192.168.3.5) 56(84) bytes of data. 64 bytes from mlcx300 (192.168.3.5): icmp_seq=1 ttl=64 time=0.046 ms I've tried the simple config: Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ as well as the detailed config below. Any pointers or ideas are welcome. Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 Manager className=org.apache.catalina.ha.session.DeltaManager name=MMClusterManatger expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.4 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=5000 autoBind=100 selectorTimeout=100 minThreads=2 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender poolSize=25/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt; statistics=true / Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Here are the cluster related messages from the startup of instance 2: INFO: Cluster is about to start Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/192.168.3.5:4001 Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Jul 16, 2009 6:03:27 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership
Re: Clustering help
Yes to both questions. What a bummer. I'll try running the second instance on a VM an see what happens. Mitch Filip Hanik - Dev Lists wrote: Wait a second, are both your instances on the same machine? Are you running Apache Tomcat 6.0.20 there was a serious regression, with the loopback turned off. https://issues.apache.org/bugzilla/show_bug.cgi?id=47308 Filip On 07/17/2009 08:54 AM, Mitch Claborn wrote: ping 224.0.0.1 PING 224.0.0.1 (224.0.0.1) 56(84) bytes of data. 64 bytes from 192.168.3.254: icmp_seq=1 ttl=255 time=0.895 ms 64 bytes from 192.168.3.254: icmp_seq=2 ttl=255 time=0.693 ms 64 bytes from 192.168.3.254: icmp_seq=3 ttl=255 time=0.686 ms Mitch Filip Hanik - Dev Lists wrote: correct, you're members are not discovering each other. and its purely multicast related. what do you get when you do ping 224.0.0.1 Filip On 07/16/2009 05:16 PM, Mitch Claborn wrote: Not having much luck getting a simple cluster to work. Using nginx as a front end/load balancer against two tomcat instances on the same machine (for now). SuSE Linux 11.1. I see this message in the startup log, making me think the tomcat instances are not talking: INFO: Manager [localhost#/Struts1]: skipping state transfer. No members active in cluster group. I have a simple test page in the web app that shows the session ID and the instance of tomcat that it is hitting (by server port number) and the session id changes whenever ngnix directs the request to a different instance. as far as I can tell, multicast is enabled on eth0: eth0 Link encap:Ethernet HWaddr 00:1D:09:C4:C2:9A inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::21d:9ff:fec4:c29a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 I've added a route for the mulitcast address to eth0: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 228.0.0.4 0.0.0.0 255.255.255.255 UH0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.3.254 0.0.0.0 UG0 0 0 eth0 localhost is mapped to the eth0 interface: ping localhost PING mlcx300 (192.168.3.5) 56(84) bytes of data. 64 bytes from mlcx300 (192.168.3.5): icmp_seq=1 ttl=64 time=0.046 ms I've tried the simple config: Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ as well as the detailed config below. Any pointers or ideas are welcome. Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 Manager className=org.apache.catalina.ha.session.DeltaManager name=MMClusterManatger expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.4 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=5000 autoBind=100 selectorTimeout=100 minThreads=2 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender poolSize=25/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt; statistics=true / Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Here are the cluster related messages from the startup of instance 2: INFO: Cluster is about to start Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound
Clustering help
Not having much luck getting a simple cluster to work. Using nginx as a front end/load balancer against two tomcat instances on the same machine (for now). SuSE Linux 11.1. I see this message in the startup log, making me think the tomcat instances are not talking: INFO: Manager [localhost#/Struts1]: skipping state transfer. No members active in cluster group. I have a simple test page in the web app that shows the session ID and the instance of tomcat that it is hitting (by server port number) and the session id changes whenever ngnix directs the request to a different instance. as far as I can tell, multicast is enabled on eth0: eth0 Link encap:Ethernet HWaddr 00:1D:09:C4:C2:9A inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::21d:9ff:fec4:c29a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 I've added a route for the mulitcast address to eth0: Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface 228.0.0.4 0.0.0.0 255.255.255.255 UH0 00 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 1 00 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 00 lo 0.0.0.0 192.168.3.254 0.0.0.0 UG0 00 eth0 localhost is mapped to the eth0 interface: ping localhost PING mlcx300 (192.168.3.5) 56(84) bytes of data. 64 bytes from mlcx300 (192.168.3.5): icmp_seq=1 ttl=64 time=0.046 ms I've tried the simple config: Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ as well as the detailed config below. Any pointers or ideas are welcome. Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 Manager className=org.apache.catalina.ha.session.DeltaManager name=MMClusterManatger expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.4 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=5000 autoBind=100 selectorTimeout=100 minThreads=2 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender poolSize=25/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt; statistics=true / Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Here are the cluster related messages from the startup of instance 2: INFO: Cluster is about to start Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/192.168.3.5:4001 Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Jul 16, 2009 6:03:26 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Jul 16, 2009 6:03:27 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Jul 16, 2009 6:03:27 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Jul 16, 2009 6:03:28 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Jul 16, 2009 6:03:29 PM org.apache.catalina.ha.session.DeltaManager start INFO: Register manager /Struts1 to cluster element Engine with name Catalina Jul 16, 2009 6:03:29 PM org.apache.catalina.ha.session.DeltaManager
Re: Multiple invocation of servlet with the same URL request
Check the access logs - you may be actually getting multiple requests. Mitch Claborn mi...@claborn.net Konstantin Kolinko wrote: 2009/7/6 Daniele Development-ML daniele@googlemail.com: (...) Looking at the log and all the printouts, I have noticed that the servlet is invoked four times (four log entries in the database) instead of one. This is also shown by the four System.out lines I found in the screen when requesting the same URL. Anybody has any hint about this problem and how to resolve it? My idea is that the servlet might be relatively slow and thus Tomcat reiterates the request. Is this right? The user can reiterate the request if (s)he is tired of waiting, or happened to click the link several times. There are also some download accelerators that try to open several connections to download a file faster (asking for different byte ranges of the same file). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Clustering questions
I'm investigating to set up my first Tomcat cluster and have some questions. 1. Using a SimpleTcpCluster, it looks like session information is replicated to all members of the cluster. If all members of the cluster go down at once, is the session information lost? Can a simple cluster be combined with a Persistent Manager to save session information if all members of the cluster go down at once? 2. If I set up a SimpleTcpCluster, does that eliminate the need for the load balancer to use sticky sessions? 3. Is it possible to use a PersisentManager and a shared database to replicate sessions through the database, eliminating the need for the clustering stuff? I've read some posts that indicate that the PersistentManager writes sessions to the database at its discretion, not immediately. 4. Has anyone used nginx as a load balancer for tomcat? Any feedback on the wisdom of that? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
JSP/Japer in batch
I'm looking for a good general purpose template engine to use with various Java projects, not just web projects. Is it possible to use Jasper outside of a servlet engine? Mitch - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org