Re: Is it possible to have shared JDBC resources in Tomcat 6.0 cluster?
HI, you can check HA JDBC. http://ha-jdbc.sourceforge.net/doc.html Peter Am 10.09.2010 um 10:59 schrieb Michael Knümann: Hi I'm currently working on migrating single server web application for deployment in a cluster. We have JDBC connection pools to talk with several databases. I'm going to divide the max db connection attribute for each by the number of nodes then. But I'm wondering if it is possible to have a cluster wide connection pool. with kind regards Michael Knümann - 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: Non-secure HTTP connector with secure=true requires a keystore?
Hi, I don't have this problem at tomcat 6.0.18 Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ Connector port=9080 executor=tomcatThreadPool protocol=HTTP/1.1 connectionTimeout=6 URIEncoding=UTF-8 / Connector port=9089 schema=http secure=true executor=tomcatThreadPool protocol=HTTP/1.1 connectionTimeout=6 URIEncoding=UTF-8 / Test with folloing index.jsp %= new java.util.Date() % %= request.isSecure() % As you want SSL enabled, you must add schema=https secure=true SSLEnabled=true at your config. Peter Am 07.10.2008 um 21:01 schrieb Christopher Schultz: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:[EMAIL PROTECTED] Subject: Re: Non-secure HTTP connector with secure=true requires a keystore? I tried it with scheme=http at first, and got the same exception. The code in 6.0 is noticeably different from that in 5.5 for protocol initialization, including setting up the socket factory. Would it be possible to test the config on 6.0 to see if you can achieve the desired results there? Yeah, I can probably try that. I don't even need an app to deploy in order to test ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjrsgkACgkQ9CaO5/Lv0PCWPQCbBXylAq0lmheCGZwpsxPrL9yA SJEAoIoJ/FHSV+pK+6J1PalX9DWWWZCq =xNNQ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Basic Tribes Questions
HI Mike, tribes is part of tomcat. Yoo can find the svn repo links at http://tomcat.apache.org/svn.html Peter Am 08.10.2008 um 17:18 schrieb Mike Wannamaker: Cool, Is there a repository to just get the tribes jar or just the tribes source without having to get all of tomcat to get it? Like a SVN or CVS repository I could get the fix from and build myself? Thanks Mike -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: October 7, 2008 5:13 PM To: Tomcat Users List Subject: Re: Basic Tribes Questions hi Mike, that's great. yes, the TCP failure detector could give multiple DISAPPEARED messages, that is something I'm about to fix Filip Mike Wannamaker wrote: Hi Filip, I think I am seeing the message, it was just hidden amongst other log messages I guess I missed it. However I do see something else when I added the TcpFailureDetector to the interceptor list, I see two DISAPPEARED messages? Without TcpFailureDetector: 1) Start Server #1, then #2 2) Unplug #2 network 3) On #1 - #2 DISAPPEARED, on #2 - #1 DISAPPEARED 4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED Add TcpFailureDetector 1) Start Server #1, #2 2) Unplug #2 network 3) On #1 - #2 DISAPPEARED;#2 DISAPPEARED, on #2 - #1 DISAPPEARED;#1 DISAPPEARED 4) Reconnect #2 to network, on #1 - #2 SHUTDOWN;#2 ADDED, on #2 - #1 ADDED I take it I get the 2 DISAPPEARED messages because I have another interceptor, but is this the correct behaviour? TIA Mike -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: October 6, 2008 11:28 AM To: Tomcat Users List Subject: Re: Basic Tribes Questions there are getters and setters for everything and they are all documented here http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html each component has getters/setters, for example, the multicast address setAddress getAddress breakpoints might not work very well, since you are stopping one thread, and not really emulating a real scenario. again, sounds like you have a simple test case, if you can share that, I can get more understanding, and help you further. Filip Mike Wannamaker wrote: Hi Filip Thanks for the info. However, I don't see the documentation for the setters/getters you mention below? Also I'm having issues while debugging. When I hit a breakpoint in my code and while stepping thru code, I get DISAPPEARED/ADDED messages over and over on the other server? I would think the heartbeat is running in a separate thread for both send/receive? How to solve this, bump the heartbeat timeout? TIA Mike -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: October 3, 2008 2:51 PM To: Tomcat Users List Subject: Re: Basic Tribes Questions answers inline Mike Wannamaker wrote: Hi, I am currently trying to use Tribes as the clustering layer on our server. My startup code looks like this. if(_tribesChannel == null) { // nothing to do if already running try { _tribesChannel = new GroupChannel(); // must be done before start: no need to use any properties, there are getters and setters for everything and they are all documented here http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html _tribesChannel.getMembershipService ().getProperties().put(mcastPort, String.valueOf(_mainPort)); _tribesChannel.getMembershipService ().getProperties().put(mcastAddress, _multicastIPAddr); not sure what you are trying to do in the code below. if you wanna set the port, then simply do it. the membership will pick it up automatically if(_ancillaryPort 0) { _tribesChannel.getMembershipService ().getProperties().put(tcpListenPort, String.valueOf (_ancillaryPort)); // hack alert: Default Tribes instantiation (Tomcat 6.0.16) does not read value for tcpListenPort from properties. // Therefore, set it directly ChannelReceiver receiver = _tribesChannel.getChannelReceiver(); if(receiver.getPort() != _ancillaryPort) { if(receiver instanceof ReceiverBase) { ((ReceiverBase)receiver).setPort (_ancillaryPort); } } } _tribesChannel.addMembershipListener (_tribesMembershipListener); _tribesChannel.addChannelListener (_tribesChannelListener); _tribesChannel.start(CHANNEL_COMPONENTS); } catch(ChannelException ex) { try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/}
Re: Managing Tomcat 6 threads : How to make tomcat destroy threads when idle?
Hi Rohan, at tomcat 6 you must use an external executor thread pool to decrease idle threads: Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=2000 minSpareThreads=20/ Connector executor=tomcatThreadPool port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Look at http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html Executor drop idle threads after one minute. Peter Am 07.10.2008 um 10:29 schrieb Mark Thomas: Rohan Sahgal wrote: I tried increasing the number of tomcat threads. However, I cannot get tomcat to destroy the threads once they get created even though tomcat is idle. However I have observed that once 2000 threads are created (I am monitoring with jconsole), the number never comes down. The minSpareThreads and maxSpareThreads are ignored. Correct - those parameters have no effect. I could not find their mention in the tomcat docs either, but this was something I found on a blog post for Tomcat 5.x. Tomcat 5.x is not Tomcat 6.x. There are differences and this is one of them. Is there a way to make tomcat reduce the number of threads? Sorry, no. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: clustering: session replication
Hi, at tomcat 5.5 cluster you can use the cluster logging. Look at tomcat docs http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog ... Peter Am 22.07.2008 um 09:07 schrieb nch: Hi, there. Does anyone know how to trace session replication in a cluster? Thank you. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Cluster - node02 is invalid, removed or not replicated at this node.
HI Andrew, Your mcastDropTime=1000 is to low. Please set it to 3 and it is true that you must wait 35 sec before you can restart a cluster node. Use the Java Service Wrapper or add this to your start scripts to configure this. Peter Am 22.02.2008 um 11:48 schrieb Andrew Hole: Hello guys! We are trying to test Tomcat clustering but we are getting some problems. Sometimes (Log2) everything works fine but in other cases the cluster doesn't work (Log1). The only difference is the time that we wait after we shutdown a node. When we make a request after shutdown a node, cluster doesn't work, but if we wait more time (1 minute more or less), the cluster works fine and we can proceed making requests. Log 1: 22/Fev/2008 10:31:11 org.apache.catalina.cluster.tcp.ReplicationValvecreatePrimaryIndicator FINE: Context /outpatient: Primarity of session 1E4B56ED32E80A15EE5B40E5C83FB49E.node02 in request attribute org.apache.catalina.cluster.tcp.isPrimarySession is false. 22/Fev/2008 10:31:11 org.apache.catalina.cluster.tcp.SimpleTcpClusterlogSendMessage INFO: SEND 22/Fev/2008:10:31:11 16 - 1E4B56ED32E80A15EE5B40E5C83FB49E.node02#-#localhost#-#/outpatient#- #0#-#1203676271418 22/Fev/2008 10:31:13 org.apache.catalina.cluster.tcp.ReplicationValveresetDeltaRequest FINE: Cluster is standalone: reset Session Request Delta at context /outpatient 22/Fev/2008 10:31:15 org.apache.catalina.cluster.tcp.ReplicationValvecreatePrimaryIndicator FINE: Context /outpatient: Requested session 1E4B56ED32E80A15EE5B40E5C83FB49E.node02 is invalid, removed or not replicated at this node. Log 2: 22/Fev/2008 10:34:08 org.apache.catalina.cluster.tcp.ReplicationValvecreatePrimaryIndicator FINE: Context /outpatient: Primarity of session 76CFC5DD3CF130EA0A10875E7B7C.node01 in request attribute org.apache.catalina.cluster.tcp.isPrimarySession is false. 22/Fev/2008 10:34:08 org.apache.catalina.cluster.tcp.SimpleTcpClusterlogSendMessage INFO: SEND 22/Fev/2008:10:34:08 2 - 76CFC5DD3CF130EA0A10875E7B7C.node01#-#localhost#-#/outpatient#- #0#-#1203676448864 22/Fev/2008 10:34:10 org.apache.catalina.cluster.tcp.ReplicationValveresetDeltaRequest FINE: Cluster is standalone: reset Session Request Delta at context /outpatient 22/Fev/2008 10:34:38 org.apache.catalina.cluster.tcp.ReplicationValvecreatePrimaryIndicator FINE: Context /outpatient: Primarity of session 76CFC5DD3CF130EA0A10875E7B7C.node02 in request attribute org.apache.catalina.cluster.tcp.isPrimarySession is true. Our cluster setup: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog manager.className= org.apache.catalina.cluster.session.DeltaManager manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=false manager.notifySessionListenersOnReplication=false manager.sendAllSessions=false manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 Membership className= org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastClusterDomain=d10 mcastPort=45564 mcastFrequency=1000 mcastDropTime=1000 recoveryCounter=10 recoveryEnabled=true recoverySleepTime=5000/ Receiver className= org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto tcpListenPort=9016 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className= org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=fastasyncqueue recoverTimeout=500 stateTransferTimeout=1 recoverCounter=6 doTransmitterProcessingStats=true doProcessingStats=true doWaitAckStats=true queueTimeWait=true queueDoStats=true queueCheckLock=true ackTimeout=1500 waitForAck=true keepAliveTimeout=8
Re: Tomcat 5.5.26 - JMXAdaptorLifecycleListener issues
Hi Vishal, I see the problems and think I can fix it. At my test env (Linux, Mac OS x) the Registry and Platform MBeanServer are the same. I can see all Tomcat Mbeans at my jconsole. Many thanks, Peter Am 16.02.2008 um 23:18 schrieb Vishal Goenka: 2. JMXAdaptorLifecycleListener registers the PlatformMBean server with the registry whereas Tomcat's MBeans are registered with another MBean server created using the apache common's modeler registry wrapper code. Hence Tomcat's MBeans don't show up in JConsole when you connect using the URL that the JMXAdaptorLifecycleListener registers. I'm not entirely sure of a clean way of doing this. A hack that seems to work is setting the PlatformMBeanServer as the MBean server to use for Tomcat programmatically. In the constructor of JMXAdaptorLifecycleListener, adding the following does the trick, but only if it is the first listener in the server.xml file: org.apache.commons.modeler.Registry.getRegistry(null, null).setMBeanServer(ManagementFactory.getPlatformMBeanServer());
Re: Cluster Not Syncing After Restart
Yes, you are right! Feedback welcome :-) Peter Am 18.01.2008 um 22:24 schrieb David Rees: On Jan 18, 2008 1:13 PM, David Rees [EMAIL PROTECTED] wrote: So your testing is with the to-be-released 5.5.26? Where can I get a copy of this and the changes going into 5.5.26? I found the changelog, looks like I need to build 5.5.26 from source myself if i want to test it? http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/ changelog.xml It does look like there are some bugfixes in it which may affect cluster synchronization. -Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cluster Not Syncing After Restart
Hi David, I have also made a test with two cluster nodes. Is node2 under load as node1 is started the message are normal. Cluster is starts first and receive message, but the application starts later. As application is startet at node1 the manager request node2 for current sessions. All message that received before the sync is complete are dropped. All message has a timestamp and only message dropped before the GET_ALL_SESSION message are created. At next release 5.5.26 the sessionCounter is also set correct after restart. At my test all sessions are correct load after restart. Peter PS: My Cluster Config: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog manager.className=org.apache.catalina.cluster.session.DeltaManager manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=false manager.notifySessionListenersOnReplication=false manager.sendAllSessions=false manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=224.0.0.4 mcastPort=${mcast.port.prefix}7 mcastFrequency=1000 mcastDropTime=3/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto tcpListenPort=${port.prefix}7 tcpSelectorTimeout=100 tcpThreadCount=6 / Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=fastasyncqueue recoverTimeout=5000 recoverCounter=6 doTransmitterProcessingStats=true doProcessingStats=true doWaitAckStats=true queueTimeWait=true queueDoStats=true queueCheckLock=true ackTimeout=15000 waitForAck=true keepAliveTimeout=8 keepAliveMaxRequestCount=-1/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.* \.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.htm;.*\.html;.*\.txt; primaryIndicator=true / Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve enabled=true / ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener / ClusterListener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinderLi stener / /Cluster Am 17.01.2008 um 09:24 schrieb David Rees: On Jan 17, 2008 12:16 AM, Peter Rossbach [EMAIL PROTECTED] wrote: you can't restart your nodes so quickly. As you shutdown one node you must wait 30-45 sec before next restart. Don't restart both nodes at same time. I am waiting at 4 minutes before restarting node 2 before restarting node 1, so that is not the problem in this case. The sequence goes like this: 04:30: Shut down node 1, it gets restarted automatically immediately after it has completely shut down (typically within 10 seconds). 04:34: Shut down node 2, it gets restarted automatically immediately after it has completely shut down (typically within 10 seconds). -Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cluster Not Syncing After Restart
Hi David, you can't restart your nodes so quickly. As you shutdown one node you must wait 30-45 sec before next restart. Don't restart both nodes at same time. Peter Am 17.01.2008 um 02:25 schrieb David Rees: I'm running a Tomcat 5.5.25 cluster with 2 nodes and the following cluster configuration in the Host/ element: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.* \.css;.*\.txt;/ Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve enabled=true/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener / ClusterListener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinder Listener/ /Cluster Every night, I restart the two nodes of the cluster, one at a time, using a standard shutdown with a processing monitoring Tomcat to start it back up automatically after it has exited (daemontools for those interested). But after restarting the first node, it does not rejoin the cluster. In the logs of node 1 are this (node was shut down at 04:30): 2008-01-17 04:30:07,212 INFO : SimpleTcpCluster: Cluster is about to start 2008-01-17 04:30:07,317 INFO : SimpleTcpCluster: Add Default ClusterReceiver at cluster localhost 2008-01-17 04:30:07,326 INFO : SimpleTcpCluster: Add Default ClusterSender at cluster localhost 2008-01-17 04:30:07,341 INFO : SocketReplicationListener: Open Socket at [10.1.1.5:8015] 2008-01-17 04:30:07,363 ERROR: ClusterListener: Context manager doesn't exist: ^^^ That line repeats ~25,000 times for a couple seconds 2008-01-17 04:30:10,110 ERROR: ClusterListener: Context manager doesn't exist: 2008-01-17 04:30:11,443 INFO : McastService: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) 2008-01-17 04:30:11,790 INFO : DeltaManager: Starting clustering manager...: 2008-01-17 04:30:11,790 INFO : DeltaManager: Register manager to cluster element Host with name localhost 2008-01-17 04:30:11,790 INFO : DeltaManager: Starting clustering manager at 2008-01-17 04:30:11,794 WARN : DeltaManager: Manager [], requesting session state from org.apache.catalina.cluster.mcast.McastMember[tcp:// 10.1.1.6:8015,catalina,10.1.1.6,8015, alive=86161577]. This operation will timeout if no session state has been received within 60 seconds. 2008-01-17 04:30:21,894 ERROR: DeltaManager: Manager []: No session state send at 17/01/08 04:30 received, timing out after 10,102 ms. While node 1 is shutting down, ~4000 messages like this are generated on node 2: 2008-01-17 04:30:06,233 WARN : FastAsyncSocketSender: Unable to asynchronously send session with id=[x.c-web2-1200438737718] - message will be ignored. java.lang.NullPointerException at org.apache.catalina.cluster.tcp.DataSender.pushMessage (DataSender.java:1057) at org.apache.catalina.cluster.tcp.FastAsyncSocketSender $FastQueueThread.pushQueuedMessages(FastAsyncSocketSender.java:524) at org.apache.catalina.cluster.tcp.FastAsyncSocketSender $FastQueueThread.run(FastAsyncSocketSender.java:487) 2008-01-17 04:30:06,235 WARN : FastAsyncSocketSender: Unable to asynchronously send session with id=[x.c-web2-1200438739053] - message will be ignored. java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java: 333) at java.net.PlainSocketImpl.connectToAddress (PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at org.apache.catalina.cluster.tcp.DataSender.createSocket (DataSender.java:897) at org.apache.catalina.cluster.tcp.DataSender.openSocket (DataSender.java:866) at org.apache.catalina.cluster.tcp.DataSender.pushMessage (DataSender.java:1009) at org.apache.catalina.cluster.tcp.FastAsyncSocketSender $FastQueueThread.pushQueuedMessages(FastAsyncSocketSender.java:524) at org.apache.catalina.cluster.tcp.FastAsyncSocketSender $FastQueueThread.run(FastAsyncSocketSender.java:487) These stop after about 1 second (last one at 04:30:07.340), and then a decent number of Send stats lines are then printed on node 2: 2008-01-17 04:30:07,376 INFO : DataSender: Send stats from [10.1.1.5:8,015], Nr of bytes sent=20,441,242 over 26,000 = 786 bytes/request, processing time 58,669,413 msec, avg processing time 2,257 msec !-- More lines similar to the above and below -- 2008-01-17 04:30:10,053 INFO : DataSender: Send stats from [10.1.1.5:8,015], Nr of bytes sent=39,242,737 over 50,000 = 784 bytes/request, processing time 58,672,059 msec, avg processing time 1,173 msec When node 2 restarts a couple minutes later, it is
Re: Can you call an MBean programatically from the command line?
HI, use groovy with JMX. http://groovy.codehaus.org/Groovy+and+JMX http://jagger.berlios.de/ Regards Peter Am 10.01.2008 um 16:08 schrieb Dan: Hi, I use JProfiler amongst other tools and this has some useful MBeans which i'd like to activate at a given point from a scheduled job. All sounds very simple. However I cannot find a command line tool, perhaps similar to JConsole which allows me to execute a given MBean. Surely such a tool is available? If not then how hard would it be to write one? Thanks! Dan Message sent using UebiMiau 2.7.10 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: looking for sample MBean code for tomcat 6
Please read this: http://java.sun.com/developer/technicalArticles/J2SE/jmx.html http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/tutorialTOC.html Peter Am 09.01.2008 um 08:03 schrieb Frank Z: hello, I am looking some sample MBean code for TC 6.0.. I was able to model some code after the source code (e.g. MemoryUserDatabaseMBean.java in the org.apache.catalina.users. package) . I was also able to create the mbeans-descriptor.xml One question that I have is that even though the code compiled and deployed TC, i am not able to see my custom MBean via JConsole . Are there additional things needed to get the MBean registered properly in TC? Thanks in advance. __ __ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/ newsearch/category.php?category=shopping - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: looking for sample MBean code for tomcat 6
Hi Frank, you can add your Mbeans at following file === $catalina.base/conf/tomca5-mbeans.xml == bean mbean name=Bean:type=Bean code=test.MyBean attribute name=name value=Peter/ /mbean jmx-operation objectName=Bean:type=Bean operation=show/ mbean name=Bean:type=Bean2 code=test.MyBean/ jmx-operation objectName=Bean:type=Bean2 operation=setAll arg type=java.lang.String value=Willy/ arg type=java.lang.StringGo to water/arg /jmx-operation jmx-operation objectName=Bean:type=Bean2 operation=show/ /bean === The Engine element at server.xml can load those MBean instance declaration. Server ... ... Engine name=Catalina mbeansFile=${catalina.base}/conf/tomcat5-mbeans.xml defaultHost=localhost jvmRoute=node01 ... If you implement a init(),start()/stop(),destroy() method your MBeans also notified from Engine Lifecycle :-) Install your MBean Code at common or server classLoader. === common/classes/test/MyBean.java package test; public class MyBean implements MyBeanMBean { private String name ; public String getName() { return name ; } public void setName(String name) { this.name = name ; System.out.println(name) ;} private String street ; public String getStreet() { return street ; } public void setStreet(String street) { this.street = street ; System.out.println(street) ; } public void show() { System.out.println(name + -- + street) ; } public void setAll(String name , String street) { this.name = name ; this.street = street ; } } === === common/classes/test/MyBeanMBean.java package test; public interface MyBeanMBean { public String getName() ; public void setName(String name) ; public String getStreet() ; public void setStreet(String street) ; public void show() ; public void setAll(String name , String street); } I test the example with tomcat 5.5.25. I am hasn't tested with tomcat 6, but the insourced modeler code seems also working! Regards Peter Look at my old fixed issue : http://issues.apache.org/jira/browse/ MODELER-17 But I am not sure that that patch at 2.0.1 is complete ( jmx- attribute element not exists) Am 09.01.2008 um 17:25 schrieb Frank Z: Hi Peter, Thanks for sending the link. I guess what my real question was: how would I get TC to 'declaratively' instantiate my MBeans ? From the example, most of them has a main() method to instantiate and register the MBeans to the platform MBean Server. What would you recommend for TC , a servlet that loads on startup and within the init method it would create and register the MBeans? I am porting my MBeans from JBoss (embedding TC) and JBoss provides a declarative method do so without the needs of a servlet. It is done by creating a service archive (e.g. myservice.sar - containing a jboss-service.xml [similar to mbeans-descriptor.xml] that declares the MBeans). The JBoss container would then instantiate the MBeans via the MBean's start() method. public class Main { public static void main(String[] args) throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName (com.example.mbeans:type=Hello); Hello mbean = new Hello(); mbs.registerMBean(mbean, name); System.out.println(Waiting forever...); Thread.sleep(Long.MAX_VALUE); } } Thanks Frank. - Original Message From: Peter Rossbach [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, January 9, 2008 1:20:10 AM Subject: Re: looking for sample MBean code for tomcat 6 Please read this: http://java.sun.com/developer/technicalArticles/J2SE/jmx.html http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/ tutorialTOC.html Peter Am 09.01.2008 um 08:03 schrieb Frank Z: hello, I am looking some sample MBean code for TC 6.0.. I was able to model some code after the source code (e.g. MemoryUserDatabaseMBean.java in the org.apache.catalina.users. package) . I was also able to create the mbeans-descriptor.xml One question that I have is that even though the code compiled and deployed TC, i am not able to see my custom MBean via JConsole . Are there additional things needed to get the MBean registered properly in TC? Thanks in advance. _ _ __ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/ newsearch/category.php?category=shopping - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: Monitoring Tomcat Clusters
Hi! A very fine new Eclipse plugin make the monitoring live easier: http://jmxplorer.sourceforge.net/wiki/index.php/Managing_Tomcat and for admin access give the jagger cli/jmx interface a chance: http://jagger.berlios.de/ The lamdaprobe console had also a nice tomcat 5.5 jmx cluster monitoring (http://www.lambdaprobe.org/d/index.html), but it seem that probe development is stopped! Regards Peter Am 08.01.2008 um 11:40 schrieb Vinu Varghese Sorry I missed this in the last post Also regarding Monitoring tomcat , using JMX is better Check this: http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html Shiby Maria John wrote: HI, Do the Tomcat 5.5.x / 6.x versions have a default bundled application for monitoring tomcat clusters ? Also does it support JMS ? Regards, Shiby - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- signature full-name Vinu Varghese /full-name company-email [EMAIL PROTECTED] /company-email company-website www.x-minds.org /company-website big-words Success always occurs in private, and failure in full view. /big-words company-name-big \/ ._ _ o .__| _ /\ ~~ | | | | | | (_| _ \/ company-name-big /signature
Re: Tomcat 5.5.20+ behind an F5 Load Balancer doing SSL Connector problem
Hi, use a quot at AccessLogValve pattern to a muliple value field. quot;%{X-Forwarded-For}iquot; %l %u %t quot;%rquot; %s %b Look the following definition: http://en.wikipedia.org/wiki/X- Forwarded-For First value is the client ip. Peter Am 05.01.2008 um 22:19 schrieb Rainer Jung: Hi Gregory, the descriptions below work (at least) for TC 5.0/5.5/6.0. Gregory Gerard schrieb: I've got an F5 load balancer running version 9.3 of the software. I've got several Tomcat installations behind it. The F5 does all SSL and clear traffic as a reverse proxy, rewriting headers as needed for cookies and whatnot. I have one connector on 8080 for the clear traffic. My problem: I tried to add another connector on 8081 setting secure to true so that the HttpServletRequest would say, yup, this is a secure connection and tell the 8080 connector 8081 is the secure address it should use when trying to upshift to higher security. Don't use secure, use scheme=https instead. See http://tomcat.apache.org/tomcat-6.0-doc/config/http.html When I did this and started Tomcat up, it whined about not being able to open up my keystore. I want all my SSL to offloaded and keep the keys out of each machine and centrally managed. I *just* want to get the servlets to believe the connection is secure. This is analogous to HTTPd doing the SSL offload with the mod_jk connector. Also, the header X-Forwarded-For is set by the F5 and I'd like the Connector to also give out this IP instead of the load balancer's. I assume you are talking about the access log? For common log format, but using the client IP, you take the pattern: %{X-Forwarded-For}i %l %u %t quot;%rquot; %s %b See: http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html Caution: X-Forwarded-For can contain multiple IP addresses, if the request passed through multiple proxies and they are configured to add IPs, not to overwrite. Keep this in mind when doing analysis on the field. Any ideas short of recompiling Tomcat with a modified connector? Anyone else faced this problem? There should be no need for code changes :) thanks, greg Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tagging mod_jk 1.2.26
Hi Rainer, I have successfully test new mod_jk 1.2.26-dev with MacOS X Tiger 10.4.11 (Intel) and Leopard 10.5.1 PPC64. At all my test cases I see now the uri maps from all vhosts and the new JkMountCopy All also work well. The only mapping that we don't present is the jkstatus mappings! The new connection and failover handling work with my cluster configs. Great work and happy christmas tagging time :-) Peter +1 to tag 1.2.26-dev Am 20.12.2007 um 17:07 schrieb Rainer Jung: I'm planning to tag JK 1.2.26 tomorrow, Friday, after 2 p.m. There was one problem report. I think we fixed this and I expect, that we get some feedback before that time. In case there are more problem reports outstanding please let me know. Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk for OS X PPC
Hi! thanks for the nice tipp, but the result is: /usr/share/apr-1/build-1/libtool --silent --mode=compile gcc -I/usr/ include/apache2 -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/ apr-1 -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no- cpp-precomp -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp - I /include -I /include/ -c jk_util.c -o jk_util.lo jk_util.c: In function 'jk_gettid': jk_util.c:1847: error: duplicate case value jk_util.c:1845: error: previously used here jk_util.c: In function 'jk_gettid': jk_util.c:1847: error: duplicate case value jk_util.c:1845: error: previously used here lipo: can't open input file: /var/folders/Jh/Jh+xbtjtF5Ooj16aDgP84+++ +TI/-Tmp-//ccRS3pZV.out (No such file or directory) make[1]: *** [jk_util.lo] Error 1 Peter PS: I have successful test a ppc64 only binary. Am 30.10.2007 um 20:03 schrieb BuildSmart: On Oct 30, 2007, at 13:34:36, Richard Doust wrote: Dale, So what are you saying? It's working with that compile. Should I build it with some other set of options? Richard What I said was IT IS NOT RECOMMENDED TO BUILD FOR ppc64 ONLY. Without the ADE the chances that you could build for more than the 4 basics and have a module that will work are pretty much non- existant unless you managed to obtain the /AppleInternal development tree (you know, the files your missing when you try to build one of the Apple source packages). According to the developer documentation, ./configure CFLAGS='arch ppc64' APXSLDFLAGS='arch ppc64' --with-apxs=/usr/sbin/apxs format is not recommended and often times will yield a binary that is over inflated and non-functional. And that wont work anyways cause there a typo... it's -arch not arch, also, using precompiled headers for ppc on other architectures isn't recommended either so it's wise to add -no-cpp- precomp if you're building for more than ppc in your case. One of the following will yield the results you need (I build at Apple in the real ADE so I don't have your build issues). MACOSX_DEPLOYMENT_TARGET=10.4 APXSLDFLAGS=-arch ppc -arch ppc64 - bind_at_load CFLAGS=-arch ppc -arch ppc64 -g -Os -pipe -no-cpp- precomp CCFLAGS=-arch ppc -arch ppc64 -g -Os -pipe CXXFLAGS=- arch ppc -arch ppc64 -g -Os -pipe LDFLAGS=-arch ppc -arch ppc64 -bind_at_load ./configure --with-apxs=/usr/sbin/apxs MACOSX_DEPLOYMENT_TARGET=10.4 APXSLDFLAGS=-arch ppc -arch ppc64 - arch i386 -arch x86_64 -bind_at_load CFLAGS=-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp CCFLAGS=-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os - pipe CXXFLAGS=-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g - Os -pipe LDFLAGS=-arch ppc -arch ppc64 -arch i386 -arch x86_64 - bind_at_load ./configure --with-apxs=/usr/sbin/apxs If you actually have the headers required for all 4 architectures and can make the module for 4 then I would suggest while you're still at 10.5.0 you make the module and then give it to someone at tomcat to provide as a binary. If you have a small 20-80gb drive, install it in the machine, format as case sensitive journaled and name it DO_NOT_FINDER_BROWSE and I'll send you instruction off-list on how to populate it so that it can be used as a home-brewed ADE that you can use to build stuff on that will be environmentally compliant, work for everyone and always work if you want to go this route. On Oct 30, 2007, at 12:28 PM, BuildSmart wrote: On Oct 30, 2007, at 10:37:13, Richard Doust wrote: Alex, QuadG5:native jboss$ ./configure CFLAGS='arch ppc64' APXSLDFLAGS='arch ppc64' --with-apxs=/usr/sbin/apxs . . . checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. I also tried ppc_64. I'm looking for the right value now. I looked in the configure.log file and did a man on gcc and came to the understanding that: Ah, okay, -arch ppc64 is a valid parameter to the compiler, so I did: ./configure cflags='-arch ppc64' APXSLDFLAGS='-arch ppc64' -- with-apxs=/usr/sbin/apxs and that made some makefiles which I then used to compile mod_jk.so. Now I'm dealing with some apache configuration parameters in my old config that are apparently no longer valid (AddModule). I'll take it from here. Thanks an awful lot for the help! This also explains why the old mod_jk.so generated the same error. It's looking at 32-bit vs. 64-bit before it gets to the api. Not likely, that isn't how it works, apache isn't compiled for ppc64 only and it's not recommended to generate a ppc64 only module unless you strip all of the 32bit architecture from all of the binaries and force it to run in 64bit only which wont happen if you examine some of the libraries in /usr/lib. Richard On Oct 30, 2007, at 9:44 AM, Alex
Re: mod_jk for OS X PPC
Hi, this is not true. I have build a mod_jk ppc65 only binary and runit successfull at my G5 with standard Leopard apache2.2.6 installation. Peter Am 30.10.2007 um 17:28 schrieb BuildSmart: On Oct 30, 2007, at 10:37:13, Richard Doust wrote: Alex, QuadG5:native jboss$ ./configure CFLAGS='arch ppc64' APXSLDFLAGS='arch ppc64' --with-apxs=/usr/sbin/apxs . . . checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. I also tried ppc_64. I'm looking for the right value now. I looked in the configure.log file and did a man on gcc and came to the understanding that: Ah, okay, -arch ppc64 is a valid parameter to the compiler, so I did: ./configure cflags='-arch ppc64' APXSLDFLAGS='-arch ppc64' --with- apxs=/usr/sbin/apxs and that made some makefiles which I then used to compile mod_jk.so. Now I'm dealing with some apache configuration parameters in my old config that are apparently no longer valid (AddModule). I'll take it from here. Thanks an awful lot for the help! This also explains why the old mod_jk.so generated the same error. It's looking at 32-bit vs. 64-bit before it gets to the api. Not likely, that isn't how it works, apache isn't compiled for ppc64 only and it's not recommended to generate a ppc64 only module unless you strip all of the 32bit architecture from all of the binaries and force it to run in 64bit only which wont happen if you examine some of the libraries in /usr/lib. Richard On Oct 30, 2007, at 9:44 AM, Alex Fuller wrote: Alex Fuller wrote: it should come back with (for a G5): /usr/libexec/apache2/mod_alias.so (for architecture ppc64): Mach- O 64-bit bundle ppc64 Whereas I suspect on the one you're currently building you'd get: /usr/libexec/apache2/mod_alias.so (for architecture ppc7400): Mach-O bundle ppc Ha ha - obviously you would see a different path to the mod_jk.so file, I was using the Apple-built mod_alias.so as an example to check the reported architecture key :-/ Alex -- -- Dale - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk for OS X PPC
Hi, I have build my own mod_jk 1.2.25 module at Leopard: Install current Mac Ports sudo port install autoconf sudo port install apr sudo port install apr-util # use gnu libtool ln -s /opt/local/bin/glibtool /opt/local/bin/libtool ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize download/extract/goto apache 2.2.6 ./configure --prefix=/Users/xxx/server/apache226 --enable-so --with- mpm=worker ; make ; make install download/extract/goto mod_jk 1.2.25 .configure --with-apxs=/Users/xxx/server/apache226/bin/apxs make make install config mod_jk at apache226; start apache and volia mod_jk is up and runnig. I hope we can download the PPC binaries at Wednesday. I can check the mod_jk binaries with the standard Leopard apache 2.2.6 installation. Regards Peter Am 29.10.2007 um 22:14 schrieb Christopher Schultz: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Richard, Richard Doust wrote: In case that image doesn't get through, (and to make this text searchable) it says: Thanks for posting the text: the image did not come through; mailing lists rarely accept non-text attachments (and sometimes not even then). Cannot load /usr/libexec/apache2/mod_jk.so into server: dlopen(/usr/libexec/apache2/mod_jk.so, 10): no suitable image found. Did find /usr/libexec/apache2/mod_jk.so: mach-o, but wrong architecture. Can you run these on your system, please? $ uname -a $ file /path/to/mod_jk.so ?? That should give us some technical details that should help. Also, the version of your compiler would be helpful, too (usually 'cc -v' or something similar). That's what I get. I tried using the mod_jk.so that I had working with the 1.3 version of Apache just for hahas and get the same error, so I'm not sure what's going on. That's a little odd... it seems that Apache is complaining about the architecture, instead of the httpd API version mismatch. The 1.3 binary will certainly not work. I was hoping some kind soul might have a working version of mod_jk.so for the PowerPC architecture. Any light you can help shed on the subject would be appreciated. Oh, the apxs file in /usr/sbin has a timestamp that leads me to believe it came with the new version of Apache. Good to know. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHJk0o9CaO5/Lv0PARAnO/AKCUn8Pu2QDquIA14+1qZU/s5jHQNACdH96F SzaQwwi9GMsABmrZC5henx4= =wGkY -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble with mod_jk and passthrough authentication [Virus checked]
Hi, Which auth method and realm config you use at your webapp? Which auth method you use at your apache config? The AJP protocoll transfer all auth information from apache to tomcat. With ajp connector attribute tomcatAuthentication=true (default) tomcat reauth the request. regards Peter PS: Please update newer mod_jk version! Am 18.06.2007 um 11:03 schrieb [EMAIL PROTECTED]: Hi, I have a webapp running in Tomcat which authenticates the user logged on the windows box against a active directory domain. Everything workes fine when using tomcat directly, using Apache 2.0.49 with AJP 1.2.10 I get an 401 Authentication required error from the webapp. It seems Apache does receive the username/password from the browser but does not forward it via AJP to tomcat. I tried googling around but could not come up with a clear description if AJP13 does support this kind of passthrough. Can that be done with mod_jk or do I have to use some other module? Regards Thomas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Replication in Tomcat5.5.17
Look at current tomcat docs http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html http://tomcat.apache.org/connectors-doc/reference/workers.html http://tomcat.apache.org/connectors-doc/generic_howto/workers.html Peter Am 18.06.2007 um 17:45 schrieb shiva sha: Hi I try to implement Session replication in Tomcat5.5.17 using Apache HttpServer2.0.5. I had downloaded mod_jk.dll and placed this dll into apache/modules/. I had configured both server.xml in Tomcat1 and Tomcat2 and workers.properties in Apache in Windows 2000 environment. But no luck bcoz tomcat server throws error like no member is active in the cluster Pls send code samples and how to replicate the session in tomcat. Pls send workers.pro, httpd.conf,servers.xmls and docs for how to do or reference url for this.. Thanks Shiva - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with tomcat clusters sso with apache load balancer
Hi, the clusterSSO implementation is not ready: - at normal shutdown from one application or a node all sessions are expired. clusterSSO is a normal session listener and context stop expires all sessions. - The sessionID rewrite from JvmRouteBinderValve are not coordinated with clusterSSO sessionID cache. - I have made some improvements at the tomcat 5.5 backport :-( Peter Am 03.05.2007 um 19:24 schrieb Filip Hanik - Dev Lists: I don't think the clusterSSO implementation ever really got finished. It got submitted, but never completed. At least that was my impression of it Filip Alejandro Fernandez wrote: Hi, I am Alejandro from Argentina. I am having an issue with tomcat 6.0.10 using clusters and single sign on, while performing load balance with apache 2.2 When I am accessing a secured page, I try to login (the login form is shown correctly) but I receive the following: HTTP Status 400 - Invalid direct reference to form login page Note: The load balancer makes me switch between 2 tomcat servers. One switch by page request. Please tell me if the info is not enough. Thank you in advance. - - httpd.conf - - Location /balancer-manager SetHandler balancer-manager /Location Proxy balancer://cluster BalancerMember ajp://sismcarrizo:8009 BalancerMember ajp://servisitadores4:8009 /Proxy Proxy balancer://clusterb BalancerMember ajp://servisitadores4:8009 /Proxy Location /portal-a ProxyPass balancer://cluster/portal-a stickysession=JSESSIONID /Location Location /portal-b ProxyPass balancer://clusterb/portal-b stickysession=JSESSIONID /Location Location /portal-c ProxyPass balancer://cluster/portal-c stickysession=JSESSIONID /Location Location /accesos-sso ProxyPass balancer://cluster/accesos-sso stickysession=JSESSIONID /Location - - server.xml - - Engine name=Catalina defaultHost=localhost Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=8 Manager className=org.apache.catalina.ha.session.DeltaManager 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=4000 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitte r Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSen der/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDe tector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispa tch15Interceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=/ Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/ 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.JvmRouteSessionIDBinderList ener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Valve className=org.apache.catalina.authenticator.SingleSignOn debug=0/ Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.microsoft.jdbc.sqlserver.SQLServerDriver connectionURL=jdbc:microsoft:sqlserver:// desa-0:1433;databasename=accesos;selectmethod=cursor connectionName=accesosusr connectionPassword=j1ra808fa userTable=users userNameCol=username userCredCol=password userRoleTable=user_role roleNameCol=role debug=99 / Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine - - web.xml
Re: Comet: problem with request.getParameter() in Comet POST requests
Hi Am 02.05.2007 um 17:26 schrieb Sebastiaan van Erk: Hi, How about not arguing about everything ? It is your fault when parameters are not processed. Tomcat will process parameters with comet. No, Comet will not process parameters in POST requests if you call getParameter() in the BEGIN event and the request body has not yet arrived. getParameter() will return null even if the parameter is set in the request body. How is this my fault? How do I know when to call getParameter()? How exactly am I supposed to process the POST parameters in a Comet request? I have no problem to get POST parameter with NIO Connector at my begin.event. With APR connector I also have POST parameter problems. Strange! A my first request I get the POST parameter. The POST message close the event and I got an exception after the end event. == This two messages are only exists at my patch tomcat trunk, but it show that POST read the 12 byte post body. 02.05.2007 20:24:00 org.apache.catalina.connector.Request parseParameters FEIN: before readPostBody 12 02.05.2007 20:24:00 org.apache.catalina.connector.Request parseParameters FEIN: post is [EMAIL PROTECTED] 12 == Asynch close of the event command=close Asynch close of the event Closing transport Asynch close of the event command=close Asynch close of the event Event received END Closing transport Leaving handle end 02.05.2007 20:24:04 org.apache.catalina.connector.CoyoteAdapter event SCHWERWIEGEND: The servlet did not read all available bytes during the processing of the read event Event received BEGIN Leaving handle begin Sending message Message0 Sending message Message1 Sending message Message2 Sending message Message3 Sending message Message4 Closing transport Event received END Closing transport Leaving handle end As I use the NIO connector I have no problems... Here my POST request: == POST /tcniotest/comet HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de; rv: 1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 Accept: text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: close Content-Type: application/x-www-form-urlencoded X-Requested-With: XMLHttpRequest Referer: http://localhost:8080/tcniotest/ Content-Length: 12 Cookie: JSESSIONID=17451AD30A176E1B7E7292CD9E1A0987.tomcat6 Pragma: no-cache Cache-Control: no-cache action=close === Testet with current tomcat6 main trunk, java 6, mac osx 10.4.9 and firefox 2.0.0.3. , apr 1.2.8 tcnative 1.1.10 You need the IO event to free up more than just the memory. The file descriptor also needs to be freed; this was causing problems for me earlier. Then set a shorter timeout, allow an appropriate amount of file descriptors, or produce an IO event. It is possible that a notify method (or something like that) could be added on the event to make it a bit more straightforward. The first two are workarounds which start failing quite quickly when there is a high number of requests. As for the last option, how do produce and IO event on the input stream on the server side? It's the client that produces IO events on the input stream, and I have no control over the client. By the way, in RFC 2616 it says: HTTP/1.1 defines the close connection option for the sender to signal that the connection will be closed after completion of the response. It seems a good option that connection really close with the header Connection: close is set. For normal Htttp11Processor it is easy, but NIO and APR processor are more complex. Currently set a short timeout is the only option, but most programmes want to set Connection:close. So as far as I can tell it's not even required for the client to close the input stream after reading Content-Length bytes. It could very well wait for the server to close the request, which means that Comet receives no IO event and we end up having to wait for a TIMEOUT event. So please tell me how to produce an IO event. Currently we have no IO Event, but Remy has wrote a proposal to dev list :-) I thing we need this feature. +1 The way to sync is according to what your application does. The chat mini example has a very simple sync structure. The sync depends on what the application is doing. The only official stance is that none of the structures that the Servlet API provides are synced. I don't see how this is enough information. Obviously I need to synchronize access to the output stream of the repsonse object. But internally, Tomcat uses this object too. For example, it closes the output stream in the event.close() method. Without me knowing when and how Tomcat uses this object, how am I supposed to know how to do the synchronization? For example, there is no explanation in the chat example
Re: Jconsole and remote monitoring
Please use CATALINA_OPTS to set jmx options. The catalina.sh stop command use only JAVA_OPTS and not CATALINA_OPTS. Peter Am 02.05.2007 um 18:09 schrieb Rainer Jung: You neded to change your start/stop scripts, so that they use the management parameters only in the starting case and not in the stopping case (define a new variable and add it in bin/catalina.sh to the start case. [EMAIL PROTECTED] schrieb: Now jconsole works but when i shut it down with /bin/./shutdown.sh i get this error: Errore: Eccezione dell'agente : java.rmi.server.ExportException: Port already in use: 7019; nested exception is: java.net.BindException: Address already in use and tomcat doesn't shut down properly. I added the -Dcom.sun.management.jmxremote - Dcom.sun.management.jmxremote.port=7019 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false - Djava.rmi.server.hostname=192.168.0.5 in the /bin/catalina.sh file with: export JAVA_OPTS = -Dcom.sun.management.jmxremote - Dcom.sun.management.jmxremote.port=7019 - Dcom.sun.management.jmxremote.ssl=false - Dcom.sun.management.jmxremote.authenticate=false - Djava.rmi.server.hostname=192.168.0.5 is there any way i can fix this issue? thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close a comet request outside of an event?
Hmm, good point, but the HTTP/1.1 Spec RFC2616 (chapter 8.1, 14.10) not describe that server must close the connection as header Connection: close is set. This means that tomcat currently wait for socket timeout before connection is close. I have analyse the tomcat 6 trunk and see that we only made spezial handling to set Content-Type and Content-Lenght. (Repsonse.checkSpecialHeader(String,String) At Http11Processor it is easly to add the connection close feature, but at NIO and APR it seems complicate. Peter Am 27.04.2007 um 08:24 schrieb Sebastiaan van Erk: Hi, I've been thinking about this a bit more, and I understand why normally the response.close() should not go to the TCP layer: I'd forgotten all about request pipelining. However, in my case, the request has an explicit Connection: close header. Would not this case warrent an immediate shutdownOutput on the underlying socket? Regards, Sebastiaan P.S.: I really like Tomcat and Comet, so definately good job to you guys! Please don't read my emails as complaints; I just want to understand the API better and work with you guys to improve Comet by reporting possible bugs and sharing the issues I'm having! Filip Hanik - Dev Lists wrote: Correct, an asynchronous close doesn't go all the way down to the IO layer, it just marks the request closed. remember event.close doesn't mean TCP.socket.close, it means that this event/request sequence is done There are still many enhancements to be done to the Comet API, such as non blocking reads/writes and others, feel free to gather up your thoughts in a bulleted type email instead of the essays, they are a little hard to read :) Filip - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.x OpenEJB
HI David, I think the tomcat 6 basic classloader layout has not changed. Look at Bootstrap.java: private void initClassLoaders() { try { commonLoader = createClassLoader(common, null); if( commonLoader == null ) { // no config file, default to this loader - we might be in a 'single' env. commonLoader=this.getClass().getClassLoader(); } catalinaLoader = createClassLoader(server, commonLoader); sharedLoader = createClassLoader(shared, commonLoader); } catch (Throwable t) { log.error(Class loader creation threw exception, t); System.exit(1); } } You can configure with the ClassLoaders at conf/catalina.properties common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar server.loader= shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/ lib/*.jar Regards Peter Am 13.04.2007 um 00:46 schrieb David Blevins: On Apr 12, 2007, at 6:58 AM, Filip Hanik - Dev Lists wrote: David Blevins wrote: Plugging into Tomcat 6 doesn't work yet as the classloader structure changed just slightly. It'd likely be just a couple day effort to get it in, but we're very busy trying to finish up the EJB 3 work (we're really close). So if you really want it please hop on the user or dev list and say so. I don't think the classloader structure changed, it is still defined in catalina.properties On Apr 12, 2007, at 6:44 AM, Peter Rossbach wrote: It is true the tomcat 6 default classloader layout has changed. At the release bundle all class are located at common Classloader. You can easly switch to the old layout. Please edit the file conf/catalina.properties and move some files arround :-) Aha, it's just the default that's changed. Got it. I saw via a debugger that there was no longer a Shared classloader than immediately checked the neat little ascii diagram in the 6 docs and concluded it was gone. Alright, I'll have to poke around via debugger and see if I can't find a reliable way to locate the Common classloader regardless if there is or isn't a Shared classloader in the mix. Any suggestions are welcome. If we can get that going the integration with 6 should be in working condition with the default Tomcat 6 setup. Thanks, David - To start a new topic, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6.0.x OpenEJB
It is true the tomcat 6 default classloader layout has changed. At the release bundle all class are located at common Classloader. You can easly switch to the old layout. Please edit the file conf/catalina.properties and move some files arround :-) Regards Peter Am 12.04.2007 um 09:50 schrieb David Blevins: On Apr 11, 2007, at 8:21 PM, Filip Hanik - Dev Lists wrote: http://geronimo.apache.org they did it :) filip :) Just as a general note, as with OpenEJB 1.0 and before (0.9.x, 0.8.x, etc) you can once again plug OpenEJB 3 into Tomcat. OpenEJB 3 is the EJB 3.0 version based on our 1.x code that supports all the same feature sets that 1.x and before did, but for once we're actually current on the latest greatest spec revision. Currently, plugging OpenEJB 3 + Tomcat 5.5 works fine but there are a couple extra flags you have to set to get CMP to work (our CMP container is a layer over JPA), so hop on the OpenEJB user list if you want to give it a shot (openejb-users- [EMAIL PROTECTED]). Plugging into Tomcat 6 doesn't work yet as the classloader structure changed just slightly. It'd likely be just a couple day effort to get it in, but we're very busy trying to finish up the EJB 3 work (we're really close). So if you really want it please hop on the user or dev list and say so. We're always excited to have more contributors/committers too so if this is something you'd like to work on, great! We're happy to include you in the fun. -David PS I feel a little spammish writing emails like this, but I hope being a fellow Apache project now makes it ok :) José Perdigão wrote: Hi, has anyone been able to integrate OpenEJB with Apache-Tomcat 6.0.x? Or is it just impossible to do it? - To start a new topic, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk: mounting tomcat instances to subdirectories
Hmm, use multiple vhost for your three installations or different webapp names (/myapp1, /myapp2, /myapp3). mod_rewrite rewrite the uri before mod_jk handle the request! Regards Peter Am 17.01.2007 um 17:09 schrieb Ortwin Glück: Hi, I have 3 Tomcat instances, each running a different version of the same application. The applications all have the same webapp context. The Tomcats are running on a different machine than the webserver. But all three Tomcat instances are on the same machine (using different AJP ports). I want to mount these 3 instances in one Apache webserver under different subdirectories using mod_jk: http://myhost.tld/1/myapp/ -- tomcat1 http://myhost.tld/2/myapp/ -- tomcat2 http://myhost.tld/3/myapp/ -- tomcat3 My first naive try was this: JkMount /1/myapp/* tomcat1 JkMount /2/myapp/* tomcat2 JkMount /3/myapp/* tomcat3 Naturally the leading /1/ must be removed from the URL forwarded to the Tomcat. I have tried with mod_rewrite with no success (RewriteRule is ignored in a Location directive). I don't think that this setup is something rare. I am looking for a viable solution. Ortwin -- [web] http://www.odi.ch/ [blog] http://www.odi.ch/weblog/ [pgp] key 0x81CF3416 finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: AW: AW: Tomcat 5.5 Cluster: Session Replication before sending the response
Hi Andy, Please, look to ReplicationValve source code! === Snip ReplicationValve code 346ff getNext().invoke(request, response); Manager manager = request.getContext().getManager(); if (manager != null manager instanceof ClusterManager) { ClusterManager clusterManager = (ClusterManager) manager; CatalinaCluster containerCluster = (CatalinaCluster) getContainer().getCluster(); if (containerCluster == null) { if (log.isWarnEnabled()) log.warn(sm.getString (ReplicationValve.nocluster)); return; } // valve cluster can access manager - other cluster handle replication // at host level - hopefully! if(containerCluster.getManager(clusterManager.getName ()) == null) return ; if(containerCluster.hasMembers()) { sendReplicationMessage(request, totalstart, isCrossContext, clusterManager, containerCluster); } else { resetReplicationRequest(request,isCrossContext); } === You see that first complete request/response is process and after that the replication message is generated and send. Both cluster session manager send the delta or complete session after response is complete processed. OK, the description is bad, but the code is clean :-) Please setup a cluster with clusterlog: Cluster ... doClusterLog=true clusterLogName=clusterLog ... and setup conf/logging.properties #handlers = java.util.logging.ConsoleHandler handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler .handlers = java.util.logging.ConsoleHandler #.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler # Handler specific properties. # Describes specific configuration info for Handlers. 1catalina.org.apache.juli.FileHandler.level = FINE 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = clusterLog. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Facility specific properties. # Provides extra control for each logger. org.apache.catalina.core.ContainerBase.[Catalina].level = INFO #org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO #org.apache.catalina.core.ContainerBase.[Catalina]. [localhost].handlers = 2localhost.org.apache.juli.FileHandler # For example, set the com.xyz.foo logger to only log SEVERE # messages: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.session.ManagerBase.level = FINE org.apache.catalina.cluster.tcp.ReplicationValve.level = FINE clusterLog.handlers= 1catalina.org.apache.juli.FileHandler clusterLog.level=INFO === With this configuration you get a protocol from every message that cluster send or received. Regards Peter Am 18.01.2007 um 10:31 schrieb [EMAIL PROTECTED]: Hi Peter, The ReplicationValve will intercept the request when the request is completed and before the response is returned to the user. Copied from the JavaDoc for the SimpleTcpReplicationManager: Title: Tomcat Session Replication for Tomcat 4.0 Description: A very simple straight forward implementation of session replication of servers in a cluster. This session replication is implemented live. By live I mean, when a session attribute is added into a session on Node A a message is broadcasted to other messages and setAttribute is called on the replicated sessions. A full description of this implementation can be found under Filip's Tomcat Page Copyright: See apache license Company: www.filip.net (Tomcat Site is not available). This sounds like it works just like the DeltaManager replicating the changes not the complete session. My applikations works on the objects written to the session but does not call setAttribute again and so neither the DeltaManager nor the SimpleTcpReplicationManager would replicate these objects. Thus I am looking for a Manager which just replicates the complete session (after processing the request) no matter what. To trigger the replication the ReplicationValve is used but I am still searching for a *Manager which fits my needs described above. Regards Andy -Ursprüngliche Nachricht- Von: Peter Rossbach [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 18. Januar 2007 08:45 An: Tomcat Users List Betreff: Re: AW: AW: AW: Tomcat 5.5 Cluster: Session Replication before sending
Re: AW: AW: Tomcat 5.5 Cluster: Session Replication before sending the response
Hi you can give o.a.c.cluster.session.SimpleTcpReplicationManager a chance, but I don't know it works really. Regards Peter Am 16.01.2007 um 15:57 schrieb [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi Filip, I understand that I will just change the session in a way the delta manager will replicate everything. But is there no other Manager I can use which just replicates the complete session and not just the changed data (like the DeltaManager does)?! I couldn't find a Manager which replicates everything. Is there one? Thanks in advance! Andy -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. Januar 2007 15:35 An: Tomcat Users List Betreff: Re: AW: Tomcat 5.5 Cluster: Session Replication before sending the response even with this method, you are not managing the sessions, you're just making sure that everything gets replicated, so doing this, you are not changing the session manager. remember, the code below would be inserted into a filter or a valve Filip wrote: Hi Filip, Thanks for your answer. I also thought about this solution of just setting all objects again at the end of the doGet method. But if possible I would like to use a tomcat replication mechanism since I do not want to manage session since I have a tomcat- built-in session manager :) Andy -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 10. Januar 2007 16:52 An: Tomcat Users List Betreff: Re: Tomcat 5.5 Cluster: Session Replication before sending the response to achieve what you want, although slower, you can create a filter, and in that filter simply set all the attributes again Enumeration e = session.getAttributeNames(); while ( e.hasNext() ) { String name = e.next(); Object value = session.getAttribute(name); if ( value != null ) session.setAttribute(name,value); } you get the point :) Filip wrote: Hi everybody, I have a Tomcat 5.5 cluster with 2 nodes on SLES8 and want to replicate the complete session before the response is send. According to the Tomcat Clustering documentation the example with the DeltaManager does this since the ReplicationValve triggers the replication after the request has been processed and before the response is sent. Unfortunately the DeltaManager only replicates the changed data. Only changes made by using methods like setAttribute make changes visible to the DeltaManager and changes made to the object (like changing one field value noch setAttribute-call) do not. Thus I would need to change the way these objects are handled in the application. So I thought it would be the easiest way to just replicate the complete session instead of changes only. Is this possible? JavaDoc of org.apache.catalina.session.StandardManager: Standard implementation of the Manager interface that provides simple session persistence across restarts of this component (such as when the entire server is shut down and restarted, or when a particular web application is reloaded. This sounds like the session is only replicated when the server ist shutdown/restarted/app reloaded. It also doesn't specify what is replicated - the complete session? Any suggestions? Thanks in advance --Andy - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: AW: Tomcat 5.5 Cluster: Session Replication before sending the response
Hmm, It is not true, that multiple session replications are processed of one request! Session are replicated only after response processing is finished, see class o.a.c.cluster.tcp.ReplicationValve. As you have multiple request at same session, you can have small inconsistency problems. Regards Peter Am 17.01.2007 um 10:38 schrieb [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi Peter, Thanks for your answer. As far as I know the SimpleTcpReplicationManager has been implemented for Tomcat 4 an replicates the session when it changes. So everytime the session changes it would replicate it. Thus TC would replicate my session several times during the processing of a request which would not be appropriate since the session would hold the wrong information in case tomcat crashes during the processing of a request but already replicated the session several times. Thus it really looks like the only way to replicate the complete session is to implement a filter or valve. Regards Andy -Ursprüngliche Nachricht- Von: Peter Rossbach [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 17. Januar 2007 09:43 An: Tomcat Users List Betreff: Re: AW: AW: Tomcat 5.5 Cluster: Session Replication before sending the response Hi you can give o.a.c.cluster.session.SimpleTcpReplicationManager a chance, but I don't know it works really. Regards Peter Am 16.01.2007 um 15:57 schrieb [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi Filip, I understand that I will just change the session in a way the delta manager will replicate everything. But is there no other Manager I can use which just replicates the complete session and not just the changed data (like the DeltaManager does)?! I couldn't find a Manager which replicates everything. Is there one? Thanks in advance! Andy -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. Januar 2007 15:35 An: Tomcat Users List Betreff: Re: AW: Tomcat 5.5 Cluster: Session Replication before sending the response even with this method, you are not managing the sessions, you're just making sure that everything gets replicated, so doing this, you are not changing the session manager. remember, the code below would be inserted into a filter or a valve Filip wrote: Hi Filip, Thanks for your answer. I also thought about this solution of just setting all objects again at the end of the doGet method. But if possible I would like to use a tomcat replication mechanism since I do not want to manage session since I have a tomcat- built-in session manager :) Andy -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 10. Januar 2007 16:52 An: Tomcat Users List Betreff: Re: Tomcat 5.5 Cluster: Session Replication before sending the response to achieve what you want, although slower, you can create a filter, and in that filter simply set all the attributes again Enumeration e = session.getAttributeNames(); while ( e.hasNext() ) { String name = e.next(); Object value = session.getAttribute(name); if ( value != null ) session.setAttribute(name,value); } you get the point :) Filip wrote: Hi everybody, I have a Tomcat 5.5 cluster with 2 nodes on SLES8 and want to replicate the complete session before the response is send. According to the Tomcat Clustering documentation the example with the DeltaManager does this since the ReplicationValve triggers the replication after the request has been processed and before the response is sent. Unfortunately the DeltaManager only replicates the changed data. Only changes made by using methods like setAttribute make changes visible to the DeltaManager and changes made to the object (like changing one field value noch setAttribute-call) do not. Thus I would need to change the way these objects are handled in the application. So I thought it would be the easiest way to just replicate the complete session instead of changes only. Is this possible? JavaDoc of org.apache.catalina.session.StandardManager: Standard implementation of the Manager interface that provides simple session persistence across restarts of this component (such as when the entire server is shut down and restarted, or when a particular web application is reloaded. This sounds like the session is only replicated when the server ist shutdown/restarted/app reloaded. It also doesn't specify what is replicated - the complete session? Any suggestions? Thanks in advance --Andy - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: Apache+Tomcat+mod_jk+cookie+Rewrite
Right, is the url at same domain you can use emptySessionPath at your connector configuration. Connector emptysessionPath=true ... / Docs say: set to true, all paths for session cookies will be set to /. This can be useful for portlet specification implementations, but will greatly affect performance if many applications are accessed on a given server by the client. If not specified, this attribute is set to false. Regards Peter Am 05.01.2007 um 15:29 schrieb Christopher Schultz: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Deval, DEVAL SHAH wrote: I notice that because of url rewriting [RewriteRule] my cookie is not being passed to Tomcat. It's not your rewrite rule that is dropping your cookie. It's the fact that you are changing the path of the URI. RewriteRule ^/url1$ /MyApp/MyServlet [PT] I'm guessing that your webapp emits a cookie with the path of / MyApp. If your app also emits URLs of the form http://whatever/url1/ MyServlet, then the browser will not send the cookie along with the request (because the cookie belongs to /MyApp, not /url1). You can probably verify this using a packet sniffer or a much more convenient tool like LiveHttpHeaders for Mozilla Firefox or perhaps a plug-in for MSIE or another browser. How do i go about passing the cookie to the servlet using RewriteRule ? You will need to do one of several things: 1. Stop using this other URL. 2. Move that URL-to-be-re-written inside the URL space of your webapp (i.e. change /url1 to /MyApp/url1). 3. Modify your cookie configuration such that the path will be set to / instead of /MyApp (I think single-sign-op will do this, but there are probably other ways, too). 4. Use javascript to mutate the cookie and send (another copy) to the browser with the path of /url1 (you're already using javascript in your onsubmit event handler, so this should always work). I highly recommend #2. It's pretty easy, and you don't have to resort to any hacks in your application to make it work (other than the obvious hack of using mod_rewrite in the first place). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFnmC59CaO5/Lv0PARAl+YAKCy7JXb2gmrG7Yv1jMRvlrXMqvmMACgoCEc F9aJLnjBWwGCAJAkMdN01fU= =A2S+ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session replication/tomcat 5.5
Am 13.11.2006 um 20:27 schrieb David O'Dell: Is anyone using session replication in production? Yes, at really big sites :-) Is there an alternative to using multicasting? No, but you can implement you own membership service. In the doc http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html It states This is an algorithm that is only efficient when the clusters are small. I have 6 tomcat instances behind a load balancer, is this still considered small? Yes, but split your cluster into different domains. Use Apache/mod_jk = 1.2.19 with the domain attribute. The mod_jk loadbalancer can then route to the right backup. regards Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6 and comet
Hi, Comet style communication work also with the new NIO Connector. Test it with Tomcat 6.0.1 or the svn trunk. Connector port=8084 URIEncoding=UTF-8 connectionTimeout=30 protocol=org.apache.coyote.http11.Http11NioProtocol/ My current example is simple and works only at firefox. Next step to implement are client reconnect and message retry :-( I now start a deeper look at DWR, dojo, ActiveMQ AJAX examples. Regards Peter Am 13.11.2006 um 10:16 schrieb silvanoh722: hi. just install tomcat doesn't work because you need the java native support for the apr. see the documentation at http://tomcat.apache.org/tomcat-6.0-doc/ apr.html you must install the native support which you can find it (tomcat-native.tar.gz) in the bin directory of the apache-tomcat package. maybe you must install some additional library. anyway documantation explain this better than me. I hope you helped you. simone 2006/11/13, Jayant Kumar [EMAIL PROTECTED]: Hi, This is jayant from itgindia pvt. Ltd. India, you said that you installed the tomcat 6.0 and tried the example code, same thing I have done but when I send any request it does not call event method but it calls service method and if I does not give any Implemntation of service method then it gives me error that this url does not support the request (error no 405). So I want to know that I need to do any special setting or I need to install any connector, I couldn't understand what to do ? Pls help me out what I do to... I am waiting for your reply. Jayant Kr. Punjabi (iTG India Pvt. Ltd.) -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.3/531 - Release Date: 11/12/2006 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Cluster problem. skipping state transfer. No members active in cluster group
I think you have a network routing problem. Read the cluster help: http://tomcat.apache.org/faq/cluster.html Regards Peter Am 25.10.2006 um 06:20 schrieb hotszkin: I am trying to setup a tomcat cluster as told in the tomcat cluster document. There are 3 PCs in my environment. All of them are running RHEL AS 3. apache (2.0.26) /w mod_jk (1.2.19) ip: 10.0.0.20 | ___ | || ip:10.0.0.10 10.0.0.11 tomcat1tomcat2 (version 5.5.17 with jre 1.5.0_08) ip:192.168.5.223 192.168.5.224 The 10.0.0.0/24 is the subnet for apache and tomcat, and 192.168.5.0/24 is the subnet for tomcat session replication/cluster. The apache and tomcat part runs without problem. But I just can't make the cluster part run successfully. First, I got No such device error. So I insert mcastBindAddress=192.168.5.223 in tomcat1 and mcastBindAddress=192.168.5.224 in tomcat2, the problem is solved. But I got another problem, inside the log, there is a line said, INFO: Manager [/jspSession]: skipping state transfer. No members active in cluster group. I have search the internet, people say it should be the problem of multicast. So I use the javagroup's McastReceiverTest/McastSenderTest to test multicast, it works (some people use tomcat-replication.jar, but I can't find it on the internet now). Then I wonder if tomcat clusters are not sending the correct message, I use tcpdump to capture the message. I can see that tcp://192.168.5.223:4001 tcp://192.168.5.224:4001 in the capture log. Then I think it may be a tomcat version problem. So I upgrade tomcat to 5.5.20, and then upgrade jre to 1.5.0_09, but still no lucks. Now I really need the help from you. Below the tomcat config and my PCs network config. ( just don't want this mail become too large, I just post the tomcat2 config. I've double check the config, the only different is the ip address). !-- -- Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastBindAddress=192.168.5.224 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=192.168.5.224 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 waitForAck=true/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.* \.html;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListener / /Cluster !-- -- Script started on Wed 25 Oct 2006 11:52:21 AM CST [EMAIL PROTECTED] conf]# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:7B:43:3A inet addr:10.0.0.11 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:25 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3871 (3.7 Kb) TX bytes:168 (168.0 b) Interrupt:10 Base address:0x1400 eth1 Link encap:Ethernet HWaddr 00:0C:29:7B:43:44 inet addr:192.168.5.224 Bcast:192.168.5.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1584 errors:0 dropped:0 overruns:0 frame:0 TX packets:1563 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:156767 (153.0 Kb) TX bytes:152906 (149.3 Kb) Interrupt:9 Base address:0x1480 loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:20 errors:0 dropped:0 overruns:0 frame:0 TX packets:20 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1356 (1.3 Kb) TX bytes:1356
Re: Tomcat Cluster problem. skipping state transfer. No members active in cluster group
Test without mcastBindAddress again! Peter Am 26.10.2006 um 09:54 schrieb hotszkin: Thanks for your reply. I have added the multcast route to the routing table with the following command route add -host 228.0.0.4 dev -eth1 and restart tomcat on both PCs. Tomcat still can't discover each others. Here is the routing tables Script started on Thu 26 Oct 2006 03:42:40 PM CST [EMAIL PROTECTED] bin]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 228.0.0.4 * 255.255.255.255 UH0 00 eth1 192.168.5.0 * 255.255.255.0 U 0 00 eth1 10.0.0.0* 255.255.255.0 U 0 00 eth0 169.254.0.0 * 255.255.0.0 U 0 00 eth1 127.0.0.0 * 255.0.0.0 U 0 00 lo [EMAIL PROTECTED] bin]# exit Script done on Thu 26 Oct 2006 03:42:43 PM CST Any suggestion? HoTszKin - Original Message - From: Peter Rossbach [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, October 26, 2006 2:00 PM Subject: Re: Tomcat Cluster problem. skipping state transfer. No members active in cluster group I think you have a network routing problem. Read the cluster help: http://tomcat.apache.org/faq/cluster.html Regards Peter Am 25.10.2006 um 06:20 schrieb hotszkin: I am trying to setup a tomcat cluster as told in the tomcat cluster document. There are 3 PCs in my environment. All of them are running RHEL AS 3. apache (2.0.26) /w mod_jk (1.2.19) ip: 10.0.0.20 | ___ | || ip:10.0.0.10 10.0.0.11 tomcat1tomcat2 (version 5.5.17 with jre 1.5.0_08) ip:192.168.5.223 192.168.5.224 The 10.0.0.0/24 is the subnet for apache and tomcat, and 192.168.5.0/24 is the subnet for tomcat session replication/cluster. The apache and tomcat part runs without problem. But I just can't make the cluster part run successfully. First, I got No such device error. So I insert mcastBindAddress=192.168.5.223 in tomcat1 and mcastBindAddress=192.168.5.224 in tomcat2, the problem is solved. But I got another problem, inside the log, there is a line said, INFO: Manager [/jspSession]: skipping state transfer. No members active in cluster group. I have search the internet, people say it should be the problem of multicast. So I use the javagroup's McastReceiverTest/McastSenderTest to test multicast, it works (some people use tomcat-replication.jar, but I can't find it on the internet now). Then I wonder if tomcat clusters are not sending the correct message, I use tcpdump to capture the message. I can see that tcp://192.168.5.223:4001 tcp://192.168.5.224:4001 in the capture log. Then I think it may be a tomcat version problem. So I upgrade tomcat to 5.5.20, and then upgrade jre to 1.5.0_09, but still no lucks. Now I really need the help from you. Below the tomcat config and my PCs network config. ( just don't want this mail become too large, I just post the tomcat2 config. I've double check the config, the only different is the ip address). !-- -- Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastBindAddress=192.168.5.224 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=192.168.5.224 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 waitForAck=true/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.* \.html;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListene r / /Cluster !-- -- Script started on Wed 25 Oct 2006 11:52:21 AM CST [EMAIL PROTECTED] conf]# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:7B:43:3A inet addr
Re: moving the context xml from $CATALINA_BASE/conf/
Hi, you can confgure defaults at $CATALINA_BASE/conf/context.xml or $CATALINA_BASE/conf/Catalina/localhost/context.xml.default. Please read http://tomcat.apache.org/tomcat-5.5-doc/config/context.html Regards Peter Am 19.10.2006 um 00:16 schrieb Molina, Teresa: Does anyone know how to specify a location for the default context.xml file outside of $CATALINA_BASE/conf? I have looked through the Tomcat source code and found a reference to the constant for the default file name itself, conf/context.xml, as well as getters and setters that seem to over-ride this location and name (in ./container/catalina/src/share/org/apache/catalina/startup/ ContextConfig .java and ./container/catalina/src/share/org/apache/catalina/core/ StandardContext. java). However, after a (manual) step-through of the code, I cannot find where any Tomcat class is calling setDefaultContextXml. Also, after grepping every file within the source, I can find no reference to the method outside the classes that define it. (Even if the classes are called on reflection, some literal would have to contain a string of the set method name itself.) Because this alternative configuration need does not seem to be common, I cannot find any reference to moving the context xml file anywhere but the code itself. Obviously, any help would be appreciated. Background Information (Why I want to do this.) -- The gist of the matter is that I am in the process of upgrading our installation of Tomcat from 4.4 to 5.5. In our 4.x implementation, we had configured a default context to define the jdbc connections commonly used by our multiple webapps (we are running more than a dozen webapps under one Tomcat JVM, basically all using the same DB connection resources). Previously, the context element (defaultContext) was contained within the server.xml itself, and we were able to place that xml file in multiple paths on our system, using the -config {path} option when calling startup.sh. Because we run our webapps in a variety of environments (a development environment, QC, stage and prod) -- each with its own database -- with Tomcat 4.x, we are currently able to use multiple versions of the server.xml, wherein the values defined for the connection parameter correspond to its environment's database. (Basically, we have defined a conf directory for each of our environments, like, conf_dev and conf_qa in which we currently store server.xml; using cvs, we have deployed the directory by checking it out as conf, allowing us to retrieve the server.xml with the relevant URL and password.) However, I cannot find a similar solution now that context.xml takes the place of the defaultcontext within server xml. Obviously, you are able to define $CATALINA_BASE on startup, which ultimately would allow us to have multiple locations for conf/context.xml, but we do not need to also keep multiple copies of all the files under conf, logs, work, etc. Putting the resources in context.xml under $CATALINA_BASE/conf is the only successful way I have been able to retrieve JNDI resources properly. Thank you sincerely for your help, Teresa
Re: Using a custom connector in Tomcat 5.5
HI Mladen, good way! But sometimes the changes are inside the Adapter Class and then you must change the connector class. +1 to have the attribute className back Peter Am 17.10.2006 um 09:36 schrieb Mladen Turk: Jacob Marcus wrote: Hi, The examples no longer show the className attribute for the Connector element in the server.xml. Is this not supported any more? In the past, I have done used my own connector as shown in the example below. Connector port=8080 maxHttpHeaderSize=8192 className= com.hello.MyConnector maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / I could not find the relevant documentation on this possible change. I will appreciate any pointers. Use the protocol=com.hello.MyConnector instead className, or you can use protocolHandlerClassName. Regards, Mladen. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AXIS: tomcat always do http compression without watch min size
Which mime type send axis as responce? Peter Am 05.10.2006 um 09:46 schrieb wakeup: Hi, I have an apache tomcat 5.5.17. In my server.xml file I have put Connector port=8080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true compression=on *compressionMinSize=2048000 * noCompressionUserAgents=gozilla, traviata compressableMimeType=text/html,text/xml,text/plain,application/dime / It run sucessfull with normal html tomcat pages. But when I ask to axis 1.4 webservices it always compress the response althought it be less than 1kb. Why axis don't respect compressionMinSize parameter? Thanks -- View this message in context: http://www.nabble.com/AXIS%3A-tomcat- always-do-http-compression-without-watch-min-size- tf2386947.html#a6654078 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help with session replication using PersistentManager and FileStore
Simple, Don't use it! Use real In Memory- session replication and Non-Stickyness is not support and usefull at java web application. Please, read the servlet spec. Peter Am 03.10.2006 um 22:46 schrieb Matthew Kennedy: We have a load balancer and several Tomcat instances. Currently this cluster uses sticky sessions, ie. the load balancer routes the request to the Tomcat instance holding the session which belongs to the request. The goal is to change our configuration so that all sessions are persisted to a shared network filesystem, thus allowing non-sticky sessions -- ie. any tomcat instance can handle a request. The Overview section of the Tomcat 5.5 Clustering/Session Replication HOW-TO (http://tomcat.apache.org/tomcat-5.5-doc/cluster- howto.html) suggests that this configuration is possible: 1. Using session persistence, and saving the session to a shared file system (PersistenceManager + FileStore). I've tried the following Manager config: Manager className=org.apache.catalina.session.PersistentManager maxActiveSessions=-1 maxIdleBackup=0 maxIdleSwap=0 minIdleSwap=0 Store className=org.apache.catalina.session.FileStore directory=sessions/ /Manager maxIdleBackup=0 because we want the session to become instantly eligible for persisting to the store, maxIdleSwap=0 to have it persisted right after last access, minIdleSwap=0 (similarly). With this configuration, the session is still not persisted immediately, instead it seems to occur a minute or so later. If a new request for the same session is routed by the load balancer to another Tomcat, and the original Tomcat still hasn't persisted it to the filesystem, then the new request will get an old copy of the session or none at all. Have I misunderstood something here? Matt - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 Clustering Problem
Strange! mcastClusterDomain is set a McastService constructor public McastService() { properties.setProperty(mcastClusterDomain, catalina); } Please don't use a real loadbalancer like apache with mod_jk instead the crazy redirect thing at http://www.onjava.com/pub/a/onjava/2004/04/14/clustering.html) Which version of tomcat 5.5 you use? Please, use Tomcat 5.5.17 or better coming 5.5.20. regards, peter I'm trying to perform a simple cluster setup with Tomcat 5.5 and been running into some problems. Here's the link to the tutorial that I'm trying to follow: http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html. Below is an excerpt of the stack trace, I'm using the balancer application from tomcat. 2006-09-25 22:11:43,718 (WebPortalLogger.java:44) - 923014548 : 1 2006-09-25 22:11:43,718 (WebPortalLogger.java :44) - Requested server instance did not match.. 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getServerInstance () : 1 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getMaxServerInstances() : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - 1876138717 : 2 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - Requested server instance did not match.. 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getServerInstance () : 2 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getMaxServerInstances() : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - 747657098 : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - Requested server instance did not match.. 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getServerInstance () : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - getMaxServerInstances() : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - 388758323 : 3 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - Requested server instance match.. java.lang.IllegalArgumentException: Required property mcastClusterDomain is missing. at org.apache.catalina.cluster.mcast.McastService.hasProperty ( McastService.java:252) at org.apache.catalina.cluster.mcast.McastService.setProperties( McastService.java:140) at common.utilities.ServerUtil.isServerAlive(ServerUtil.java:36) at org.apache.webapp.balancer.rules.BaseLoadBalancingRule.isServerAlive ( BaseLoadBalancingRule.java:89) at org.apache.webapp.balancer.rules.RandomRedirectRule.matches( RandomRedirectRule.java:41) at org.apache.webapp.balancer.RuleChain.evaluate (RuleChain.java:100) at org.apache.webapp.balancer.BalancerFilter.doFilter( BalancerFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter ( ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java :178) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126) at org.apache.catalina.cluster.session.JvmRouteBinderValve.invoke( JvmRouteBinderValve.java:208) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke ( ReplicationValve.java:346) at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process( Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol $Http11ConnectionHandler.processConnection( Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java :80) at org.apache.tomcat.util.threads.ThreadPool $ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - Time taken to check connection: 0 ms. ** THE SERVER IS NOT AVAILABLE ** 2006-09-25 22:11:43,734 (WebPortalLogger.java:44) - RandomRedirectRule -- isAlive : false Below is my server.xml configuration for Tomcat 5.5: (only the receiver.tcpListenPort was modified for the other instances.) Server port=8011 shutdown=SHUTDOWN GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory= org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service
Re: Client Real Source IP!
You can access the header with ServletRequest.getHeader, getHeaders, getHeadersNames. Read Servlet Spec 2.4 or 2.5 Headers 4.3 Wrote your own Valve or ServletFilter Regards Peter Am 22.09.2006 um 06:44 schrieb Alexander Khoo: Dear All, We currently have Tomcat Version5 install behind Pound reverse proxy! Our code cant identify the real source client IP instead the reverse proxy IP everytime, We understand Pound adds the X- Forwarded-for header with the original client address to every requestbut how we can identify it? Please Help! Alexander Khoo
Re: Reminder: Preparation for mod_jk release vote
mod_jk 1.2.19 +1 works with MAC OSX :-) Regards Peter Am 20.09.2006 um 14:17 schrieb Rainer Jung: Hi, I shortly want to remind everyone, that our release vote for mod_jk 1.2.19 will start tomorrow. So all users still have some time to give us positive or negative feedback on the release candidate. Until now, no issues have been found. You can find 1.2.19 under: http://tomcat.apache.org/dev/dist/tomcat-connectors/jk/ Thanks for participation Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to trim Catalina.out ?
Use rotatelogs from apache or cronlog at catalina.sh|bat Regards Peter Am 19.09.2006 um 10:01 schrieb [EMAIL PROTECTED]: Hi, I have my application running on tomcat for quite a long time. I discovered a large amount of space taken up by the tomcat logs like catalina.out. Is there any way to trim catalina.out..? I am quite new to this and was not able to go further on how to trim. Please let me know if you have any ideas on this. Thanks in advance. Regards, Shashi The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat jmx agent question
Hi, please read the docs http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html Regards Peter Am 14.09.2006 um 11:23 schrieb Michele Mazzucco: Hi all, which kind of JMX connector does tomcat uses, rmi? If it is rmi, which port is it used? In which class is the JMX agent started? Thanks, Michele - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat jmx agent question
Hi, Am 14.09.2006 um 16:25 schrieb Michele Mazzucco: Thanks Peter. Peter Rossbach wrote: Hi, I don't know about this experiment, but it seems not finished. Please, use sun jdk command line args to start your jmx adapter. I though tomcat used mx4j. Only with JDK 1.4. See JDK 1.4 Compatability package at tomcat 5.5 donwload page. One of the strange things of the current Java 5 JVM is: You can only set the naming port and not the real communication port :-( This is obviously bad for people that use a firewall. http://java.sun.com/j2se/1.5.0/docs/guide/management/ agent.html#properties With JMX API you can set the communication port and socket address. Peter Michele Am 14.09.2006 um 12:41 schrieb Michele Mazzucco: Hi Peter, thanks. But what about out of the box configuration?, the org.apache.tomcat.servlets.jmxremote.JmxRemoteServlet creates a rmi registry on port 1099 and a jmx service url at service:jmx:rmi://rmiHost/jndi/rmi://localhost:1099/jndiPath. So the question is, is rmi the default jmx protocol? Thanks, Michele Peter Rossbach wrote: Hi, please read the docs http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html Regards Peter Am 14.09.2006 um 11:23 schrieb Michele Mazzucco: Hi all, which kind of JMX connector does tomcat uses, rmi? If it is rmi, which port is it used? In which class is the JMX agent started? Thanks, Michele -- --- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in configuring tomcat and apache
Use ${catalina.base} instead. Peter Am 14.09.2006 um 16:06 schrieb jbashir: I am configuring tomcat and apache through mod_jk on Linux. In the server.xml file in /TOMCAT_HOME/conf, I have added this line: Listener className=org.apache.jk.config.ApacheConfig modJk=/TOMCAT_HOME/mod_jk/mod_jk.so / And when I restart the tomcat, I get this error: Caused by: java.lang.RuntimeException: Unable to create path to config file : /usr/local/tomcat/apache-tomcat-5.5.15/conf/auto/mod_jk.conf What this error is and how it will be removed. Any suggestion? -- View this message in context: http://www.nabble.com/Problem-in- configuring-tomcat-and-apache-tf2271859.html#a6306662 Sent from the Tomcat - User forum at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat jmx agent question
HI Michele, please, read the sun jmx docs. The default jmx server from java 5 starts a rmi registry and starts a jmx server socket. Currently the jmx server socket port change with every start from your jvm. You can't control the port or binding an ip address from command line. Please, read the details at jmx api javadocs (javax.management.remote). Peter Am 14.09.2006 um 18:23 schrieb Michele Mazzucco: I'm sorry Peter, but you didn't reply to my questions ;): with the out of the box configuration, what happens if I want to connect this way: JMXServiceURL url = new JMXServiceURL( service:jmx:rmi:///jndi/rmi://localhost:/server); JMXConnector jmxc = JMXConnectorFactory.connect(url, null); what should I punt instead of service:jmx? Does tomcat run a rmi registry somewhere? If not, why can I access the MBeans exposed by tomcat, even from remote nodes (from the admin console)?, should I start a rmiregistry in my web application? If yes, which port is it used? Thanks, Michele Peter Rossbach wrote: Hi, Am 14.09.2006 um 16:25 schrieb Michele Mazzucco: Thanks Peter. Peter Rossbach wrote: Hi, I don't know about this experiment, but it seems not finished. Please, use sun jdk command line args to start your jmx adapter. I though tomcat used mx4j. Only with JDK 1.4. See JDK 1.4 Compatability package at tomcat 5.5 donwload page. One of the strange things of the current Java 5 JVM is: You can only set the naming port and not the real communication port :-( This is obviously bad for people that use a firewall. http://java.sun.com/j2se/1.5.0/docs/guide/management/ agent.html#properties With JMX API you can set the communication port and socket address. Peter Michele Am 14.09.2006 um 12:41 schrieb Michele Mazzucco: Hi Peter, thanks. But what about out of the box configuration?, the org.apache.tomcat.servlets.jmxremote.JmxRemoteServlet creates a rmi registry on port 1099 and a jmx service url at service:jmx:rmi://rmiHost/jndi/rmi://localhost:1099/jndiPath. So the question is, is rmi the default jmx protocol? Thanks, Michele Peter Rossbach wrote: Hi, please read the docs http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html Regards Peter Am 14.09.2006 um 11:23 schrieb Michele Mazzucco: Hi all, which kind of JMX connector does tomcat uses, rmi? If it is rmi, which port is it used? In which class is the JMX agent started? Thanks, Michele - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- --- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 5.5.17 cluster doesn't sync sessions on startup
Hi Ronald, 5000 small sessions are really sync very fast with tomcat 5.5.17 also. I have test this and it works. Tomorrow I have more time to simulate your case. regards peter Am 07.09.2006 um 20:33 schrieb Ronald Klop: Thanks for your anser. I'm going to look into this. I have some thoughts about this. Tomcat 5.0 synced in 0.3-3 seconds for the same amount of sessions. Our (about 3000-5000) sessions contain only one String 'userid' of max length 10, so that is 10 bytes of utf-16. Not very much. With class/object overhead I think 200KB over Gigabit ethernet. So more than 60 seconds in Tomcat 5.5.17 seems a bit weird. Of course this happens only in production where downtime or lost sessions is not appreciated. :-) Why the node is restart or started? Are you sure you don't have a network problem? The message overload meants that GET_ALL_SESSION message is received very sort after timeout. Sep 5, 2006 9:42:14 AM org.apache.catalina.cluster.session.DeltaManager waitForSendAllSessions SEVERE: Manager [localhost]: No session state send at 9/5/06 9:41 AM received, timing out after 60,033 ms. Sep 5, 2006 9:42:16 AM org.apache.catalina.cluster.session.DeltaManager deserializeSessions WARNING: overload existing session 5D8486234FCD60EF7A59CBAED66E20EA It would be nice if Tomcat showed more information why the sync failed, but maybe it's hard to do that. Or maybe display how many sessions were synced before the timeout occurs. Which information you want see? Look at docs and search for clusterlog, Set trace loglevel for the cluster classes. Ronald. On Thu Sep 07 17:03:28 CEST 2006 Tomcat Users List users@tomcat.apache.org wrote: ok, in that case, there could so much session data that it takes longer than 60 seconds to retrive. you have two options 1. increase the transfer timeout 2. transfer data in chunks Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster manager.className=org.apache.catalina.cluster.session.DeltaManager manager.stateTransferTimeout=120 manager.sendAllSessions=false manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 I believe this is documented on the website Filip Ronald Klop wrote: No, one node is restarting, while the other three keep running. Ronald. On Wed Sep 06 19:18:14 CEST 2006 Tomcat Users List users@tomcat.apache.org wrote: are the nodes starting up simultanously, there is the risk of syncing not working if two nodes are starting at the same time as the cluster starts before the actual webapps are deployed. Filip Ronald Klop wrote: Hello, We are running a 4-node cluster of 5.5.17. Sometimes java or tomcat crashes and we restart it automaticly. With 5.0.x this was ok, but with 5.5.x it doesn't sync session on startup often. When this happened on 5.0.x I got an ClassCastException, which explained why syncing failed. But on 5.5.17 I just get a timeout of 60 seconds. This is the start of the catalina.out. Sep 5, 2006 9:41:04 AM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Sep 5, 2006 9:41:04 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1399 ms Sep 5, 2006 9:41:04 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Sep 5, 2006 9:41:04 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.17 Sep 5, 2006 9:41:04 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster start INFO: Cluster is about to start Sep 5, 2006 9:41:04 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster createDefaultClusterValves INFO: Add Default ClusterValves at cluster Catalina Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster createDefaultClusterListener INFO: Add Default ClusterListener at cluster Catalina Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster createDefaultClusterReceiver INFO: Add Default ClusterReceiver at cluster Catalina Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster createDefaultClusterSender INFO: Add Default ClusterSender at cluster Catalina Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.SocketReplicationListener createServerSocket INFO: Open Socket at [10.0.10.55:8015] Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.ReplicationTransmitter start INFO: Start ClusterSender at cluster Catalina:type=Cluster with name Catalina:type=ClusterSender Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster createDefaultMembershipService INFO: Add Default Membership Service at cluster Catalina Sep 5, 2006 9:41:05 AM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 4000 milliseconds to establish cluster membership Sep 5, 2006 9:41:05 AM
Re: mod_jk log level and logging issues
Hi Rainer, really good idea to fix the worker logging ++1... === Peter Rainer Jung schrieb: Hi, thanks for the feedback. Good info! fredk2 schrieb: issue 1: With mod_jk 1.2.15 i set my jk log level: JkLogFile logs/mod_jk.log #JkLogLevel info JkRequestLogFormat %w %V %U %s %T %B %H %m While switching to 1.2.18 I read in the fine manual that the default log level is info so I removed the directive, and.oh my ! the default is now debug :-) Gr. You are right. A quick inspection of our code shows, that in fact: if the JkLogLevel directive is being used and it can not map the value to a log level, it will use info. If one does not use any JkLogLevel, then the code really looks like we fall through to debug. Bad. I'll double check and correct defaults to INFO. issue 2: When Tomcat is down I get the following mod_jk.log error mesg and JkRequestLog entry: . . . [Tue Aug 08 14:34:33 2006] [23653:] [error] ajp_service::jk_ajp_common.c (1794): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=myWorker failed [Tue Aug 08 14:34:33 2006] myWorker myserver.mydom.com /myapp/jsp/hello 200 0.000378 0 HTTP/1.1 GET . . . Again you are right. We log the request before we change the status code. Not good. I'll try to improve this. The JkRequestLog entry shows a http status 200 whereas the browser (apache httpd) reports properly 503. Also any url that would normally show a status of 404 show 200 when tomcat is down. Why do you expect a 404 in case Tomcat is down? If the request matches mod_jk JkMount config, it should try to send to tomcat and the result would be some 50X? This is a bit unexpected but it appears that 1.2.15 is doing the same. Hence a broken tomcat can actually make a log stat look very good :) Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mbean uses in Tomcat 5.5.17
see http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html peter Am 31.07.2006 um 07:27 schrieb Raju Balugu: Hi All , Could you please let me know the uses of Mbean in Tomcat 5.5.17? We recently upgraded to tomcat5.5.17 from Tomcat 4.1.29. Regards Raju
Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4
Use more JVM Options to analyse the mem usage Work with more faster mem allocation -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=8 -Xverbosegc Or better use a Memory Profiler... But the membership not allocate much memory, very strange effect :-( Peter Am 18.06.2006 um 08:01 schrieb Dilan Kelanibandara: Hi Peter, I am using default JVM parameters coming with tomcat5.5.17. In the tomcat server.xml file it says tcpThreadCount is normally equal to no.of nodes (ie 2 in this case).That is why I changed that to 2. I tried increasing JVM parameters for heap size in tomcat Min=1024m Max=1024m also.I tried with both 512m also. But in both the occasion it is the same result. Thank you for your kind attention. I want further clarifications. Best regards, Dilan -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Sunday, June 18, 2006 7:37 AM To: Tomcat Users List Subject: Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4 Hi, Which JVM memory parameter you use? At pooled mode use more receiver worker set tcpThreadCount=6! You really need deployer? Deployer generate at every startup a large cluster message. Regards Peter Am 18.06.2006 um 06:22 schrieb Dilan Kelanibandara: Hello , I am getting OutOfMemoryError continuously when starting up two cluster nodes of tomcat5.5.17 (jdk1.5 on Advanced server 4). Any way it was working fine for 3 weeks time. This error occurs previously only one time and when restarted the tomcat, it worked. Following is a part of catalina.out relevent to that error for node 1. INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost with name Catalina:type=ClusterSender,host=localhost Jun 17, 2006 8:44:15 PM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 milliseconds to establish cluster membership Exception in thread Cluster-MembershipReceiver java.lang.OutOfMemoryError: Java heap space Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.mcast.McastService registerMBean INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Register manager /StockTradingServer to cluster element Host with name localhost Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Starting clustering manager at /StockTradingServer Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions INFO: Manager [/StockTradingServer]: skipping state transfer. No members active in cluster group. = = == = node2 startup log is as follows = = == = INFO: Cluster is about to start Jun 17, 2006 8:53:00 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter start INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost with name Catalina:type=ClusterSender,host=localhost Jun 17, 2006 8:53:00 PM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 milliseconds to establish cluster membership Exception in thread Cluster-MembershipReceiver java.lang.OutOfMemoryError: Java heap space Jun 17, 2006 8:53:02 PM org.apache.catalina.cluster.mcast.McastService registerMBean INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 17, 2006 8:53:02 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Jun 17, 2006 8:53:04 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Register manager /StockTradingServer to cluster element Host with name localhost Jun 17, 2006 8:53:04 PM org.apache.catalina.cluster.session.DeltaManager start = = == = Any way my clustor was working fine for 3 weeks time and started to give this error in startup of both the nodes. I have an IBMHTTPServer with jk connector for load balancing and that load is comming my tomcat cluster. following is the server.xml file for both the servers. = = == = !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may
Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4
HI, I see no risk with the default membership config. Peter Am 18.06.2006 um 19:29 schrieb Dilan Kelanibandara: Hi Peter, No. No service is up and running on 4564. I did only commenting the member and restarted both the servers. So far it is working fine. I have a doubt in future weather there is any effect on my server? Can you please explain me the risk. Or is it ok to run the server with this configuration?. Thanks and best regards, Dilan -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Sunday, June 18, 2006 8:14 PM To: Tomcat Users List Subject: Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4 OK! As you comment the Membership service out, following default is used: McastService mService= new McastService(); mService.setMcastAddr(228.0.0.4); mService.setMcastPort(8012); mService.setMcastFrequency(1000); mService.setMcastDropTime(3); transferProperty(service,mService); setMembershipService(mService); } Have you start another service at 45564 ? Regards Am 18.06.2006 um 16:54 schrieb Dilan Kelanibandara: Hi Peter, I was having the memory problem when cluster manager trying to multicast the request when tomcat startup. As a trial I commented multicast element of cluster configuration in server.xml and restarted both tomcats This is the multicast element which I commented. == !-- Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ -- == Then tomcat started without an outofmemoryerror. Also replication members are added to each other. I ran both of servers with my applicaiton for some time. It is working fine. Session replication is happening as usual. Can you let me know can I proceed with this setup or is there any effect of my commenting on session replication ? Can you kindly let me know? Thanks and best regards, Dilan -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Sunday, June 18, 2006 9:50 AM To: Tomcat Users List Subject: Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4 Use more JVM Options to analyse the mem usage Work with more faster mem allocation -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=8 -Xverbosegc Or better use a Memory Profiler... But the membership not allocate much memory, very strange effect :-( Peter Am 18.06.2006 um 08:01 schrieb Dilan Kelanibandara: Hi Peter, I am using default JVM parameters coming with tomcat5.5.17. In the tomcat server.xml file it says tcpThreadCount is normally equal to no.of nodes (ie 2 in this case).That is why I changed that to 2. I tried increasing JVM parameters for heap size in tomcat Min=1024m Max=1024m also.I tried with both 512m also. But in both the occasion it is the same result. Thank you for your kind attention. I want further clarifications. Best regards, Dilan -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Sunday, June 18, 2006 7:37 AM To: Tomcat Users List Subject: Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4 Hi, Which JVM memory parameter you use? At pooled mode use more receiver worker set tcpThreadCount=6! You really need deployer? Deployer generate at every startup a large cluster message. Regards Peter Am 18.06.2006 um 06:22 schrieb Dilan Kelanibandara: Hello , I am getting OutOfMemoryError continuously when starting up two cluster nodes of tomcat5.5.17 (jdk1.5 on Advanced server 4). Any way it was working fine for 3 weeks time. This error occurs previously only one time and when restarted the tomcat, it worked. Following is a part of catalina.out relevent to that error for node 1. INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost with name Catalina:type=ClusterSender,host=localhost Jun 17, 2006 8:44:15 PM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 milliseconds to establish cluster membership Exception in thread Cluster-MembershipReceiver java.lang.OutOfMemoryError: Java heap space Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.mcast.McastService registerMBean INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Register manager /StockTradingServer to cluster element Host with name localhost Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO
Re: tomcat5.5.17 cluster(using jdk1.5) error - OutOfMemoryError in starting up on AS4
Hi, Which JVM memory parameter you use? At pooled mode use more receiver worker set tcpThreadCount=6! You really need deployer? Deployer generate at every startup a large cluster message. Regards Peter Am 18.06.2006 um 06:22 schrieb Dilan Kelanibandara: Hello , I am getting OutOfMemoryError continuously when starting up two cluster nodes of tomcat5.5.17 (jdk1.5 on Advanced server 4). Any way it was working fine for 3 weeks time. This error occurs previously only one time and when restarted the tomcat, it worked. Following is a part of catalina.out relevent to that error for node 1. INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost with name Catalina:type=ClusterSender,host=localhost Jun 17, 2006 8:44:15 PM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 milliseconds to establish cluster membership Exception in thread Cluster-MembershipReceiver java.lang.OutOfMemoryError: Java heap space Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.mcast.McastService registerMBean INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 17, 2006 8:44:17 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Register manager /StockTradingServer to cluster element Host with name localhost Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Starting clustering manager at /StockTradingServer Jun 17, 2006 8:44:19 PM org.apache.catalina.cluster.session.DeltaManager getAllClusterSessions INFO: Manager [/StockTradingServer]: skipping state transfer. No members active in cluster group. == == = node2 startup log is as follows == == = INFO: Cluster is about to start Jun 17, 2006 8:53:00 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter start INFO: Start ClusterSender at cluster Catalina:type=Cluster,host=localhost with name Catalina:type=ClusterSender,host=localhost Jun 17, 2006 8:53:00 PM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 milliseconds to establish cluster membership Exception in thread Cluster-MembershipReceiver java.lang.OutOfMemoryError: Java heap space Jun 17, 2006 8:53:02 PM org.apache.catalina.cluster.mcast.McastService registerMBean INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 17, 2006 8:53:02 PM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Jun 17, 2006 8:53:04 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Register manager /StockTradingServer to cluster element Host with name localhost Jun 17, 2006 8:53:04 PM org.apache.catalina.cluster.session.DeltaManager start == == = Any way my clustor was working fine for 3 weeks time and started to give this error in startup of both the nodes. I have an IBMHTTPServer with jk connector for load balancing and that load is comming my tomcat cluster. following is the server.xml file for both the servers. == == = !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- Server port=8005 shutdown=SHUTDOWN !-- Comment these entries out to disable JMX MBeans support used for the administration web application -- Listener className=org.apache.catalina.core.AprLifecycleListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Listener className=org.apache.catalina.storeconfig.StoreConfigLifecycleListene r/ !-- Global JNDI resources -- GlobalNamingResources !-- Test entry for demonstration purposes -- Environment name=simpleValue type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be
Re: Query Regarding Clustering
Hi, please use 5.5.17 and read the tomcat 5.5 cluster docs. Sorry, but tutorials and real design docs not exists. Regards Peter Am 02.06.2006 um 07:54 schrieb Sandeep Gaikwad: Hi All, I am trying to devlop Horizontal clustering for tomcat 5.5.9. I am new to this field so if anyone have any links for this please reply back to me. Regards, Sandepp CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Query Regarding Clustering
What is your problem? Your nodes can find the others? Check your network allow Mutlicast and TCP traffic Regards Peter Am 02.06.2006 um 08:22 schrieb Sandeep Gaikwad: I had done through vertical clustering on Single Machine. Can you suggest me changes required for horizontal clustering across Two machine? -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Friday, June 02, 2006 11:41 AM To: Tomcat Users List Subject: Re: Query Regarding Clustering Hi, please use 5.5.17 and read the tomcat 5.5 cluster docs. Sorry, but tutorials and real design docs not exists. Regards Peter Am 02.06.2006 um 07:54 schrieb Sandeep Gaikwad: Hi All, I am trying to devlop Horizontal clustering for tomcat 5.5.9. I am new to this field so if anyone have any links for this please reply back to me. Regards, Sandepp CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassCastException on cluster deserialization
Hmm, you are right... I see that we only set context classloader at DeltaManager.loadDeltaRequest at deserialize information Loader loader = null; ClassLoader classLoader = null; //fix to be able to run the DeltaManager //stand alone without a container. //use the Threads context class loader if (container != null) loader = container.getLoader(); if (loader != null) classLoader = loader.getClassLoader(); else classLoader = Thread.currentThread ().getContextClassLoader(); //end fix fis = new ByteArrayInputStream(data); ois = new ReplicationStream(fis, classLoader); but we not set thread context class loader for listeners :-( see. DeltaManager.handle_SESSION_XXX Peter Am 21.05.2006 um 13:58 schrieb Filip Hanik - Dev Lists: what does line ClusterAppSessionListener.java:47 do? can you send us a test case, could be possible that the context classloader isn't set, hence the loading is failing. java.lang.ClassCastException: com.package1.subpackage1.GW at common.listeners.ClusterAppSessionListener.printSessionInfo (ClusterAppSessionListener.java:47) at common.listeners.ClusterAppSessionListener.attributeAdded (ClusterAppSessionListener.java:26) at org.apache.catalina.cluster.session.DeltaSession.setAttribute (DeltaSession.java:1310) Filip Jean-Christophe Praud wrote: No. This a specific class for my webapp. It is located in the webapp's /classes tree, and is instantiated only once per session. Tim Lucia wrote: Are there multiple copies of this class in scope (loaded by different class loaders)? I know if you have some Oracle classes in WEB-INF/lib AND in common/lib, you can get a CCE casting from a oracle.X to an oracle.X as they come from different class loaders. Tim -Original Message- From: Jean-Christophe Praud [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 11:02 AM To: users@tomcat.apache.org Subject: ClassCastException on cluster deserialization Hi all, I'm setting up a Tomcat cluster on two servers, and I keep getting a ClassCastException on a session variable (GW). The server which handles the request works well, but the other one can't get the session data. Its GW object seems to be instantiated, valueBound (HttpSessionBindingEvent event) is called, the object is added to the session, then I get the Exception. I tried with Tomcat 5.5.16 and 5.5.17, with several Sender replicationMode. My session variable com.package1.subpackage1.GW implements the Serializable interface and contains some classes which are also Serializable. I don't see any Exception from the writeObject or readObject methods on any server. My config : Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=synchronous autoConnect=true keepAliveTimeout=-1 ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.* \.htm;.*\.html;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className=org.apache.catalina.cluster.session.ClusterSessionListene r/ /Cluster The Exception's log : 18 mai 2006 16:48:28 org.apache.catalina.cluster.session.DeltaSession setAttribute GRAVE: Session attribute event listener threw exception java.lang.ClassCastException: com.package1.subpackage1.GW at common.listeners.ClusterAppSessionListener.printSessionInfo (ClusterAppSessio nListener.java:47) at common.listeners.ClusterAppSessionListener.attributeAdded (ClusterAppSessionL istener.java:26) at org.apache.catalina.cluster.session.DeltaSession.setAttribute (DeltaSession.j ava:1310) at
Re: Using Tomcat as a reverse proxy
Look here: PippoProxy http://www.javaworld.com/javaworld/jw-02-2005/jw-0228-pippo_p.html Last year at google summer camp http://j2ep.sourceforge.net/ But Apache mod_proxy has very much good perfomance and configure options :-) Regards Peter Am 03.05.2006 um 17:08 schrieb Andrew Miehs: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear List, I have an application where I need to use tomcat as a reverse proxy for certain URLs. Yes - I know normally it is the other way around, but not in this case. Is there a reverse proxy solution already out there for tomcat? or do I need to implement it myself. Thanks for any information, Regards Andrew -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEWMdhW126qUNSzvURArvNAJ90h/oSx49rACCR++vFXGTn3CtmqQCfQ3VO np0UJk4by7kDUHu7bsLPE6Q= =ffpd -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: name-based virtual hosts with Tomcat and APR using SSL
Can you give some hints that normaly works for OpenSSL? Peter Am 29.04.2006 um 17:04 schrieb Marc-Olaf Jaschke: Hi, I try to to use Tomcat with APR and name-based virtual hosts using SSL. I've read the documentation for Tomcat/APR and searched the web, but cannot find anything about multiple certificate- or key-files. Is there any possibility to use multiple SSL-Certificates with APR? Thanks for your attention, Marc-Olaf Jaschke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: name-based virtual hosts with Tomcat and APR using SSL
No, can you tell us how openssl make it possible to have more the one certificate? Currently you must configure of every host ip address and certifcate you own connector at separate service elements. Peter Am 29.04.2006 um 19:37 schrieb Marc-Olaf Jaschke: I have got SSL with Tomcat and APR running for one domain with the following example from the tomcat documentation: Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true SSLEngine=on SSLCertificateFile=${catalina.base}/conf/localhost.crt SSLCertificateKeyFile=${catalina.base}/conf/ localhost.key / ... (http://tomcat.apache.org/tomcat-5.5-doc/apr.html) I use tomcat-5.5.17 and the newest apr-version on a debian sarge system and follow the hints in the BUILDING-file from tomcat- native.tar.gz in the bin-directory. This configuration works great with one domain and one certificate, but I have no idea, how to get it running with multiple domains and multiple certificates. I hope, that I have understood your question correctly. Marc-Olaf Peter Rossbach schrieb: Can you give some hints that normaly works for OpenSSL? Peter Am 29.04.2006 um 17:04 schrieb Marc-Olaf Jaschke: Hi, I try to to use Tomcat with APR and name-based virtual hosts using SSL. I've read the documentation for Tomcat/APR and searched the web, but cannot find anything about multiple certificate- or key-files. Is there any possibility to use multiple SSL-Certificates with APR? Thanks for your attention, Marc-Olaf Jaschke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat clustering session data
Hi, currently the Tomcat 5.0 and 5.5 only supports session replication, also JBoss to that. Filip has start a new cluster module and this version supports also application context replication. Look at tomcat source catalina/modules/ha and test it. Peter Am 20.04.2006 um 18:04 schrieb erich.oliphant: Hi, I have a situation that requires some information be shared across a cluster. The issue is that the classes that manage this info are not particular to a given session but global to the application such that at session on all servers in the cluster would need to read/write to these classes. I am wondering if there's a way to do this with the Clustering support directly or would I need to use JGroups or something like that. THanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: min/maxSpareThreads not working with APR
I thing that is normal! Currently the APR Connector not implement a shrinking thread pool! The trick is: Implementation is easier and for a high load szenario the APR use a pooler buffer instead a a lot of new thread like the normal Java based connectors. s. APR Connector documentation or better the o.a.tomcat.util.net.AprEndpoint implementation. Regards Peter Am 18.04.2006 um 16:46 schrieb Adam McFarren: When I run Tomcat 5.5 with APR the min/maxSpareThread attributes don't appear to be working. maxThreads works fine however. Here's the details: Versions: Tomcat 5.5.16 APR 1.2.6 Native Connector 1.1.2 Sun's JDK 1.5.0_06 RedHat AS3 With APR: server.xml: Connector port=4443 maxHttpHeaderSize=8192 address=10.0.111.47 maxThreads=50 minSpareThreads=15 maxSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true SSLEngine=on SSLCertificateFile=${catalina.base}/conf/x4j2ee.crt SSLCertificateKeyFile=${catalina.base}/conf/ x4j2ee.key / catalina.out: Apr 18, 2006 10:19:16 AM org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote HTTP/1.1 on http-10.0.111.47-4443 /manager/status: http-10.0.111.47-4443 Max threads: 50 Min spare threads: 0 Max spare threads: 0 Current thread count: 1 Current thread busy: 1 Keeped alive sockets count: 0 I also verified that this wasn't just a problem with the manager app's reporting. Doing a thread dump (kill -3) on the PID showed only 3 threads associated with the http-10.0.111.47-4443 connector (a Poller, an Acceptor and a -1 thread). I can also change the maxThreads value and that update is reflected in the manager's status page. Without APR: server.xml: Connector port=4443 maxHttpHeaderSize=8192 address=10.0.111.47 maxThreads=50 minSpareThreads=15 maxSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true sslProtocol=TLS / catalina.out: Apr 18, 2006 10:14:17 AM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-10.0.111.47-4443 /manager/status: http-10.0.111.47-4443 Max threads: 50 Min spare threads: 15 Max spare threads: 25 Current thread count: 15 Current thread busy: 1 Again, I verified with a thread dump that without APR enabled I see threads http-10.0.111.47-4443-Processor1 to http-10.0.111.47-4443-Processor15. Known bug? Configuration problem I missed? The example shown at http://tomcat.apache.org/tomcat-5.5-doc/ apr.html includes the min/maxSpareThreads attributes. Thanks, -adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IE 20 session cookies limitation
Option is Connector emptySessionPath=true ... / Then all webapps share the same session id. Cheers Peter Am 16.04.2006 um 15:12 schrieb Tim Funk: Check the docs - there is an option that will allow tomcat to use the same jsessionid for all webapps. -Tim Rick Wong wrote: It's been a while since my last posting of this topic. I have a work-around that perhaps someone may find it useful. I worked around the issue by implementing a Tomcat Valve, and screen out for the jsessionsso cookie on every request. If I find it, I reinsert it back into the response within the valve to touch the timestamp of the jssessionsso cookie. This way, when IE wants to throw away a cookie, jsessionsso would be the last one it picks. It's not a perfect solution but there is nothing I can do about IE's deficiency (how often do you see Microsoft rigidly conforms to a spec?) Thanks, -- Rick Rick Wong wrote: Hi, I am using Tomcat 5.0.26. I have 20+ web applications hooked up with single-sign-on. Each web application generates a JESSIONID session cookie with a different path, and shares a single JSESSIONIDSSO. When testing my suite of applications, I notice that IE consistently drops my login after accessing the 20th web application within a session. I did some research and learned about RFC 2109 where HTTP agents should support a minimum of 20 session cookies per domain. That appears to be just what IE does. The following Microsoft knowledgebase article explains that: http://support.microsoft.com/default.aspx?scid=kb;EN-US; 306070. I suspect JSESSIONIDSSO was the oldest cookie, and was the first to get dropped by IE when reaching over 20 session cookies. Firefox does not have this problem. Knowing that I cannot easily refactor the application suite to make less number of web application ( 19), I am wondering if anyone else has this problem, and if and how I might work around this IE limitation. Thanks, -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Performance issue with Tomcat 5.0
Use Ctrl Break at your cmd shell. regards Peter Am 13.04.2006 um 11:05 schrieb Ronald Klop: Do 'kill -QUIT pid-of-process' and look in your logs for the stacktraces about what thread is doing what. Or run 'jstack pid-of-process'. This works on Unix/Linux. I don't know how to do this on Windows. Ronald. On Thu Apr 13 09:27:36 CEST 2006 Tomcat Users List users@tomcat.apache.org wrote: In our application , jboss app server , fiorano messaging server , Tomcat 5.0 webserver , first time when give load of 200 users it works fine , but after some time 10 min , the tomcat server remains 48% idle , when there is no load , when i type top command it shows java process taking 99 % cpu , where is issue , how to resolve it , in application , applets are running at client side ? is that due to applet , how i should debug -- View this message in context: http://www.nabble.com/Performance- issue-with-Tomcat-5.0-t1442675.html#a3895859 Sent from the Tomcat - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache Tomcat Bundle
Nice plan, we talk about this last week at developer list. I thing good starting points are http://centaurus.sourceforge.net http://lambdaprobe.org Help is very welcome. Let us discuss at developer list and start to build a new tomcat management console. Cheers Peter Am 11.04.2006 um 12:26 schrieb Robert Locklear: Hello All, I'm looking into writing a bundled application to manage Apache HTTP with Tomcat. Basically just a management console and predefined configuration structure that would allow non-technical users the ability to easily add virtual servers, instances, SSL certs, etc. The system would also be cluster aware in the sense of pushing configuration changes to multiple nodes in a cluster mapping variables to each node (IP address, etc). Before I proceed I just wanted to check if anyone knows of a system similar to this so I don't have to rewrite what's been done before. I did some searching on sourceforge and google but couldn't really find anything that does this. Thanks, Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: W3C Extended Log Format
Look at class o.a.c.valves.ExtendedAccessLogValve at the Source Distribution. This AccessLogger is currently not documented :-( You can configured this Logger conform to the http://www.w3.org/TR/WD-logfile.htm spec. Regards Peter Am 06.04.2006 um 23:26 schrieb Bernie Durfee: Is there a way to have Tomcat 5.5 output access logs in W3C Extended Log Format? I'm specifically trying to get elapsed request time into the log, in a standard way, so that I can pick the value up in WebTrends 7. It seems like the W3C format is the only way that it can get into the log and be picked up by WebTrends. Any ideas? Thanks, Bernie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FarmWarDeployer ROOT.war - / - How to?
Yes, not a nice feature change: -:( But the deployment system at tomcat 5.5 has changed a lot, and I switch to easier way to get FarmWarDeployer up and running (Tomcat 5.5.5 Release 12/04). Last year nobody of the community ask for the separate depoyDir feature and so this was not at my top prio list. My missing feature list at FarmWarDeployer - support for Engine level configuration that we support multiple hosts - separate deployDir from host appBase dir - control application activation currently all application start a very strange way when async sender is used. - give the user the changes that sessions are exists after redeployment! - JMX Support I am now fix the ROOT.war bug. I hope Tim and Filip can test it with svn head. Thanks Peter Am 31.03.2006 um 23:40 schrieb Filip Hanik - Dev Lists: Tim Lucia Wrote: and a more recent post from Peter Rossbach saying that it SHOULD be the appBase. [http://marc.theaimsgroup.com/?l=tomcat-userm=113828526109819w=2] On Thursday 26 Jan 2006 11:33, Peter Rossbach wrote: Please, set the deployDir to your webapps dir. Peter ha ha, :) Peter has a habit of changing underlying functionality to new functionality, but provide no backwards compatibility. Earlier, the FarmWarDeploy used to deploy remote .war files that were located in any directory. (ie deployDir) Peter has changed this functionlity, that you now must deploy into the appBase dir, definitely a functionality I don't like and would have -1 if I had caught the change. Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FarmWarDeployer ROOT.war - / - How to?
I currently look inside the FarmWarDeployer code and it seems that the ROOT case is not handle really well. OK, I have tomorrow time to make a really introspection and a test the case. Regards Peter Am 31.03.2006 um 23:04 schrieb Filip Hanik - Dev Lists: two things: 1. I don't see that you specified path= in your Context element, I would try that. 2. Deleting a .war deletes webapps directory, yeah, you can call that a pretty big oops! if you open a bugzilla item I will be happy to fix that, I of course never thought anyone would use .war as an actual deployed file. Filip Tim Lucia wrote: That's what I am saying. I have a context.xml in my META-INF -- it looks like this: Context reloadable=true !-- Define the admin2 database as a JNDI-enabled DataSource. -- Resource name=jdbc/admin2 type=javax.sql.DataSource driverClassName=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@blah.blah.blah:1521:admin2 username=blah password=blah validationQuery=SELECT COUNT(*) FROM DUAL initialSize=10 defaultCatalog=admin2 maxIdle=20 maxWait=5000 maxActive=50/ Environment description=Host name (FQDN) of blah Server name=host override=false type=java.lang.String value=blah.blah.blah/ /Context I forgot to mention - tomcat 5.5.12 / JDK 1.5.0_06 -- I am leery of moving forward given the recent banter about .16... Oh, and while I am at it, undeploying the context (empty) created by deploying .war DELETES MY webapps DIRECTORY! That can't be good either. Thanks, Tim -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 3:35 PM To: Tomcat Users List Subject: Re: FarmWarDeployer ROOT.war - / - How to? so you are saying its all working except that on a slave you get two contexts, / and /ROOT? have you tried putting a context.xml inside the META-INF directory? maybe that will solve the problem? otherwise, I am sure its a bug and I would have to research it a little bit further. Filip Tim Lucia wrote: Hi All, (This one is probably a Filip question...) I have a 3-node cluster on Red Hat (2.6.9+ kernel) and I wish to use the FarmWarDeployer. I have (of course!) RTFM and STFW and both have been extremely helpful. I did note an old (2004-ish) post to this list from Filip saying that the deployDir SHOULD NOT be the host's appBase [http://servlets.com/archive/servlet/ReadMsg? msgId=486921listName=tom cat-us er] From: Filip Hanik - Dev [EMAIL PROTECTED] Subject: Re: cluster FarmWarDeployer Date: Fri, 17 Sep 2004 16:32:27 -0500 - should the deploy dir point to the webapp directory? no it should not, cause you would double deploy your app, and that is why you get an error but that seemed to only copy the war no, it deployed it, just didn't expand it, there is no reason to expand it Filip and a more recent post from Peter Rossbach saying that it SHOULD be the appBase. [http://marc.theaimsgroup.com/?l=tomcat-userm=113828526109819w=2] On Thursday 26 Jan 2006 11:33, Peter Rossbach wrote: Please, set the deployDir to your webapps dir. Peter The latter appears to work for wars named other then ROOT.war. Of course ROOT.war works properly when autoDeploy'ed via copying directly into appBase, or when uploading via the manager. I can successfully deploy an application named 'tim.war' across my cluster by dropping it into /tmp/war-listen on the node with watchEnabled=true. My problem comes when trying to perform a cluster-wide deployment of the default application. If I name it ROOT.war, I get / on the master, and / + /ROOT on each of the slaves. One other suggestion was to simply name it .war [http://marc.theaimsgroup.com/?l=tomcat- userm=111768929520032w=2] but this caused the following: 2006-03-31 15:10:02,446 [org.apache.catalina.cluster.tcp.TcpReplicationThread[2]] INFO HostConfig : Deploying web application archive .war 2006-03-31 15:10:02,491 [org.apache.catalina.cluster.tcp.TcpReplicationThread[2]] INFO ContextConfig : Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/] Which is no good either. Here is my Deployer element, if it matters at all (this is from a slave) Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/usr/local/tomcat/webapps/ watchDir=/tmp/war-listen/ watchEnabled=false/ What's the official party line on deploying in this manner to /? Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL
Re: Cluster member discovery
Thanks, I have correct the wrong name at server.xml comment. The current cluster Howto describe the corrent mcastBindAddress parameter name. Sorry! Peter Am 27.03.2006 um 19:30 schrieb Parham, Clinton: Hi Filip, I have figured out (for the most part) what is happening: Using Ethereal, I determined that even though I was setting the mcast bind address to the private adapter, traffic was still being broadcasted on my public adapter. After some investigation into the Tomcat source code, I determined that the server.xml cluster comments don't reflect what the code is expecting for the bind address parameter name. The server.xml comments say to use mcastBindAddr whereas the source code is actually looking for mcastBindAddress. After the mcastBindAddress fix, UDP broadcasts were sent/received by both nodes correctly. I suppose the public adapter configuration on nodeB was set in some way to ignore UDP traffic. I appreciate your assistance. Thank You. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 11:02 AM To: Tomcat Users List Subject: Re: Cluster member discovery please attach both your server.xml files, I'll take a look at them. Filip Parham, Clinton wrote: Martin, The install on nodeB is operation. I am able to open the default Tomcat page, If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Netstat lists the http(80), mcast(45564) and receiver (4001) ports. Other ideas? This is very frustrating. Thanks. [Bill?? :) humor?] -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Sunday, March 26, 2006 7:37 PM To: Tomcat Users List Subject: Re: Cluster member discovery Bill- Make sure your tomcat install is operational check whatever the default connector (catalina) port is configured to via netstat -a | grep CatalinaPort if it isnt there then that Tomcat server never came up and you should check the logs in %CATALINA_HOME%\logs for any exceptions or errors Martin- - Original Message - From: Filip Hanik - Dev Lists [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, March 26, 2006 3:06 PM Subject: Re: Cluster member discovery did you try to remove the bind address? Filip Parham, Clinton wrote: Hello Tomcat Users! I'm trying to setup two node clustering (nodeA nodeB) using the following: Windows 2003, Tomcat 5.5.16 (apache-tomcat-5.5.16.exe) and JDK1.5. For some inexplicable reason, I cannot get nodeB to discover nodeA. nodeA always discovers nodeB successfully. The two nodes are identical machines - purchased/configured at the same time. Tomcat and JDK were installed to the same folders and use identical server.xml files except for bind address values. nodeA and nodeB have dual network cards - one public, one private. To try and figure out the problem, I turned logging on following these instructions: http://tomcat.apache.org/tomcat-5.5-doc/logging.html and added org.apache.catalina.cluster set to debug. In nodesA's (192.168.3.30) log, I see it find nodeB (192.168.3.31): INFO Cluster-MembershipReceiver org.apache.catalina.cluster.tcp.SimpleTcpCluster - Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp:// 192.168.3.31:4 001,catalina,192.168.3.31,4001, alive=35000] Further down in nodeA's log, I also see it send/receive pings from itself and also receive pings from nodeB. Now, in nodesB's log, the story is different. I don't see anything about nodeA. What I do see a lot of is nodeB sending pings but never receiving any - not even from itself. There are no errors or warnings in either log file. To confirm that multicast works between the nodes, I used the Windows 2003 mcast.exe test utility and also ran the JGroups test: http://www.jgroups.org/javagroupsnew/docs/newuser/node15.html. Both were successful. Does anyone know what the problem is? What other information can I provide to help troubleshoot this? Thanks, Clinton Here's the Cluster section from nodeB's server.xml. It's nothing special - I just uncommented the cluster tags and added the local network card address: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastBindAddr=192.168.3.31 mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=192.168.3.31 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/
Re: Tomcat cluster and redirecting to the same address
We mark all SessionID with a node marker! Setup with Engine jvmRoute=node1 The mod_jk or mod_proxy_ajp make then the correct routing. The algo extract the worker name from cookie or url rewrite parameter jsessionid. Read Cluster Doc and mod:jk doc http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html http://tomcat.apache.org/connectors-doc/ regards Peter Am 17.03.2006 um 03:16 schrieb Michael Jouravlev: Hello! How does redirect-after-post pattern work in clustered environment? In my case I need to redirect to exactly the same location, where the initial POST request was made from. How does this work in cluster, if at all? Afaik, the original address is load balancer's address. When requests reaches the application, all application gets is the address of a specific server that executes the request. Is it possible to find out the original location visible to external app? Or am I totally offbase here? Does this depends on server (Tomcat or not) or load balancer? Apparently, load balancer has to be tightly integrated with Tomcat to provide information about original location. I do not want to use referer. I have not tried to set up Tomcat in cluster yet ;) Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat clustering
Yes and no! Speak with your network admin that the multicast send to other global machine. Not working over normal internet ways! I thing clustering is made for local network failover. What you need are cluster domains. Gropus of clusters with a separate loadbalancer to route request over you country boundaries. That works fine :-) Peter Am 17.03.2006 um 00:02 schrieb Larry Mulcahy: My question is: Is it reasonable to expect Tomcat clustering to work for servers not in the same network? Widely separated in different states? I have read the docs but don't understand the whole multicast thing. I have set up two servers with clustering enabled on the same subnet and they see each other, no problem. Then I tried to add another server on a different subnet, no dice. I am experimenting with some configuration settings like the multicast address but would like to hear from someone who knows 'yes this can be done' before I invest too much more time. -- Larry Mulcahy Good system software should be free, like air - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.28 Clustering and Load Balancing
Many thanks! But the current tomcat 5.5 documentation find here http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html I thing it exists many good reasons to migrate from 5.0 to tomcat 5.5.16 if really using clustering today :-) Regards Peter Am 16.03.2006 um 21:51 schrieb Filip Hanik - Dev Lists: Peter Rossbach has done a great job documenting most of it here. http://tomcat.apache.org/tomcat-5.0-doc/cluster-howto.html Filip Dadyala, Manjeet S wrote: I’m new to Tomcat and am in the process of investigating the configuration of Tomcat 5.0.28 on RedHat Linux (AS 3) and Load Balancing. The documentation that I’ve come across at http:// tomcat.apache.org http://tomcat.apache.org/ most often deals with Tomcat version 5.5. Could someone assist in directing me to documentation for the 5.0.28 release and if possible specific to RedHat AS 3? Our inquires to RedHat Support tell us to go to http:// tomcat.apache.org http://tomcat.apache.org/, hence my effort to send this to the distribution. We’d like to implement testing across 2 or more nodes using as the RPM distributed by RedHat doesn’t support vertical clustering – a cluster on a single node. Here’s what I’m looking into testing: - Hardware Load Balancer - Tomcat instances across 2 or 3 nodes - Clustering Thanks in advance for your feedback and replies. */Manjeet Dadyala/* /Sr. Applications Ops Engineer/ */veri/**/z/**/on/**/business/* Hosting Technical Operations [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: manager-remove/undeploy without losing sessions
Your filter show only that the class implements java.io.Serializable and not that the object is really serializable ;-( A good live session analyze shows the probe tomcat manager. http://tomcatprobe.org regards Peter Am 15.03.2006 um 14:59 schrieb Tim Lucia: You may also find the following filter helpful. I wrote it to find those session members who were not serializable. Tim package tim.lucia; import java.io.IOException; import java.io.Serializable; import java.text.MessageFormat; import java.util.Collection; import java.util.Date; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedList; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * J2EE Filter to dump session info * * @author tim.lucia */ public class SessionDumper implements Filter { private final static Log logger = LogFactory.getLog(SessionDumper.class); private final static String defaultSessionStatusFormat = SessionID [{0}] created {1, date, -MMM-dd hh:mm a zzz} last {2, date, -MMM-dd hh:mm a zzz}; private final static String defaultSessionObjectFormat = [{0}] = [{1}]; private final static boolean defaultShowSerializable = false; private static String sessionStatusFormat = defaultSessionStatusFormat; private static String sessionObjectFormat = defaultSessionObjectFormat; private static boolean showSerializable = defaultShowSerializable; /** * Container startup notification */ public void init(FilterConfig arg0) throws ServletException { if (logger.isDebugEnabled()) { logger.debug(init(): + arg0); } String value = arg0.getInitParameter(sessionStatusFormat); if (null != value) { sessionStatusFormat = value; } value = arg0.getInitParameter(sessionObjectFormat); if (null != value) { sessionObjectFormat = value; } value = arg0.getInitParameter(showSerializable); if (null != value) { showSerializable = Boolean.valueOf(value).booleanValue(); } } /** * Container shutdown notification */ public void destroy() { logger.debug(destroy()); } /** * Process the container's filter request. * @param request - Request object * @param response - response object * @param chain - next filter in the chain. */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (logger.isDebugEnabled()) { HttpServletRequest httpRequest = (HttpServletRequest) request; String uri = httpRequest.getRequestURI(); chain.doFilter(request, response); logger.debug(Session for + uri); dumpSession(request); } else { chain.doFilter(request, response); } } private void dumpSession(ServletRequest request) { if (request instanceof HttpServletRequest) { HttpSession session = ((HttpServletRequest)request).getSession(false); if (null != session) { final String sessionID = session.getId(); final long createdAt = session.getCreationTime(); final long lastAccessed = session.getLastAccessedTime(); if (logger.isDebugEnabled()) { final String sessionStatus = MessageFormat.format(sessionStatusFormat, new Object[] { sessionID, new Date(createdAt), new Date(lastAccessed) }); logger.debug(sessionStatus); } Enumeration enumerator = session.getAttributeNames(); Collection serializable = new LinkedList(); Collection nonSerializable = new LinkedList(); while (enumerator.hasMoreElements()) { final String key = (String)enumerator.nextElement(); final Object value = session.getAttribute(key); final String message = MessageFormat.format(sessionObjectFormat, new Object[] {key, value}); if (value instanceof Serializable) { serializable.add(message); } else { nonSerializable.add(message); } if
Re: Problems with the ReplicationValve
Hey Michael, yes that is true here my fix: ReplicationValve: protected void resetReplicationRequest(Request request, boolean isCrossContext) { Session contextSession = request.getSessionInternal(false); if(contextSession != null contextSession instanceof DeltaSession){ resetDeltaRequest(contextSession); ((DeltaSession)contextSession).setPrimarySession(true); } if(isCrossContext) { Object sessions = crossContextSessions.get(); if(sessions != null sessions instanceof List ((List)sessions).size() 0) { Iterator iter = ((List)sessions).iterator(); for(; iter.hasNext() ;) { Session session = (Session)iter.next(); resetDeltaRequest(session); if(session instanceof DeltaSession) ((DeltaSession) contextSession).setPrimarySession(true); } } } } Can you please test this, then I can commit the change. Tipp: That your client/browser also know that B is forever the primary use JvmRouteBinderValve. That helps very much for longer shutdowns and more then two node clusters. Configure it after ReplicationValve. regards Peter Am 15.03.2006 um 16:57 schrieb Michael: Hi all, we tried to switch with a clusterable webapp from Tomcat 5.0 to Tomcat 5.5 and ran into problems with the primary session indication by the ReplicationValve. We have a cluster with two nodes (let's call them 'A' and 'B'). A sticky session is created at node A and is reported there as primary session. When we shut down node A the next request will be routed to the secondary node B and the primary indicator attribute in the request will be set to false. Everything's fine up to here. After a request is served by a secondary node, this node should become primary, so further requests to node B should be indicated as primary session again. With tomcat 5.5 (tested with 5.5.15 and 5.5.16-beta) and a cluster with two nodes this doesn't work any longer. Looks like the problem starts here (see ReplicationValve.java 360ff): 360 if(containerCluster.hasMembers()) { 361 sendReplicationMessage(request, totalstart, isCrossContext, clusterManager, containerCluster); 362 } else { 362 resetReplicationRequest(request,isCrossContext); 363 } When node A is gone, the cluster doesn't have other members any more, so no replication messages are created and there is no call to the DeltaManager DeltaManager.requestCompleted(..) which set's the primary session flag to 'true' again. Can anyone confirm this problem? Unfortunately the numbers of the placeholders from ReplicationValve.session.indicator in org.apache.catalina.cluster.tcp.LocalStrings.properties are wrong, so you have to fix them first if you want to see the value of the primary session indicator in the debug log (see diff below). Regards, Michael -=-=-=-=-=-=-=- diff -ru apache-tomcat-5.5.16-src/container/modules/cluster/src/ share/org/apache/catalina/cluster/tcp/LocalStrings.properties tomcat-5.5/container/modules/cluster/src/share/org/apache/catalina/ cluster/tcp/LocalStrings.properties --- apache-tomcat-5.5.16-src/container/modules/cluster/src/share/ org/apache/catalina/cluster/tcp/LocalStrings.properties 2006-03-05 02:25:35.0 +0100 +++ tomcat-5.5/container/modules/cluster/src/share/org/apache/ catalina/cluster/tcp/LocalStrings.properties 2006-03-14 17:16:15.867578000 +0100 @@ -48,7 +48,7 @@ ReplicationValve.send.failure=Unable to perform replication request. ReplicationValve.send.invalid.failure=Unable to send session [id= {0}] invalid message over cluster. ReplicationValve.session.found=Context {0}: Found session {1} but it isn't a ClusterSession. -ReplicationValve.session.indicator=Context {0}: Primarity of session {0} in request attribute {1} is {2}. +ReplicationValve.session.indicator=Context {0}: Primarity of session {1} in request attribute {2} is {3}. ReplicationValve.session.invalid=Context {0}: Requested session {1} is invalid, removed or not replicated at this node. ReplicationValve.stats=Average request time= {0} ms for Cluster overhead time={1} ms for {2} requests {3} filter requests {4} send requests {5} cross context requests (Request={6} ms Cluster={7} ms). SimpleTcpCluster.event.log=Cluster receive listener event {0} with data {1} - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Problem disabling session serialization duing shutdown.
or shorter with Context docBase=/your-doc-base path=/your-context Manager pathname= / /Context at tomcat 5.5 add the description at your META-INF/context.xml Context Manager pathname= / /Context or at the conf/context.xml :-) Peter Am 14.03.2006 um 15:31 schrieb Michael Südkamp: Hmm, context.xml? I know only of server.xml. At least on Windows. Here is a context snippet for server.xml which disables session persistence. Michael Context docBase=/your-doc-base path=/your-context Manager className=org.apache.catalina.session.PersistentManager saveOnRestart=false Store className=org.apache.catalina.session.FileStore/ /Manager /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: manager-remove/undeploy without losing sessions
Hmm, I thing you are right. ContextConfig.destroy() remove the working dir after undeploy the app. /** * Process a destroy event for this Context. */ protected synchronized void destroy() { // Called from StandardContext.destroy() if (log.isDebugEnabled()) log.debug(sm.getString(contextConfig.destroy)); // Changed to getWorkPath per Bugzilla 35819. String workDir = ((StandardContext) context).getWorkPath(); if (workDir != null) ExpandWar.delete(new File(workDir)); } This feature is important do guaranty a clear state after change the binary. Feel free to open an enhancement bug report, and feel free to add a patch. The current behaviour is correct for production sites. Peter Am 14.03.2006 um 15:03 schrieb Reinhard Moosauer: Hi List, I found something, that looked promising, but did not work. Developers, please look, this could be a bug: The deploy-task has an attribute update, removes the context before re-installing it. I hoped that this one would do what I want. But unfortunately, it is equivalent to undeploy/deploy so my sessions are gone again. :-( Maybe I have to clarify, what I am doing with my sessions (for Rodrigo): I have all session-attribute in my application serializable, so that tomcat can save all session data to disk when the context or tomcat itself is stopped. At startup these serialized data is being read back by tomcat automatically. As a result, users can coutinue their work exactly where the are. (Except that the application is not available for 1-2 seconds. But it is still unlikely that a users fires a request just in this moment, at least for medium-frequency apps) Formerly, the persisted session data survived the remove, so I could re-install the app. Please help! Reinhard Am Dienstag, 14. März 2006 13:53 schrieb Reinhard Moosauer: Hello List, recently I upgraded from tomcat 5.5.9 to 5.5.15 Since then, all my sessions are lost after a remove/install via the manager. The problem is the following: I installed a war-file, which is copied to the webapps-folder during manager-install. When I want to replace the war with a new version, I _have_ to undeploy, which deletes my persistent sessions too. How can I get back the smooth behavior of 5.5.9, which allowed me an application update on the fly without disturbing user sessions? many thanks in advance for your advice Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: manager-remove/undeploy without losing sessions
Please open a bug report, then we can better discuss the issue. Peter Am 14.03.2006 um 16:21 schrieb Reinhard Moosauer: Hi Peter, thanks for making it clear. I would appreciate your opinon in how we could enhance this: - I think, even on production systems, there should be a possibility to do a 'soft' application update without interrupting all users. When only minor changes in the application are made, the session state should be fully compatible. - I agree, that in many situations, a clear state is very much helpful. But this applies even more to development systems, doesn't it? - I hoped, we could simply add a manager attribute 'keepSessions' to the undeploy-task. But I am afraid, that's no easy to get, because deletion is not done in the manager but in the context. Do you think its possible? - It would be quite straightforward, if the 'update'-attribute to manager-deploy would have just this effect. If anyone has a good idea how to do this, please let me know. All other please vote for this enhancement because we have lost a very nice feature here. kind regards, Reinhard Am Dienstag, 14. März 2006 15:44 schrieb Peter Rossbach: Hmm, I thing you are right. ContextConfig.destroy() remove the working dir after undeploy the app. /** * Process a destroy event for this Context. */ protected synchronized void destroy() { // Called from StandardContext.destroy() if (log.isDebugEnabled()) log.debug(sm.getString(contextConfig.destroy)); // Changed to getWorkPath per Bugzilla 35819. String workDir = ((StandardContext) context).getWorkPath(); if (workDir != null) ExpandWar.delete(new File(workDir)); } This feature is important do guaranty a clear state after change the binary. Feel free to open an enhancement bug report, and feel free to add a patch. The current behaviour is correct for production sites. Peter Am 14.03.2006 um 15:03 schrieb Reinhard Moosauer: Hi List, I found something, that looked promising, but did not work. Developers, please look, this could be a bug: The deploy-task has an attribute update, removes the context before re-installing it. I hoped that this one would do what I want. But unfortunately, it is equivalent to undeploy/deploy so my sessions are gone again. :-( Maybe I have to clarify, what I am doing with my sessions (for Rodrigo): I have all session-attribute in my application serializable, so that tomcat can save all session data to disk when the context or tomcat itself is stopped. At startup these serialized data is being read back by tomcat automatically. As a result, users can coutinue their work exactly where the are. (Except that the application is not available for 1-2 seconds. But it is still unlikely that a users fires a request just in this moment, at least for medium-frequency apps) Formerly, the persisted session data survived the remove, so I could re-install the app. Please help! Reinhard Am Dienstag, 14. März 2006 13:53 schrieb Reinhard Moosauer: Hello List, recently I upgraded from tomcat 5.5.9 to 5.5.15 Since then, all my sessions are lost after a remove/install via the manager. The problem is the following: I installed a war-file, which is copied to the webapps-folder during manager-install. When I want to replace the war with a new version, I _have_ to undeploy, which deletes my persistent sessions too. How can I get back the smooth behavior of 5.5.9, which allowed me an application update on the fly without disturbing user sessions? many thanks in advance for your advice Reinhard --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: double cluster in one server.xml?
Yes, you must use different domains, but you can also used an engine level cluster module, Engine ... Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster / Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / /Host Host name=test2.example.com appBase=webapps autoDeploy=false ... /Host /Engine regards Peter Am 02.03.2006 um 17:38 schrieb Filip Hanik - Dev Lists: I'm gonna let Peter Rossbach give you the final answer since he developed the simpleconfig concept. My guess is yes, if your hosts have webapps with the same names, they will most likely get mixed up. my suggestion to try would be Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost1/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost2/ /Host and that should stop the data from flowing between vhosts Filip Ronald Klop wrote: Hello, I have this in my server.xml. Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host This seems to work. The sessions aren't mixed up between de hosts. Is this supported behaviour? Or is there a change the sessions wil mix up? Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: double cluster in one server.xml?
Yes, look at SimpleTcpCluster private String getManagerName(String name, Manager manager) { String clusterName = name ; if(getContainer() instanceof Engine) { Container context = manager.getContainer() ; if(context != null context instanceof Context) { Container host = ((Context)context).getParent(); if(host != null host instanceof Host) clusterName = host.getName() + name ; } } return clusterName; } we concatenate host name with context path :-) Peter Am 04.03.2006 um 15:59 schrieb Filip Hanik - Dev Lists: if you have an engine cluster and two webapps with the same name, one in each host, how does it know which one it is? Filip Peter Rossbach wrote: Yes, you must use different domains, but you can also used an engine level cluster module, Engine ... Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster / Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / /Host Host name=test2.example.com appBase=webapps autoDeploy=false ... /Host /Engine regards Peter Am 02.03.2006 um 17:38 schrieb Filip Hanik - Dev Lists: I'm gonna let Peter Rossbach give you the final answer since he developed the simpleconfig concept. My guess is yes, if your hosts have webapps with the same names, they will most likely get mixed up. my suggestion to try would be Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost1/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost2/ /Host and that should stop the data from flowing between vhosts Filip Ronald Klop wrote: Hello, I have this in my server.xml. Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host This seems to work. The sessions aren't mixed up between de hosts. Is this supported behaviour? Or is there a change the sessions wil mix up? Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 5.5.15 exception about key 'standardSession.setAttribute.ise'
Are you sure that you not destory your session before you set an attribute at your LoginServlet? The missing message key is fixed for Tomcat 5.5.16. o.a.c.cluster.session.LocalString.properties standardSession.setAttribute.ise=setAttribute: Session already invalidated Peter Am 22.02.2006 um 10:07 schrieb Ronald Klop: Hello, I get this exception sometimes in my 2 node cluster. (tomcat 5.5.15) The tomcat source learns me, the session is invalid at that point, but what else can I learn from this exception? Ronald. HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalStateException: Cannot find message associated with key standardSession.setAttribute.ise org.apache.catalina.cluster.session.DeltaSession.setAttribute (DeltaSession.java:1219) org.apache.catalina.cluster.session.DeltaSession.setAttribute (DeltaSession.java:1200) org.apache.catalina.cluster.session.DeltaSessionFacade.setAttribute (DeltaSessionFacade.java:130) nl.base.servlets.login.LoginServlet.processRequest (LoginServlet.java:113) nl.base.servlets.login.LoginServlet.doGet(LoginServlet.java:57) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.apache.catalina.security.SecurityUtil$1.run (SecurityUtil.java:243) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute (SecurityUtil.java:275) org.apache.catalina.security.SecurityUtil.doAsPrivilege (SecurityUtil.java:161) java.security.AccessController.doPrivileged(Native Method) nl.base.servletFilters.CloseConnectionFilter.doFilter (CloseConnectionFilter.java:74) sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.apache.catalina.security.SecurityUtil$1.run (SecurityUtil.java:243) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute (SecurityUtil.java:275) org.apache.catalina.security.SecurityUtil.doAsPrivilege (SecurityUtil.java:217) java.security.AccessController.doPrivileged(Native Method) nl.base.servletFilters.RequestLogFilter.doFilter (RequestLogFilter.java:233) sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.apache.catalina.security.SecurityUtil$1.run (SecurityUtil.java:243) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute (SecurityUtil.java:275) org.apache.catalina.security.SecurityUtil.doAsPrivilege (SecurityUtil.java:217) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs. Apache Tomcat/5.5.15
Re: Tomcat 5.5.15 Clustering ?
Am 15.02.2006 um 15:11 schrieb Filip Hanik - Dev Lists: 1)Clustering need sticky_session=true and is only design for failover (see servlet spec). Not true for Tomcat, using replicationMode=pooled and waitForAck=true, you can do round robin non sticky load balancing as long as you don't have more than one thread accessing the session at any point in time. OK, yes, for special application we support it, but normaly sticky_session is true. See Servlet Spec (SRV 7.7). Peter INFO: Manager [/cluster-1.0-SNAPSHOT]: skipping state transfer. No members active in cluster group. yes, your multicast isn't working, or it should have said that you had a member. Take a look at the bottom of the page and run the MCaster test included in a super old version of Tomcat 4 clustering. http://people.apache.org/~fhanik/ On multihomed hosts, it can get a little tricky to get multicasting working and you might have to setup some routes to help. Check with your sysadmin. Filip Peter Rossbach wrote: Hey, 1)Clustering need sticky_session=true and is only design for failover (see servlet spec). 2)Are your sure that MULTICAST is enabled at eth0? regards Peter [EMAIL PROTECTED] Am 15.02.2006 um 02:26 schrieb David Avenante: Hi, I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on configuration and test i seems to be on limit of my all possibilities ;) I try to use two tomcat in cluster with apache web server and mod_jk as connector. my Apache configuration look like : # workers.properties ps=/ # List the workers name worker.list=loadbalancer # # First worker # worker.node01.port=8009 worker.node01.host=agnes worker.node01.type=ajp13 worker.node01.lbfactor=1 #worker.node01.domain=cluster1 # # Second worker # worker.node02.port=9009 worker.node02.host=ovea-inspiron worker.node02.type=ajp13 worker.node02.lbfactor=1 #worker.node02.domain=cluster1 # -- # Load Balancer worker # -- worker.loadbalancer.type=lb worker.loadbalancer.sticky_session=false worker.loadbalancer.balanced_workers=node01,node02 As you can see i use two server ('agnes' IP : 192.168.2.102 and 'ovea-inspiron' IP : 192.168.2.103) I' ve coded a little aplication who read un file and create a sessions if session not exist. If i use the system in mod load balancing (with no cluster mod activate) all is great (my config is of course worker.loadbalancer.sticky_session=true ) So system run with session affinitu but the two server are accessible ;) Now i try to configure as cluster mode with session replication (my config is now worker.loadbalancer.sticky_session=3Dfalse) I configure my to server.xml like that : agnes (IP : 192.168.2.102) Server port=8005 shutdown=SHUTDOWN GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory= org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / Connector port=8009 enableLookups=false redirectPort=8443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=node01 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog manager.className= org.apache.catalina.cluster.session.DeltaManager manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=true manager.notifySessionListenersOnReplication=true manager.sendAllSessions=true manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 Membership className= org.apache.catalina.cluster.mcast.McastService mcastBindAddress=192.168.2.102 mcastAddr=224.0.0.1 mcastPort=45564 mcastFrequency=1000 mcastDropTime=3/ Receiver className= org.apache.catalina.cluster.tcp.ReplicationListener
Re: Tomcat 5.5.15 Clustering ?
Can you test your config without the parameter mcastBindAddress=xx? Peter Am 15.02.2006 um 14:35 schrieb David Avenante: Yes MULTICAST is enabled i see that by too fact : first, ifconfig eth0 : eth0 Link encap:Ethernet HWaddr 00:13:D4:45:A6:3F inet addr:192.168.2.102 Bcast:192.168.2.255 Mask: 255.255.255.0 UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1 RX packets:264493 errors:0 dropped:0 overruns:0 frame:0 TX packets:292063 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:98079150 (93.5 Mb) TX bytes:41007393 (39.1 Mb) ALLMULTI and MULTICAST is enabled on two serveur interface. second, as you see in my first post tcpdump track the UDP messages send between server. For sticky_session=true i' m not agree with you. In the connector documentation (see http://tomcat.apache.org/connectors-doc/config/workers.html) = Set sticky_session to *False* when Tomcat is using a Session Manager which can persist session data across multiple instances of Tomcat It' s my situation. So i' m alway in the trouble by thanks a lot for the verification ;) On 2/15/06, Peter Rossbach [EMAIL PROTECTED] wrote: Hey, 1) Clustering need sticky_session=true and is only design for failover (see servlet spec). 2) Are your sure that MULTICAST is enabled at eth0? regards Peter [EMAIL PROTECTED] Am 15.02.2006 um 02:26 schrieb David Avenante: Hi, I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on configuration and test i seems to be on limit of my all possibilities ;) I try to use two tomcat in cluster with apache web server and mod_jk as connector. my Apache configuration look like : # workers.properties ps=/ # List the workers name worker.list=loadbalancer # # First worker # worker.node01.port=8009 worker.node01.host=agnes worker.node01.type=ajp13 worker.node01.lbfactor=1 #worker.node01.domain=cluster1 # # Second worker # worker.node02.port=9009 worker.node02.host=ovea-inspiron worker.node02.type=ajp13 worker.node02.lbfactor=1 #worker.node02.domain=cluster1 # -- # Load Balancer worker # -- worker.loadbalancer.type=lb worker.loadbalancer.sticky_session=false worker.loadbalancer.balanced_workers=node01,node02 As you can see i use two server ('agnes' IP : 192.168.2.102 and 'ovea-inspiron' IP : 192.168.2.103) I' ve coded a little aplication who read un file and create a sessions if session not exist. If i use the system in mod load balancing (with no cluster mod activate) all is great (my config is of course worker.loadbalancer.sticky_session=true ) So system run with session affinitu but the two server are accessible ;) Now i try to configure as cluster mode with session replication (my config is now worker.loadbalancer.sticky_session=3Dfalse) I configure my to server.xml like that : agnes (IP : 192.168.2.102) Server port=8005 shutdown=SHUTDOWN GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory= org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / Connector port=8009 enableLookups=false redirectPort=8443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=node01 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog manager.className= org.apache.catalina.cluster.session.DeltaManager manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=true manager.notifySessionListenersOnReplication=true manager.sendAllSessions=true manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 Membership className= org.apache.catalina.cluster.mcast.McastService mcastBindAddress=192.168.2.102 mcastAddr=224.0.0.1 mcastPort=45564
Re: Tomcat 5.5.15 Clustering ?
Hey, 1) Clustering need sticky_session=true and is only design for failover (see servlet spec). 2) Are your sure that MULTICAST is enabled at eth0? regards Peter [EMAIL PROTECTED] Am 15.02.2006 um 02:26 schrieb David Avenante: Hi, I' ve try to use Tomcat 5.5.15 in cluster mod. And after some work on configuration and test i seems to be on limit of my all possibilities ;) I try to use two tomcat in cluster with apache web server and mod_jk as connector. my Apache configuration look like : # workers.properties ps=/ # List the workers name worker.list=loadbalancer # # First worker # worker.node01.port=8009 worker.node01.host=agnes worker.node01.type=ajp13 worker.node01.lbfactor=1 #worker.node01.domain=cluster1 # # Second worker # worker.node02.port=9009 worker.node02.host=ovea-inspiron worker.node02.type=ajp13 worker.node02.lbfactor=1 #worker.node02.domain=cluster1 # -- # Load Balancer worker # -- worker.loadbalancer.type=lb worker.loadbalancer.sticky_session=false worker.loadbalancer.balanced_workers=node01,node02 As you can see i use two server ('agnes' IP : 192.168.2.102 and 'ovea-inspiron' IP : 192.168.2.103) I' ve coded a little aplication who read un file and create a sessions if session not exist. If i use the system in mod load balancing (with no cluster mod activate) all is great (my config is of course worker.loadbalancer.sticky_session=true ) So system run with session affinitu but the two server are accessible ;) Now i try to configure as cluster mode with session replication (my config is now worker.loadbalancer.sticky_session=3Dfalse) I configure my to server.xml like that : agnes (IP : 192.168.2.102) Server port=8005 shutdown=SHUTDOWN GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory= org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / Connector port=8009 enableLookups=false redirectPort=8443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost jvmRoute=node01 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster doClusterLog=true clusterLogName=clusterlog manager.className= org.apache.catalina.cluster.session.DeltaManager manager.expireSessionsOnShutdown=false manager.notifyListenersOnReplication=true manager.notifySessionListenersOnReplication=true manager.sendAllSessions=true manager.sendAllSessionsSize=500 manager.sendAllSessionsWaitTime=20 Membership className= org.apache.catalina.cluster.mcast.McastService mcastBindAddress=192.168.2.102 mcastAddr=224.0.0.1 mcastPort=45564 mcastFrequency=1000 mcastDropTime=3/ Receiver className= org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=192.168.2.102 tcpListenPort=4000 tcpSelectorTimeout=100 tcpThreadCount=6 / Sender className= org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=fastasyncqueue doTransmitterProcessingStats=true doProcessingStats=true doWaitAckStats=true queueTimeWait=true queueDoStats=true queueCheckLock=true ackTimeout=15000 waitForAck=true keepAliveTimeout=8 keepAliveMaxRequestCount=-1 / /Host /Engine /Service /Server ovea-inspiron (IP : 192.168.2.103) Server port=9005 shutdown=SHUTDOWN GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that
Re: Problem with using tomcat Datasource inside a servlet.
Sorry, I think you define your DataSource inside the GlobalNamingResources section, but your first jndi parameter are correct (java:comp/env/ jdbc/be_Publisher). You need a ResourceLink inside you app context. Define a file META-INF/context.xml Context ResourceLink name=jdbc/be_Publisher global=jdbc/be_Publisher type=java.sql.DataSource / /Context Links: http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Resource% 20Links http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples- howto.html Peter Am 28.01.2006 um 14:54 schrieb Legolas Woodland: Peter Rossbach wrote: Wrong lookup name: Use: java:comp/jdbc/be_Publisher Peer Am 28.01.2006 um 11:03 schrieb Legolas Woodland: java:comp/env/jdbc/be_Publisher); I change it according to your advice but it still return the same error. some more description : when i deploy the application , if i add the same data source as that image shows to my application data sources node it will works but in test env , it is very hard to define a data source each time that i run the application. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with using tomcat Datasource inside a servlet.
Wrong lookup name: Use: java:comp/jdbc/be_Publisher Peer Am 28.01.2006 um 11:03 schrieb Legolas Woodland: java:comp/env/jdbc/be_Publisher); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FarmDeployer - removing webapp on deploy?
Is your deployDir the host appBase (webapps) directory? Check that tempDir,deployDir and watchDir are exists and read/writeable at all nodes. Configure debug logging at FarmWarDeployer package conf/logging.properties org.apache.catalina.cluster.deploy.level=FINE See what happens... Peter Am 25.01.2006 um 16:24 schrieb Julie McCabe: Hello, Environment: tomcat-5.5.7, java 1.5.0_03 I have set up a vertical cluster containing 4 nodes. I am attempting to create a master farm node, the Cluster element in the master node is: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=127.0.0.1 tcpListenPort=4000 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.* \.html;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=${catalina.base}/war-temp deployDir=${catalina.base}/war-deploy watchDir=${catalina.base}/war-listen watchEnabled=true/ /Cluster The other nodes have the same Cluster element but with the watchEnabled attribute set to false on the Cluster/Deployer element. When all the nodes are running, I copy a war file into the master node CATALINA_HOME/war_listen, this is the output in the logs: 25-Jan-2006 12:35:14 org.apache.catalina.cluster.deploy.WarWatcher check INFO: check cluster wars at /media/jm/cluster/tomcat1/war-listen 25-Jan-2006 12:35:18 org.apache.catalina.cluster.deploy.FarmWarDeployer fileModified INFO: Installing webapp[/testFarm] from /media/jm/cluster/tomcat1/war-deploy/testFarm.war 25-Jan-2006 12:35:18 org.apache.catalina.cluster.deploy.FarmWarDeployer remove INFO: Cluster wide remove of web app /testFarm It seems the war file is getting deployed but then it is removed from the whole cluster. The filesystem is left with the war file getting copied into CATALINA_HOME/war-deploy on the master node plus the other 3 nodes, however the webapp is not accessible. The webapp has the distributable element as: web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameTest Farm Webapp/display-name distributable/ . Is there something im missing - perhaps it something in the webapp - although its just a hello world webapp with a single html file. Any ideas appreciated! Regards, Julie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can i upgrade just one of my clusters
You must install the same tomcat release at all boxes. The cluster protocol has changed! Peter Am 25.01.2006 um 16:45 schrieb Randy Paries: Hello, I am running a clustered env Two boxes RH9 and tomcat 5.0.24 These two boxes are clustered together via tomcat I am getting ready to ugrade them one at a time to the latest fedora and tomcat which appears to be 5.5.15 My question is during the process there will be some time that one box is in the original config and one is in the new config. Will this totally hose the clustering? Thanks for any info/help Randy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2nd Request: How do you programmatically determine Tomcat Version
OK, this is a very useful information and I add this to this information to the Server mbean. The fix included at 5.5.16. Thanks peter Am 18.01.2006 um 09:53 schrieb Rodrigo Ruiz: Hi Andy, I agree with you. The application version seems to be a relevant information piece. I guess Catalina/Server MBean would be a good place. Regards, Rodrigo Ruiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with JK connector
You must used JkEnvVar apache env var default value You envVar can be accessed with request.getAttribute(apache env var) Peter Am 18.01.2006 um 17:30 schrieb Michael Li: I added the following lines to apache httpd.conf JkEnvVar entrust-client JkEnvVar entrust-client-info JkEnvVar entrust-client-ip JkEnvVar entrust-server JkEnvVar entrust-server-ip JkEnvVar via And got the following from apache log: [Wed Jan 18 11:19:54 2006] [warn] module mod_jk.c is already added, skipping Syntax error on line 252 of /home/fundserv/app/apache/conf/httpd.conf: JkEnvVar takes two arguments, Adds a name of environment variable that should be sent to servlet-engine /fsrv/home/fundserv/app/apache/bin/apachectl startssl: httpd could not be started -Original Message- From: Mladen Turk [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 18, 2006 10:19 AM To: Tomcat Users List Subject: Re: Problem with JK connector Michael Li wrote: Hi there, Currently we use apache 1.3 and tomcat 4.1.31. We tried to connect them through JK. Everything works fine, except some special http headers are gone.=20 Because we user entrust direct, which will set some special http header in the http request. The servlets will check those headers to check the user identity. =20 If you have any tips, please let me know. http://tomcat.apache.org/connectors-doc/config/apache.html JkEnvVar is probably what you are pursuing. OTHOH you might get into trouble if the headers are set by another module. Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Secure Tomcat replication for WAN
Hey, I think you must implement your own Membership service. Then you can use a TCP Ping strategie. Regards Peter Am 14.01.2006 um 00:32 schrieb Gmail User: Has anyone implemented some replication strategy for Tomcat on WAN. It is my understanding that the regular replication mechanism that broadcasts invitations over UDP is not very suitable for this as it would broadcast to too many listeners as well as create a security risks. Also, to the best of my knowledge a static list of listeners has not been implemented yet. I attempted to test replication via a SSH tunnel and setting the replication address 127.0.0.1 yet different ports before, but somehow could not make it work. Has anyone implemented any workable solutions for this they are willing to share? Or am I missing any recent development in Tomcat replication? I am currently using 5.5.12 and soon will be using 5.5.15. Any ideas or references would be greatly appreciated. TIA, Ed - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How stable is 5.5.15?
Hey, we now start the testing phase of 5.5.15 release. I have some customer that used a 5.5.14 with the 5.5.15 cluster patches at production system. regards, Peter Am 05.01.2006 um 13:10 schrieb Ronald Klop: Hello, Sorry for pushing, but how stable can I expect Tomcat 5.5.15 to be in a clustered server? (4 nodes) We are running 5.0.28 now and it has some issues which seem to be solved in 5.5.x. Are there people running 5.5.15 in a production environment already? Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How stable is 5.5.15?
Hey Dennis, can you please, send your log information of the SessionAlreadyInvalidation errors? Every hint is welcome... thanks for testing Peter Am 05.01.2006 um 17:09 schrieb Dennis: Ronald Klop wrote: Hello, Sorry for pushing, but how stable can I expect Tomcat 5.5.15 to be in a clustered server? (4 nodes) We are running 5.0.28 now and it has some issues which seem to be solved in 5.5.x. Are there people running 5.5.15 in a production environment already? Ronald. We are. It does seem to be much more stable than the previous revisions in term of clustering. (The older revisions printed thousands of warning messages about various cluster and socket issues. We do get some SessionAlreadyInvalidated errors that I haven't tracked down yet. (I think it is when a browser submits something twice perhaps... like the IE double click maybe.) The only issue I noticed is that the trimSpaces setting in web.xml isn't acting the way it did before. (It's not trimming spaces.) -Dennis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How stable is 5.5.15?
This seems more that your application code access session attributes after the session is invalid. Review your application page flow! Peter Am 05.01.2006 um 17:27 schrieb Dennis: Peter Rossbach wrote: Hey Dennis, can you please, send your log information of the SessionAlreadyInvalidation errors? Every hint is welcome... It's actually an IllegalStateException: java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute (StandardSession.java:1009) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) The rest of the stack trace is simply the trace of the thread that executes that request. It is different depending on where I called session.getAttribute from. It seems to be able to happen pretty much anywhere I call the getAttribute method though. I'm using the default cluster configuration except I'm still on the SimpleTcpReplicationManager and I changed the multicast addess and port for our production cluster. I'm thinking of trying out the DeltaManager but I don't have any reason to suspect the Manager has anything to do with this exception. -Dennis thanks for testing Peter Am 05.01.2006 um 17:09 schrieb Dennis: Ronald Klop wrote: Hello, Sorry for pushing, but how stable can I expect Tomcat 5.5.15 to be in a clustered server? (4 nodes) We are running 5.0.28 now and it has some issues which seem to be solved in 5.5.x. Are there people running 5.5.15 in a production environment already? Ronald. We are. It does seem to be much more stable than the previous revisions in term of clustering. (The older revisions printed thousands of warning messages about various cluster and socket issues. We do get some SessionAlreadyInvalidated errors that I haven't tracked down yet. (I think it is when a browser submits something twice perhaps... like the IE double click maybe.) The only issue I noticed is that the trimSpaces setting in web.xml isn't acting the way it did before. (It's not trimming spaces.) -Dennis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DeltaManager and useDirtyFlag
It is only usefull for SimpleTcpReplicationManager. The DeltaManager can detect the change attribute and replicate only this part of the session. Peter Am 04.01.2006 um 20:18 schrieb Dennis: The clustering documentation says that the useDirtyFlag can be used to configure the number of session replications. If I remember correctly, this is only true for the SimpleTcpReplicationManager. I did a quick search through the DeltaManager code and verified that the useDirtyFlag is indeed not being used (5.5.15) My question then: Is the useDirtyFlag obsolete with DeltaManager? e.g. Is this session replicated with DeltaManager? Hashtable map = (Hashtable)session.getAttribute ( map ); map.put ( something, val ); Last time I visited this issue (5.5.9 or so), The DeltaManager did not work in the above case and I had to switch to SimpleTcpReplicationManager and set useDirtyFlag to false. If that is still the case, it seems strange that the sample server.xml with the download still has this... ==SNIP== Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true ==SNIP== Thoughts? -Dennis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cluster Administration - Hitless upgrade
I have also add ant task to automate the mod_jk 1.2.15 status worker operations. The tomcat-jkstatus-ant.jar exits inside tomcat 5.5.14 release. Here my example: Please, change the worker names - begin example jkstatus.xml ?xml version=1.0 encoding=ISO-8859-1? !-- @author Peter Rossbach -- project name=status default=status basedir=. property name=profile value=/ property file=jkstatus${profile}.properties/ property file=jkstatus${profile}.properties.default/ property name=catalina.home location=opt/apache- tomcat-5.5.14/ path id=jkstatus.path pathelement location=${catalina.home}/bin/commons-logging- api.jar/ pathelement location=${catalina.home}/server/lib/catalina- ant.jar/ pathelement location=${catalina.home}/server/lib/tomcat- jkstatus-ant.jar/ pathelement location=${catalina.home}/server/lib/tomcat- util.jar/ /path taskdef resource=org/apache/jk/status/jkstatus.tasks classpath refid=jkstatus.path/ /taskdef !-- public -- target name=status depends=-status-modjk-access description=got jk status / target name=reset depends=-status-modjk-reset description=reset jk status / !-- private -- target name=-status-modjk-access jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} resultproperty=jkstatus failOnError=false/ echoproperties prefix=jkstatus / jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} loadbalancer=loadbalancer resultproperty=lb failOnError=false/ echoproperties prefix=lb / jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} worker=node01 resultproperty=worker failOnError=false/ echoproperties prefix=worker / jkUpdate url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} workerLoadFactor=${worker.node01.lbfactor} workerRedirect=${worker.node01.redirect} workerClusterDomain=d20 workerDisabled=true workerStopped=false workerLb=${worker.node01.lb.name} worker = node01 workerType = worker/ jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} worker=node01 resultproperty=workerafter failOnError=false/ echoproperties prefix=workerafter / /target target name=-status-modjk-reset jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} resultproperty=jkstatus.before failOnError=false/ echoproperties prefix=jkstatus.before / jkReset url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} workerLb=loadbalancer / jkStatus url=${jkstatus.url} username=${jkstatus.username} password=${jkstatus.password} resultproperty=jkstatus.after failOnError=false/ echoproperties prefix=jkstatus.after / /target /project - end example jkstatus.xml --- jkstatus.properties.default -- jkstatus.host=localhost jkstatus.port=80 jkstatus.username=manager jkstatus.password=tomcat jkstatus.url=http://${jkstatus.host}:${jkstatus.port}/jkstatus --- jkstatus.properties.default -- Regards Peter Am 30.12.2005 um 13:12 schrieb Wolfgang Hackl: I would like to remove a Tomcat node from the cluster without first shutting it down to allow any requests in progess to complete. Is it possible to instruct Apache to stop routing requests to the node and failover another node yet allow all requests in progress to complete. You can do this via the status worker. It has a web interface. I tried updating the workers.properties file and setting disabled=True but it did not have any effect. It seems Apache does not re-read the file after a modification. Apache doesn't re-read its configuration. On a Unix-like operating system Apache can reload
Re: Tomcat 5.5.12 clustering - messages lost under high load
Hey Yogesh, please update to current svn head. s. following bug that now fixed: http://issues.apache.org/bugzilla/show_bug.cgi?id=37896 S. 5.5.14 Changelog the see that more bugs exists inside 5.5.12. Please, report as it works! Peter Tipp: For high load the fastasyncqueue sender mode is better. Also you don't need autoconnect! Yogesh Prajapati schrieb: The detail on Tomcat Clustering Load Testing Environment: Application: A web Portal, Pure JSP/Servlet based implementation using JDBC (Oracle 10g RAC) and OLTP in nature. Load Test Tool: Jmeter Clustering Setup: 4 nodes OS: SUSE Enterprize 9 (SP2) on all nodes (kernel: 2.6.5-7.97) Sofwares: JDK 1.5.0_05, Tomcat 5.5.12 Hardware configuration: Node #1: Dual Pentium III (Coppermine) 1 GHz, 1 GB RAM Node #2: Single Intel(R) XEON(TM) CPU 2.00GHz, 1 GB RAM Node #3: Dual Pentium III (Coppermine) 1 GHz, 1 GB RAM Node #4: Single Intel(R) XEON(TM) CPU 2.00GHz, 1 GB RAM Network Configuration: All nodes are behind Alteon Load balancer (response-time based load balancing), all have two nic cards with subnets 10.1.13.0 for load balancing network, 10.1.11.0 for private LAN. The private nic has multicast enabled. All private nic are connected to 10/100 Fast Ethernet switch. Tomcat cluster configuration (same on all nodes): Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName= org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=1000 mcastDropTime=35000 mcastBindAddr=auto / Receiver className= org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto tcpListenPort=4001 tcpThreadCount=24/ Sender className= org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled autoConnect=true keepAliveTimeout=-1 maxPoolSocketLimit=600 doTransmitterProcessingStats=true / Valve className= org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;/ Deployer className= org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ ClusterListener className= org.apache.catalina.cluster.session.ClusterSessionListener/ /Cluster Note: for the application session availability on all the nodes is must, so using pooled mode. Tomcate VM Parameters (additional switches for VM tunning): -XX:+AggressiveHeap -Xms832m -Xmx832m -XX:+UseParallelGC -XX:+PrintGCDetails -XX:MaxGCPauseMillis=200 -XX:GCTimeRatio=9 After starting tomcat on all the nodes, when I run Jmeter scripts with 20-70 concurrent user threads, the entire cluster works fine (almost 0% error) but at high number of users like 200 concurrent user threads the tomcat cluster session replication starts failing consistently and the replication messages getting lost. Here is what I get in tomcat logs on all the nodes (too many times): WARNING: Message lost: [10.1.11.95:4,001] type=[ org.apache.catalina.cluster.session.SessionMessageImpl], id=[40FC741DB987BF5161C3AEEB32570A8E- 1134732225260] java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java :92) at java.net.SocketOutputStream.write(SocketOutputStream.java:124) at org.apache.catalina.cluster.tcp.DataSender.writeData( DataSender.java:858) at org.apache.catalina.cluster.tcp.DataSender.pushMessage( DataSender.java:799) at org.apache.catalina.cluster.tcp.DataSender.sendMessage( DataSender.java:623) at org.apache.catalina.cluster.tcp.PooledSocketSender.sendMessage( PooledSocketSender.java:128) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessageData( ReplicationTransmitter.java:867) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessageClusterDomain (ReplicationTransmitter.java:460) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.sendClusterDomain( SimpleTcpCluster.java:1012) at org.apache.catalina.cluster.session.DeltaManager.send( DeltaManager.java:629) at org.apache.catalina.cluster.session.DeltaManager.sendCreateSession( DeltaManager.java:617) at org.apache.catalina.cluster.session.DeltaManager.createSession(
Re: mod_jk troubles under heavy load
a) Use a newer tomcat release 5.0.30 better 5.5.9 or higher b) 5.0.30 has a memory leak with registering stats as jk requests use request.registerRequests=false inside you worker2.properties Peter Laurent Perez schrieb: Hello I'm using Apache2 + mod_jk + Tomcat 5.0.25 for a customer web site, everything seems to work ok, but under heavy load, the following error randomly appears inside my catalina.out : 12 déc. 2005 14:46:53 org.apache.commons.modeler.Registry registerComponent FATAL: Error registering Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest39683 javax.management.InstanceAlreadyExistsException: Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest39683 at mx4j.server.MBeanServerImpl.register(MBeanServerImpl.java:1123) at mx4j.server.MBeanServerImpl.registerImpl(MBeanServerImpl.java:1054) at mx4j.server.MBeanServerImpl.registerMBeanImpl(MBeanServerImpl.java:1002) at mx4j.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:978) at org.apache.commons.modeler.Registry.registerComponent(Registry.java:871) at org.apache.jk.common.ChannelSocket.registerRequest(ChannelSocket.java:436) at org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:443) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:352) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) 12 déc. 2005 14:46:53 org.apache.jk.common.ChannelSocket registerRequest ATTENTION: Error registering request I'm puzzled with this InstanceAlreadyExistsException exception, because I'm only using one Tomcat instance, with one worker. After this error happens, the site is still running, but performance is slowly degrading, too many tomcat threads - I presume one for every mod_jk request - are created and do not seem to be cleanup up, the cpu slowly raises to 100%, and a few hours later I have to restart Tomcat because every request goes timeout. Is it a known performance problem and are there tips to avoid this ? Thanks for any input Laurent -- a href=http://in-pocket.blogspot.com;http://in-pocket.blogspot.com - Mobile world, technology and more/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session cookies on Linux
a) Setup Firefox LiveHTTPHeader Plugin or nettools http proxy to scan you traffic. When tomcat not see a JSESSIONID cookie at the request the can't associate a session. b) StandardSession Manager store all Session at shutdown app at work/Catalina/host/app/SESSIONS.ser All dirs must me writeable for your tomcat user . Peter Jan Behrens schrieb: Hi list, I have a problem with session cookies on a Linux server. Both Tomcat instances running on the machine don't seem to be able to store session data in cookies. They otherwise work just fine, just no cookies. I have obviously checked all browser settings as well as made sure that all webapps in question have the cookie flag turned on. However, Tomcat is still not setting any cookies... My set-up: - Suse Linux server (kernel 2.6.8-24.18-smp) - Multiprocessor machine with 4 GB memory - Sun VM 1.4.2_08-b03 - 2 Tomcat 5.0.28 instances Maybe this is a problem with fileset permission's? Tomcat runs as user tomcat and I think I checked each dir Tomcat needs to write into but I am not sure where cookies are normally stored in. Is this the temp dir or somewhere else? I would be very grateful for any help or suggestions as to what to do to get this fixed. TIA, Jan Jan Behrens OFFIS FuE-Bereich Betriebliches Informationsmanagement Escherweg 2 - 26121 Oldenburg - Germany Fon: +49 4 41 97 22 - 187 - Fax: +49 4 41 97 22-102 E-mail: [EMAIL PROTECTED] - URL: http://www.offis.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logout for multiple webapps.
Hmm, I have test SingleSignOn with 5.5.12 and it works for me. Peter Mathew Joseph schrieb: Yes, i am using SingleSignOn valve, but invalidate() doesn't looks like clear both sessions. Regards mathew -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 1:02 PM To: Tomcat Users List Subject: Re: Logout for multiple webapps. Use SingleSignOn Valve Host ... Valve className=org.apache.catalina.authenticator.SingleSignOn / /Host Peter Mathew Joseph schrieb: Hi, My web application consists of 2 webapps. And these are internally invoking each other. Or the user itself can make calls to any of these webapps using the common menu page. Now, when i try to logout (session.invalidate()), its not logging off from both webapp sessions. Is there any way to logoff from both sessions at a time ? I am using TOMCAT 5.5.7 and struts 1.1 Thanks Mathew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can anyone give suggestions on Best practices for Farmwardeployer in a tomcat cluster??
Hey, the current FarmWarDeployer is only support development. Active redeployment inside a cluster is very dangerous. You can have problemes with different versions of classes or the classloader not free all classes. My strategie is: setup a new catalina.base. Start the new generation servers setup the new nodes at the mod:jk config switch the old generation workers too disable state at mod_jk config. Restart apache graceful. After no sessions are active, you can shutdown the old nodes and cleanup the mod:jk config. Peter Kim Brianne Go schrieb: I'm just new to HA environments, we were able to do Apache / Tomcat Load Balancing through AJP13. Though there were few concerns on fail overs and session information, so we tried clustering tomcat servers. Everything went well and working as of the moment, I know that clustering is just like playing with fire. Without extensive knowledge could be detrimental overtime. May I ask anybody who's implemented such architecture for a best practices guide for this with the utilization of Farmwardeployer. Small concern on farmwardeployer, if the farmwardeployer server went down and was started up again. It always reloads all the application on the watchedDir path to the entire cluster. Is this normal, or we can do something about this to avoid such delays. Thanks! -- Kim Brianne Go Customer Engineer GBBTech Systems Incorporated Raffles Corporate Center 9/F Emerald Avenue, Pasig City, Philippines Tel. No.: +63 2 9105411 to 16 loc. 104 Fax No.: +63 2 9105418 Cel No.: +63 917 8314366 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]