Re: tomcat 6 session replication issues
Apr 1, 2009 3:28:42 AM org.apache.catalina.tribes.transport.nio.NioReceiver socketTimeouts WARNING: Channel key is registered, but has had no interest ops for the last 3000 ms. this is a sign of a thread being stuck, and its confirmed by the session transfer timing out. Do a thread dump on the server where you are seeing this message, that will tell us where your system is stuck Filip Jimmy Phillips wrote: Hi, I've been having issues with tomcat session replication. I have a number of tomcat servers running in a cluster mode, behind an Apache load balancer. The tomcat version is 6.0.18 on CentOS 5.1. Running the cluster using the DeltaManager seems to be working fine, however when I try to use the BackupManager for session replication, I get the following entries in the logs: Apr 1, 2009 3:28:42 AM org.apache.catalina.tribes.transport.nio.NioReceiver socketTimeouts WARNING: Channel key is registered, but has had no interest ops for the last 3000 ms. (cancelled:false):sun.nio.ch.selectionkeyi...@62af9d74 last access:2009-04-01 03:28:35.969 Apr 1, 2009 3:28:42 AM org.apache.catalina.tribes.transport.nio.NioReceiver socketTimeouts WARNING: Channel key is registered, but has had no interest ops for the last 3000 ms. (cancelled:false):sun.nio.ch.selectionkeyi...@4c4947d3 last access:2009-04-01 03:28:35.969 Apr 1, 2009 3:29:04 AM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 99, 86, 47}:4000,{10, 99, 86, 47},4000, alive=1380182,id={-121 25 -2 -7 81 -1 76 3 -92 -20 122 69 67 102 -31 -15 }, payload={}, command={}, domain={}, ]] message. Will verify. Apr 1, 2009 3:29:04 AM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 99, 86, 47}:4000,{10, 99, 86, 47},4000, alive=1380182,id={-121 25 -2 -7 81 -1 76 3 -92 -20 122 69 67 102 -31 -15 }, payload={}, command={}, domain={}, ]] Apr 1, 2009 3:29:04 AM org.apache.catalina.tribes.tipis.AbstractReplicatedMap heartbeat SEVERE: Unable to send AbstractReplicatedMap.ping message org.apache.catalina.tribes.ChannelException: Operation has timed out(6 ms.).; Faulty members:tcp://{10, 99, 86, 47}:4000; at org.apache.catalina.tribes.transport.nio.ParallelNioSender.sendMessage(ParallelNioSender.java:97) at org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessage(PooledParallelSender.java:53) at org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(ReplicationTransmitter.java:80) at org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelCoordinator.java:78) at org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75) at org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.sendMessage(ThroughputInterceptor.java:61) at org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75) at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.sendMessage(MessageDispatchInterceptor.java:73) at org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75) at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.sendMessage(TcpFailureDetector.java:87) at org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75) at org.apache.catalina.tribes.group.GroupChannel.send(GroupChannel.java:216) at org.apache.catalina.tribes.group.GroupChannel.send(GroupChannel.java:175) at org.apache.catalina.tribes.group.RpcChannel.send(RpcChannel.java:89) at org.apache.catalina.tribes.tipis.AbstractReplicatedMap.ping(AbstractReplicatedMap.java:253) at org.apache.catalina.tribes.tipis.AbstractReplicatedMap.heartbeat(AbstractReplicatedMap.java:793) at org.apache.catalina.tribes.group.GroupChannel.heartbeat(GroupChannel.java:153) at org.apache.catalina.tribes.group.GroupChannel$HeartbeatThread.run(GroupChannel.java:661) Of course the above entry is just one of many, for the different hosts. Searching the mailing lists, I found this post http://markmail.org/message/jv4dykh7fdhr4mvp which looks like the same problem I am having. The outcome of that thread states that the problem is fixed by a patch in revision 618823, so I compiled a version of the current 6.x trunk (rev 759722) and deployed it to all the servers. However, the problem is still appearing. I've attached a copy of the current server.xml ( it is common to all tomcat instances ). I've done a thread dump on one of the servers when these errors started appearing, and the output is attached, thread_dump.txt (removed threads that
Re: Session Replication in Cluster
what you're seeing is correct. the server did fail over, and by changing the session id, it ensures that it does not do fail back Filip Roy McMorran wrote: Hello all, I've built a very simple 2-member Tomcat cluster for testing, but I am unable to get the session replication quite right. The problem is when I fail one member of the cluster. The behavior I was expecting is that the other cluster member would take over the session ids for the failed member. However it is appending it's own jvmRoute value to the session id, and thus setting a new cookie. Details: I have 2 cluster members, itchy and scratchy, running on the same physical server, and CATALINA_BASE is /var/tomcat/itchy and /var/tomcat/scratchy respectively. Tomcat 6.0.18 binaries, etc. are at /usr/local/tomcat. Using mod_jk 1.2.27 on Apache 2.2.11 (Apache is also on the same server). I am using sticky sessions. Here are the access logs for the 2 members from a short failover experiment (note I'm including the session ID in the 2nd field). The session starts on scratchy. From scratchy_access_log.2009-04-02.txt: 192.168.200.177 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.scratchy - [02/Apr/2009:10:19:55 -0400] GET / HTTP/1.1 200 14612 192.168.200.177 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.scratchy - [02/Apr/2009:10:20:14 -0400] GET /about/ HTTP/1.1 200 19507 At 10:21:39 AM I do a kill -9 on the scratchy instance. Now the traffic goes to the other cluster member as expected. From itchy_access_log.2009-04-02.txt: 192.168.200.177 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.itchy - [02/Apr/2009:10:22:11 -0400] GET /about/publications/ HTTP/1.1 200 18263 192.168.200.177 E5BF3FFA9AEE1E3AB0DD4A96BA5E4011.itchy - [02/Apr/2009:10:22:32 -0400] GET /about/changes/ HTTP/1.1 200 12736 Note however that the new member's jvmRoute value is now appended to the session id. I thought is was supposed to stay exactly the same after failover. Additional details can be found as follows: server.xml for itchy - see: http://gillnet.mdibl.org/~mcmorran/itchy-server.xml.txt server.xml for scratchy - see: http://gillnet.mdibl.org/~mcmorran/scratchy-server.xml.txt context.xml (identical) - see: https://gillnet.mdibl.org/~mcmorran/context.xml.txt workers.properties: https://gillnet.mdibl.org/~mcmorran/workers.properties I've also included the catalina.out file for both, from startup and through the test at: https://gillnet.mdibl.org/~mcmorran/itchy-catalina.out https://gillnet.mdibl.org/~mcmorran/scratchy-catalina.out I'd appreciate any advice on where I went wrong. Thanks and best wishes, Roy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Catalina.log - repeating errors
This would happen if the application has been shutdown and a new request happens concurrently. Are you hot redeploying the application? most likely you are, since the other scenario would be restarting tomcat. Filip Don Millhofer wrote: Hi, we have an application that was developed using NetBeans VisualWeb, JSF/JSTL, Tomcat 6.0.16, and MySQL 5.0. The application appears to work fine for about a week - through all our tests, no problem. Then for some reason it begins to generate the following sequence of five errors/warnings every five minutes in the Catalina.log until it exceeds a gigabit, then crashes the site. We have examined the user logs and the apache error logs for the same time looking for a trigger and have found that this error ALWAYS occurs during a period of inactivity. An hour or two on each side of the start of this repeating log process. This has been going on for months and we have not been able to identify the root cause. Please if anyone can point us in the right direction we would be very great full. Thanks much, Don -- Apr 2, 2009 2:51:42 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.catalina.loader.WebappClassLoader.findResources(WebappClassLoader.java:995) at java.lang.ClassLoader.getResources(ClassLoader.java:1016) at com.sun.webui.theme.SPIThemeFactory.findJarThemeResources(SPIThemeFactory.java:759) at com.sun.webui.theme.SPIThemeFactory.getThemeResources(SPIThemeFactory.java:468) at com.sun.webui.theme.SPIThemeFactory.getTheme(SPIThemeFactory.java:178) at com.sun.webui.jsf.util.ThemeUtilities.getTheme(ThemeUtilities.java:138) at com.sun.webui.jsf.component.DropDown.getWidth(DropDown.java:469) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1585) at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1499) at javax.faces.component.UIComponent.setValueExpression(UIComponent.java:251) at com.sun.webui.jsf.component.Selector.setValueExpression(Selector.java:514) at com.sun.webui.jsf.component.DropDownTag.setProperties(DropDownTag.java:92) at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:219) at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476) at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660) at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1126) at org.apache.jsp.RecTop_jsp._jspx_meth_webuijsf_005fdropDown_005f0(RecTop_jsp.java:3692) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f23(RecTop_jsp.java:3645) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f22(RecTop_jsp.java:3602) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f20(RecTop_jsp.java:3388) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f4(RecTop_jsp.java:816) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f2(RecTop_jsp.java:650) at org.apache.jsp.RecTop_jsp._jspx_meth_h_005fpanelGrid_005f0(RecTop_jsp.java:514) at org.apache.jsp.RecTop_jsp._jspx_meth_webuijsf_005fform_005f0(RecTop_jsp.java:465) at org.apache.jsp.RecTop_jsp._jspx_meth_webuijsf_005fbody_005f0(RecTop_jsp.java:420) at org.apache.jsp.RecTop_jsp._jspx_meth_webuijsf_005fhtml_005f0(RecTop_jsp.java:280) at org.apache.jsp.RecTop_jsp._jspx_meth_webuijsf_005fpage_005f0(RecTop_jsp.java:235) at org.apache.jsp.RecTop_jsp._jspx_meth_f_005fview_005f0(RecTop_jsp.java:192) at org.apache.jsp.RecTop_jsp._jspService(RecTop_jsp.java:158) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) at
Re: apache-tomcat-jdbc-1.0.20-beta Abandoned Issue
hi Roger, DBCP works the abandonment slightly different. It doesn't 'abandon' connections unless all connections are in use. This means you wont get notified of abandoned connections until you are actually using all, or all are abandoned. So if you used DBCP, you still might experience the error if all connections are in use. I will look into a possible solution for this, Filip Roger Niederland wrote: I started testing the connection pool with our application. I have an issue with the abandon connection detection. Looking at the source code the timestamp which is used to check for abandonment is updated when the connection is created, borrowed, or returned. In our application we create a temporary table for raw data... This table is only available while using the current connection. Data in this table is processed and then saved permanently in the database. After creating/populating the temporary table the connection is kept until the data is processed, during processing queries are performed on the temporary table with this connection. The connection is being treated as abandoned after the timeout (based on the time of the borrow). Please note that this does not occur when using DBCP. It would be great to be able to have the abandoned timestamp reset when a statement is executed on the connection. If this is not possible, could it be possible to get the same connection to reset the timestamp. Any suggestions thanks - 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: Replicated context is failing...or not ?
János Löbb wrote: On Mar 29, 2009, at 8:58 PM, Caldarale, Charles R wrote: From: János Löbb [mailto:janos.l...@yale.edu] Subject: Replicated context is failing...or not ? Mar 29, 2009 11:59:47 AM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /usr/local/apache-tomcat-6.0.18/webapps/ROOT inside the host appBase has been specified, and will be ignored The above likely doesn't have anything to do with the replication problem, but on the off chance it does, you really should fix it. Looks like you have an illegal Context element somewhere. - Chuck Hi Chuck, I am looking into it, but for the first glance I see no other contexts hanging around. I found, that on one of the machines, pathsrv1, it has the Apple packaged Tomcat, I also have the following stack trace in the log when tomcat starts up: Mar 29, 2009 11:41:46 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java Mar 29, 2009 11:41:46 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Mar 29, 2009 11:41:46 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1890 ms Mar 29, 2009 11:41:46 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Mar 29, 2009 11:41:46 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.48.106.107:4000 Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 44}:4000,{10, 48, 106, 44},4000, alive=4214446187,id={123 32 103 -62 110 51 77 58 -113 -57 43 -80 4 -20 -26 -108 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 101}:4000,{10, 48, 106, 101},4000, alive=16204423,id={124 -97 -40 -51 -99 -126 69 -73 -80 74 110 -9 80 -74 64 86 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:41:47 AM org.apache.catalina.tribes.transport.nio.NioReceiver listen SEVERE: Unable to process request in NioReceiver java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) at sun.nio.ch.Net.setIntOption(Net.java:152) at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372) at sun.nio.ch.SocketOptsImpl.setInt(SocketOptsImpl.java:46) at sun.nio.ch.SocketOptsImpl$IP.typeOfService(SocketOptsImpl.java:249) at sun.nio.ch.OptionAdaptor.setTrafficClass(OptionAdaptor.java:158) at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:330) at org.apache.catalina.tribes.transport.nio.NioReceiver.listen(NioReceiver.java:273) at org.apache.catalina.tribes.transport.nio.NioReceiver.run(NioReceiver.java:353) at java.lang.Thread.run(Thread.java:613) Mar 29, 2009 11:41:47 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 this is fixed by adding |-Djava.net.preferIPv4Stack=true to your command line | I realized that I had a mispell for jvmRoute in the server.xml of reptile, where jvmRoute=reptile1 instead of jvmRoute=reptile. This will be remedied tonight. Reptile is the machine to whom pathsrv1 should fail over, so it is possible that it was also the problem with the replicated context stack trace. The real workers in the workers.properties file are pathsrv1, raid2b and reptile. Thanks ahead, János - 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: Replicated context is failing...or not ?
remove the 'docBase' attribute from context.xml Filip János Löbb wrote: Hi, 3 machines, - pathsrv1, raid2b, reptile - Macs with OSX 10.5.6. Apache 2.2.9 mod_jk 1.2.26 and Tomcat 6.0.18. Every machine has one Tomcat instance and they form a cluster. Pathsrv1 act as a reverse proxy, so the request for the only clustered web app is coming as: http://pathsrv1.yalepath.org/apps/CassetteLabeler. The application works fine. It seemingly also fails over. The session is replicated. However et every startup I see this in the catalina.date.log: snip Mar 29, 2009 11:59:44 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java Mar 29, 2009 11:59:44 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Mar 29, 2009 11:59:44 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 427 ms Mar 29, 2009 11:59:44 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Mar 29, 2009 11:59:44 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Mar 29, 2009 11:59:44 AM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.48.106.101:4000 Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Mar 29, 2009 11:59:45 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 44}:4000,{10, 48, 106, 44},4000, alive=635579,id={52 -41 110 -92 62 -31 69 -107 -125 23 -35 74 71 -34 83 -68 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:59:45 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 107}:4000,{10, 48, 106, 107},4000, alive=1078841,id={17 -73 -19 -61 -104 103 73 -81 -117 69 58 -59 78 -1 -56 -41 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Mar 29, 2009 11:59:46 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Mar 29, 2009 11:59:47 AM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /usr/local/apache-tomcat-6.0.18/webapps/ROOT inside the host appBase has been specified, and will be ignored Mar 29, 2009 11:59:47 AM org.apache.catalina.ha.context.ReplicatedContext start SEVERE: Unable to start ReplicatedContext java.lang.NullPointerException at java.io.File.init(File.java:194) at org.apache.catalina.core.StandardContext.getBasePath(StandardContext.java:4784) at org.apache.catalina.ha.context.ReplicatedContext.start(ReplicatedContext.java:62) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at
Re: Training classes for Apache web server and Tomcat
there are several companies offering training, including mine, www.springsource.com unique about springsource training classes is that they are taught by committers on the project Filip Jhary wrote: I am looking for good comprehensive training courses for installing, configuring and managing the Apache web server and the Tomcat server. Do you know of such classes being offered anywhere? Thanks, Scott - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Setting Tomcat System Properies **without** -D on Command Line
this is doable, just enter all your properties in catalina.properties first thing tomcat does is ... System.setProperties( - read catalina.properties - ) ; so you don't need them on the command line Mike Reidy wrote: Hello, I would like to be able to configure system properties at Tomcat start-up *without* adding them to the startup command line, for example you might add -Dxx.yyy.zzz=123 to the command line to add a system property called xxx.yyy.zzz with a value of 123. I want something other than this I was hoping that there might be a way of loading an additional properties file in a similar way to catalina.properties but I cannot see this in documentation. Does this exist? If so can someone point me at the documentation please. If this is not the case is there a standard way that would be the recommended way of writing a custom plugin for Tomcat to do this? Thank you for your time effort, M - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?
you sure can, you can also use org.apache.tomcat.jdbc.pool.DataSource http://tomcat.apache.org/dev/dist/jdbc-pool/1.0-beta/ Filip Edoardo Panfili wrote: Hy, can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource in place of org.apache.commons.dbcp.BasicDataSource? If yes I can avoid to put commons-pool and commons-dbcp in my webapp lib folder. Looking at Tomcat build.xml seems that the two names refers to the same thing. thank you Edoardo - 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: Tomcat and Database Problem
use the validationQuery attribute for your connection pool. the validationQuery executes a query against the database before the connection is returned to the application, and validates that the connection actually works Filip CutKiller wrote: Hi all I have this scenario: |Tomcat| - |Firewall| - |Database| Sometimes the connection to the database is lost. The cause of this fact maybe lives in the Firewall. But, the major problem, resides in Tomcat. He doesn't recognize the connection break. What can i do, for Tomcat knows when the connections break? Best Regards, Rodrigo - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tracing port to port
wireshark.org André Warnier wrote: Hi. I know this is only tenuously Tomcat-related, and apologise in advance. I'll be content with one-liners. I have to trace the byte data that circulates back and forth between a Tomcat servlet (the tenuous connection) and a separate Java daemon to which the servlet establishes this connection. Both are running on the same Linux host. My purpose is legitimate, but I do not have the source code of either of these modules. I would like to be able just to figure out in as readable a way as possible, what charset/encoding is being used in one direction and in the other (not necessarily the same). I am not interested in the TCP protocol details, just the data inside the packets. A tool that shows what is being exchanged in the least cryptic way possible would have my preference, and one that allows me to choose the charset in which I display ditto would be even better. Which one would you here gurus recommend ? Thanks - 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: tomcat database connection pool
don't forget the best mail archive browser that I have encountered *http://tinyurl.com/blhhks* Real URL: http://tomcat.markmail.org/search/?q=How%20to%20close%20open%20connections%20after%20application%20stop#query:How%20to%20close%20open%20connections%20after%20application%20stop%20list%3Aorg.apache.tomcat.users+page:1+mid:2g4sdltz6wosa4d2+state:results Caldarale, Charles R wrote: From: Carol Cheung [mailto:cache...@consumercontact.com] Subject: tomcat database connection pool In tomcat 5.5, the database connection pool associated with my application does not seem to shutdown when I undeploy the application. You don't say if the DBCP is managed by the container (Tomcat) or by your webapp. If it's the former, the pool will persist for the life of Tomcat (but see the link below). If the latter, your best bet is to implement a ServletContextListener that will explicitly shut down the pool when the contextDestroyed() method is called. The servlet spec even uses this situation as an example. An easier link to follow for the previously reference discussion thread is this: http://marc.info/?l=tomcat-userm=123529838331464w=2 And the critical messages of the thread: http://marc.info/?l=tomcat-userm=123532841602124w=2 http://marc.info/?l=tomcat-userm=123532986503723w=2 - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Clustering trouble when starting up under high load
hi Mikel, when setting a property on the Manager you omit the manager. prefix, just as you stated. To do thread dumps with JDK 1.5 under windows, you can use the tanuki service wrapper http://people.apache.org/~fhanik/wrapper.html The tomcat team might have added that feature to the Tomcat wrapper too, you'd have to check Filip Mikel Ibiricu wrote: Hi Rainer, thanks for your response. I tried the config you suggested. It suppose the way of configuring those parameters is as you said, but skipping manager. from the begining, as when I tried as you said, I got this in the catalina. log: 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessions' to 'false' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsSize' to '200' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsWaitTime' to '0' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin Maybe without the manager prefix? sendAllSessions=false, sendAllSessionSize=200 and sendAllSessionsWaitTime=? Filip, we consider taking thead dumps, but we are using jdk 1.5 under windows. I heard it is not supported in Windows until jdk 1.6. Is it true? Best regards Mikel 2009/3/9 Rainer Jung rainer.j...@kippdata.de On 09.03.2009 09:24, Mikel Ibiricu wrote: So, It works OK but when starting up one of the nodes with over 500 sessions alive in the other, it doesn't replicate anything. We assume that it would not be able to replicate everything... but why it does either replicate everything or nothing? If it's not able replicate all the sessions, we would assume it, but we would like to replicate at least something... Maybe some trouble with the config we are trying? We tried to limit the keepAliveCount of the senders, without improvement with this. Reading the DeltaManager code, I have seen the sendAlllSessions parameter. According to in-line javadoc and the implementation, /** * handle receive that other node want all sessions ( restart ) * a) send all sessions with one message * b) send session at blocks * After sending send state is complete transfered * @param msg * @param sender * @throws IOException */ protected void handleGET_ALL_SESSIONS(SessionMessage msg, Member sender) throws IOException { [...] if (isSendAllSessions()) { sendSessions(sender, currentSessions, findSessionTimestamp); } else { // send session at blocks int len = currentSessions.length getSendAllSessionsSize() ? currentSessions.length : getSendAllSessionsSize(); Session[] sendSessions = new Session[len]; for (int i = 0; i currentSessions.length; i += getSendAllSessionsSize()) { len = i + getSendAllSessionsSize() currentSessions.length ? currentSessions.length - i : getSendAllSessionsSize(); System.arraycopy(currentSessions, i, sendSessions, 0, len); sendSessions(sender, sendSessions,findSessionTimestamp); if (getSendAllSessionsWaitTime() 0) { try { Thread.sleep(getSendAllSessionsWaitTime()); } catch (Exception sleep) { } }//end if }//for }//end if SessionMessage newmsg = new SessionMessageImpl(name,SessionMessage.EVT_ALL_SESSION_TRANSFERCOMPLETE, null,SESSION-STATE-TRANSFERED, SESSION-STATE-TRANSFERED+ getName()); newmsg.setTimestamp(findSessionTimestamp); if (log.isDebugEnabled()) log.debug(sm.getString(deltaManager.createMessage.allSessionTransfered,getName())); counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE++; cluster.send(newmsg, sender); } it may cover our expectatives, so I tried to include sendAllSessions=false in the cluster manager configuration Manager className=org.apache.catalina.ha.session.DeltaManager name=clusterPruebas6 stateTransferTimeout=180 expireSessionsOnShutdown=false notifyListenersOnReplication=false sendAllSessions=false/ But it seems like this parameter is not configurable from the server.xml file. So, what can I do to force that if it's not posible to replicate all the sessions, at least replicate something in the startup? If you want to test with sendAllSessions set to false, then add manager.sendAllSessions=false to the Manager element of the
Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
hi Brian, this is not really tomcat clustering, but more httpd load balancing. Disable reuse is available on two modules, mod_jk and mod_proxy, that is why you get hits for mod_jk as well when you google. syntax is case sensitive, and yes, you would add it to the end of the BalancerMember Filip Alston, Brian (US SSA) wrote: Ok ... I feel like a moron but I cannot figure out how to use disablereuse option. When I google for examples on disablereuse, what I find is that in my httpd.conf file I need to add the line JkOptions +DisableReuse. However, reading the information here (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html) it looks like I need to add disablereuse=On to the end of the line BalancerMember http://192.168.1.101:8080 loadfactor=1. I am extremely new at this Tomcat clustering process, so any leniency and help will be very much appreciated. Thanks Have a great day. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 1:22 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem Alston, Brian (US SSA) wrote: Filip Thank you for your help. I made the changes like you suggested: changed stickysession-jsessionid to stickysession=JSESSIONID|jsessionid I already had stickysession=jsessionid (it was a typo here in my post) but I added the pipe and uppercase JSESSIONID my server.xml already had the line you suggested. If I use disablereuse=On won't I then have problems with my cookies and sessions? disable reuse will not affect your cookies or sessions Filip Again, thank you very much for your help. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 12:42 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location /examples ProxyPass balancer://tccluster/examples stickysession-jsessionid ProxyPassReverse balancer://tccluster/examples Order Deny,Allow Allow from all /Location /IfModule From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 11:29 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's
Re: Regarding Tomcat 5.5 clustering
to test failover setup a simple load balancer, like 'pen' or more advanced like the apache web server 'httpd' and hit the load balancer with requests Filip welcome.partha wrote: Hi Everyone, Now i am trying to creating the clustering in tomcat5.5.17. I have downloaded tomcat 5.5.17.In server.xml i made some changes.Herewith I have uploaded the server.xml.Then I have downloaded another tomcat 5.5.17.In that server.xml i made some changes.I have uploaded that server.xml also.i started my first tomcat instance.after that i started my second one that time i am getting the replication member added message in tomcat one.If i close the second one that time i am getting replication member disappeared.How should i check my application is working with cluster is fine or not.and if i put my application in one tomcat instance of webapps folder or both?thanks in advance. Regards, P.Parthasarathi http://www.nabble.com/file/p22454690/server.xml server.xml http://www.nabble.com/file/p22454690/server.xml server.xml - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's say web002), I will sometimes get the following error message when I refresh the page: - - - - - - - - - - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /examples/instance.html. Reason: Error reading from remote server Apache/2.2.3 (Red Hat) Server at 150.37.0.20 Port 80 - - - - - - - - - - I don't receive this error message every single time I refresh the page but I do get it often. It looks like Apache http server is still trying to access the Tomcat server web002 even though it is down. Does this sound like I have an incorrect configuration to anybody or is this normal? I would not think that it was normal, as clustering is supposed to prevent errors like this. I have been following the examples in the O'Reilly book Tomcat: The Definitive Guide in chapter 10 - Tomcat Clustering. Any help anybody can provide will be greatly appreciated. Thank you for reading, have a good day. - 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: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location /examples ProxyPass balancer://tccluster/examples stickysession-jsessionid ProxyPassReverse balancer://tccluster/examples Order Deny,Allow Allow from all /Location /IfModule From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 11:29 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's say web002), I will sometimes get the following error message when I refresh the page: - - - - - - - - - - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /examples/instance.html. Reason: Error reading from remote server Apache/2.2.3 (Red Hat) Server at 150.37.0.20 Port 80 - - - - - - - - - - I don't receive this error message every single time I refresh the page but I do get it often. It looks like Apache http server is still trying to access the Tomcat server web002 even though it is down. Does this sound like I have an incorrect configuration to anybody or is this normal? I would not think that it was normal, as clustering is supposed to prevent errors like this. I have been following the examples in the O'Reilly book Tomcat: The Definitive Guide in chapter 10 - Tomcat Clustering. Any help anybody can provide will be greatly appreciated. Thank you for reading, have a good day. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
Alston, Brian (US SSA) wrote: Filip Thank you for your help. I made the changes like you suggested: changed stickysession-jsessionid to stickysession=JSESSIONID|jsessionid I already had stickysession=jsessionid (it was a typo here in my post) but I added the pipe and uppercase JSESSIONID my server.xml already had the line you suggested. If I use disablereuse=On won't I then have problems with my cookies and sessions? disable reuse will not affect your cookies or sessions Filip Again, thank you very much for your help. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 12:42 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location /examples ProxyPass balancer://tccluster/examples stickysession-jsessionid ProxyPassReverse balancer://tccluster/examples Order Deny,Allow Allow from all /Location /IfModule From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 11:29 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's say web002), I will sometimes get the following error message when I refresh the page: - - - - - - - - - - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /examples/instance.html. Reason: Error reading from remote server Apache/2.2.3 (Red Hat) Server at 150.37.0.20 Port 80 - - - - - - - - - - I don't receive this error message every single time I refresh the page but I do get it often. It looks like Apache http server is still trying to access the Tomcat server web002 even though it is down. Does this sound like I have an incorrect configuration to anybody or is this normal? I would not think that it was normal, as clustering is supposed to prevent errors like this. I have been following the examples in the O'Reilly book Tomcat: The Definitive Guide in chapter 10 - Tomcat Clustering. Any help anybody can provide will be greatly appreciated. Thank you for reading, have a good day. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional
Re: making compression work using GzipInterceptor in tomcat cluster
hi Amit, I will take a look Filip Amit Chandel wrote: I have been able to set up a working tomcat cluster with 2 physically separate tomcat instances (IP: 172.17.1.102 and 172.17.1.103) with tomcat version 6.0.10, using following config (showing just one here, the other one is similar instead the jvmRoute and Receiver address attribute): Engine name=Catalina defaultHost=localhost jvmRoute=tomcat1 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=10 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=224.0.0.3 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=172.17.1.102 port=4000 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.txt;.*\.css/ Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/ ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine I am using Apche 2.2 and mod_jk 1.2.27 (for load balancing and session affinity). This works great, and sessions are replicated nicely, but I now want to add compression of data while its being sent for session replication. I tried adding the interceptor Interceptor className=org.apache.catalina.tribes.group.interceptors.GzipInterceptor / between the TcpFailureDetector, and MessageDispatch15Interceptor under the Channel node. But I am getting the follwing error on both the instances: Feb 27, 2009 11:37:58 AM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Feb 27, 2009 11:37:58 AM org.apache.catalina.tribes.group.interceptors.GzipInterceptor messageReceived SEVERE: Unable to decompress byte contents java.io.IOException: Not in GZIP format at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:132) at java.util.zip.GZIPInputStream.init(GZIPInputStream.java:58) at java.util.zip.GZIPInputStream.init(GZIPInputStream.java:68) at org.apache.catalina.tribes.group.interceptors.GzipInterceptor.decompress(GzipInterceptor.java:83) at org.apache.catalina.tribes.group.interceptors.GzipInterceptor.messageReceived(GzipInterceptor.java:57) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:243) at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:226) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:185) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:88) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Feb 27, 2009 11:37:59 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp:// 172.17.1.103:4000,172.17.1.103,4000, alive=1010,id={-112 -66 -20 -50 7 121 75 126 -103 -85 -56 55 21 -112 36 88 }, payload={}, command={}, domain={}, ] I guess, this means the Sender is not sending the compressed data, but the receiver is assuming compressed data, and trying to decompress it, and erroring.
Re: Tribes
that is cause *one* of my flaws as a developer is that I'm not very good at writing and maintaining docs there is a bit more here http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-channel.html the rest is in the code of the library, which isn't that big. if you have any specific questions let me know Filip Jorge Medina wrote: Is there a way to get more documentation on the Tribes package ? I would like to reuse the dynamic membership discovery feature of Tribes, but many of the links are not working on the page http://tomcat.apache.org/tomcat-6.0-doc/tribes/introduction.html Thanks -Jorge - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Clustering probleme
It's a serialization error. One of the attributes in your session that was serialized on serverA, failed to deserialize on serverB Are you possible running different versions of the same class on the two servers? Filip Stephane DUCAS wrote: Hello I've tryed vertical clustered tomcat installation (two instances) but I have an issue when configuraiong it with: ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ When I comment out this line I have no problem but session is not recovered when one node crash When I put this line, loadbalancing don't work (only one node is really hitted) I have this exception in log files of the unhitted node: java.lang.IllegalStateException: unread block data at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2377) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1361) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:361) at org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:255) at org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:621) at org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1379) at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1334) at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1093) at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:87) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:899) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:880) at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.messageReceived(ThroughputInterceptor.java:86) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241) at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:188) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:91) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) I've tryed with sun jdk's 1.5, 1.6 and open jdk (both 64bit and 32bit) but I have always the same.. I running with mod_jk and sticky_session=true.. Here are my conf files: Server.xml (node1 and node2 are the same except jvMRoute and some ports): ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/server.html -- Server port=10005 shutdown=SHUTDOWN !--APR library loader.
Re: nio connector configuration
peter, if you post your test code packaged in such a way that who ever helps you doesn't have to reverse engineer your app to setup the test case and test it locally, then you most likely wont have to pay anyone to help you. The more effort you provide in providing information to the list, including a reproducible test case, then someone, possibly me, will help you out for free. However, if it would take someone more than 10 minutes and they still can't setup your example, then no one will try it for free. Even if you paid someone, they would ask for the same info, however, they would charge you for the time it took to setup and reproduce your example. and that is the difference between free support and paid support. with free support, you do the work, someone helps you with paid support, you pay someone to do the work that you could have done, the help and the answer in the end will most likely be the same. If you want paid support or consulting, you can get that from many different companies, including the one I work for, www.springsource.com Filip Peter Warren wrote: Sorry to bump this thread. I'm willing to pay for some assistance if anyone's interested in helping. I'm trying to figure out 2 problems when running my system under a light-moderate load test: 1) why do my comet timeout events not get generated on time (supposed to be every 50 seconds, averaging 56s, with many refused connections skewing the average down, max 85s)? 2) why is tomcat refusing connections under what seems to be a reasonable load? I'm happy to do more legwork on my own -- just looking for some pointers here. Can anyone help me out? Looking at JConsole, 2 items that look suspicious: 1) blocked http-acceptor threads, and 2) block-poller and client-poller threads that show a high number of blocks (see below). Also, the non-comet http requests are returning quickly, averaging ~150ms, so it seems to be only my comet requests that are having issues. Running a load test with 600 total client threads averaging 14 requests/sec. 300 threads making normal http requests, 300 threads making comet requests that wait 50 seconds for a server timeout. Tomcat 6.0.18 on Windows XP. Connector port=80 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=1000 acceptorThreadCount=5 acceptorThreadPriority=10 pollerThreadCount=5 pollerThreadPriority=10 redirectPort=8443 enableLookups=false / after 1/2 hour running: normal http requests: 2 samples, averaging 150 ms, ~.5% error comet requests: 1 samples, averaging 56s, ~3.5% error Information from JConsole: CPU avg: 5-10% threads: stable @ ~300 memory: stable @ ~130MB Thread status from JConsole of the http-acceptor, block-poller, and client-poller threads: Name: http-80-Acceptor-0 State: BLOCKED on java.lang.obj...@17a82f1 owned by: http-80-Acceptor-4 Total blocked: 132 Total waited: 0 Stack trace: sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1198) java.lang.Thread.run(Unknown Source) - Name: http-80-Acceptor-1 State: BLOCKED on java.lang.obj...@17a82f1 owned by: http-80-Acceptor-4 Total blocked: 129 Total waited: 0 Stack trace: sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1198) java.lang.Thread.run(Unknown Source) - Name: http-80-Acceptor-2 State: BLOCKED on java.lang.obj...@17a82f1 owned by: http-80-Acceptor-4 Total blocked: 122 Total waited: 0 Stack trace: sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1198) java.lang.Thread.run(Unknown Source) - Name: http-80-Acceptor-3 State: BLOCKED on java.lang.obj...@17a82f1 owned by: http-80-Acceptor-0 Total blocked: 166 Total waited: 0 Stack trace: sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1198) java.lang.Thread.run(Unknown Source) - Name: http-80-Acceptor-4 State: BLOCKED on java.lang.obj...@17a82f1 owned by: http-80-Acceptor-0 Total blocked: 133 Total waited: 0 Stack trace: sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1198) java.lang.Thread.run(Unknown Source) - Name: http-80-ClientPoller State: RUNNABLE Total blocked: 17,950 Total waited: 5 Stack trace: sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked sun.nio.ch.uti...@f7b8fc - locked java.util.collections$unmodifiable...@195afdb - locked
Re: Fatal error: Cleaner terminated abnormally
search the sun database, some results there http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521677 supposedly fixed in Java 7 :( Filip Taylan Develioglu wrote: Hi Guys, Our application is a servlet running in a container in Tomcat standalone. It uses the following NIO connector definition: Connector port=80 protocol=org.apache.coyote.http11.Http11NioProtocol connectionTimeout=65000 keepAliveTimeout=1 maxKeepAliveRequests=1000 redirectPort=443 maxThreads=2000/ Lately we've been experiencing a fatal error, related to gc, with Tomcat that causes it to stop and unload, which I hoped you could give some advice for. I'm still unclear on what is causing the cleaner to terminate, but I guess that's more of a question for the java forums (I cannot find anything related to tomcat when I cross reference) Following the gc trail, it looks like an oom situation (maybe a mem leak in our application, our heapsize is 4GB), is it normal behavior for tomcat to destroy itsself like this? Has anyone experienced a similar problem before? What are usual causes for Tomcat to stop like this? *Any* advice or feedback is welcome. Either way, thanks in advance. Debian 4.0 Tomcat 6.0.18 Sun jdk 1.6.0.11 We use the following java options: OPTS= -verbose:gc -Dsun.net.inetaddr.ttl=60 -Dfile.encoding=UTF-8 -Djava.io.tmpdir=$TMP_DIR -Djava.library.path=/usr/local/lib -Djava.endorsed.dirs=$CATALINA_BASE/endorsed -Dcatalina.base=$CATALINA_BASE -Dcatalina.home=$CATALINA_HOME -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode -Xms4096M -Xmx4096M -Xss128k -XX:PermSize=256M -XX:MaxPermSize=256M --- catalina.out snippet [GC 4052829K-3924296K(4177280K), 0.0519680 secs] [GC 4060616K-3924100K(4177280K), 0.1517880 secs] [GC 4060420K-3926867K(4177280K), 0.0883940 secs] [GC 4062488K-3931589K(4177280K), 0.1008470 secs] [GC 4067906K-3935097K(4177280K), 0.0931530 secs] [GC 4071417K-3934946K(4177280K), 0.0787300 secs] [GC 4029027K(4177280K), 0.1941170 secs] java.lang.Error: Cleaner terminated abnormally at sun.misc.Cleaner$1.run(Cleaner.java:130) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.Cleaner.clean(Cleaner.java:127) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:124) Caused by: java.lang.Error: java.io.IOException: Broken pipe at sun.nio.ch.Util$SelectorWrapper$Closer.run(Util.java:97) at sun.misc.Cleaner.clean(Cleaner.java:125) ... 1 more Caused by: java.io.IOException: Broken pipe at sun.nio.ch.EPollArrayWrapper.interrupt(Native Method) at sun.nio.ch.EPollArrayWrapper.interrupt(EPollArrayWrapper.java:242) at sun.nio.ch.EPollSelectorImpl.wakeup(EPollSelectorImpl.java:170) at sun.nio.ch.SelectorImpl.implCloseSelector(SelectorImpl.java:92) at java.nio.channels.spi.AbstractSelector.close(AbstractSelector.java:91) at sun.nio.ch.Util$SelectorWrapper$Closer.run(Util.java:95) ... 2 more Feb 17, 2009 12:10:38 AM org.apache.coyote.http11.Http11NioProtocol pause INFO: Pausing Coyote HTTP/1.1 on http-80 Feb 17, 2009 12:10:38 AM org.apache.coyote.http11.Http11AprProtocol pause INFO: Pausing Coyote HTTP/1.1 on http-443 Feb 17, 2009 12:10:38 AM org.apache.coyote.ajp.AjpAprProtocol pause INFO: Pausing Coyote AJP/1.3 on ajp-8009 [GC 4071265K-3937784K(4177280K), 0.0921220 secs] Feb 17, 2009 12:10:39 AM org.apache.catalina.core.StandardService stop INFO: Stopping service Catalina Feb 17, 2009 12:10:39 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 28,017 instance(s) to be deallocated Feb 17, 2009 12:10:41 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 27,669 instance(s) to be deallocated Feb 17, 2009 12:10:42 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 27,666 instance(s) to be deallocated Feb 17, 2009 12:10:43 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 3 instance(s) to be deallocated Feb 17, 2009 12:10:44 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 3 instance(s) to be deallocated Feb 17, 2009 12:10:45 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 3 instance(s) to be deallocated 360358820 [SocketConnectorIoProcessor-0.0] null org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception. java.lang.NullPointerException at org.apache.mina.common.ByteBuffer.allocate(ByteBuffer.java:225) at org.apache.mina.common.ByteBuffer.allocate(ByteBuffer.java:208) at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:210) at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198) at
Re: Trouble with cluster and JMX
Eric B. wrote: Filip Hanik - Dev Lists devli...@hanik.com wrote in message news:49937f4b.9050...@hanik.com... sure turn on org.apache.catalina.ha.level = FINE org.apache.catalina.tribes.level = FINE in logging.properties however, regular membership discovery over multicast show up even without these entries did you mark your webapp distributable/ Crap. Now that you mention it, I think I forgot to do that. Will have to check up on that tomorrow. However, after a bunch of fiddling around, putting the Manager within the context element got session replication working, even if it isn't marked as distributable /. Would that be expected behaviour by putting the Manager in the context? yes, when web.xml has distributable/, that's what tomcat does internally, swaps out the manager Will check tomorrow and post findings. Thanks, Eric - 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: Simple Tomcat 6, servlet tutorial. First draft for comment
you'd write it yourself for example, configure CATALINA_HOME, CATALINA_BASE, TOMCAT_USER and CATALINA_PID and to start you would do start() { isrunning if [ $? -eq 0 ]; then echo Tomcat is already running: PID=$PID return 1 fi if [ -f $CATALINA_BASE/bin/startup.sh ]; then echo Starting Tomcat /bin/su $TOMCAT_USER $CATALINA_HOME/bin/startup.sh PID=`cat $CATALINA_PID` echo Tomcat started: PID=$PID fi } the is running function would check to see if the PID exists the stop function would issue a kill, then sleep X seconds and then issue a kill -9 if the process is still running Filip Dave Pawson wrote: 2009/2/10 Filip Hanik - Dev Lists devli...@hanik.com: What benefit do you get from running it with JSVC, vs just writing a simple script into /etc/init.d/ to manage it yourself? It was offered. I went to the trouble of amending it to make it work. I do manage it myself? How would another script in init.d help? regards Filip Dave Pawson wrote: http://www.dpawson.co.uk/tomcat Any feedback/improvements appreciated. Particularly any errors. Meant as a simple example of getting a first servlet working, based on help I received from this list. regards - 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: Trouble with cluster and JMX
sure turn on org.apache.catalina.ha.level = FINE org.apache.catalina.tribes.level = FINE in logging.properties however, regular membership discovery over multicast show up even without these entries did you mark your webapp distributable/ Filip Eric B. wrote: Filip Hanik - Dev Lists devli...@hanik.com wrote in message news:499242de.2090...@hanik.com... log looks good, the warning could be that you are using an old configuration option take a look at http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html also, what could mean that it doesn't work, would be that multicast is not working for you, and you need to enable multicast. I've ensured that multicast is enabled. I've added the multicast route to the routing tables. I've even checked my multicast route between 2 machines by pinging 224.0.0.1 and getting replies from both machines. However, I still don't see any of the cluster beans in jConsole. Any ideas? you can also set up static members, http://tomcat.markmail.org/search/?q=cluster%20static%20member#query:cluster%20static%20member%20list%3Aorg.apache.tomcat.users%20date%3A200707-200902%20from%3A%22SANCHEZ%2C%20Michel%22+page:1+mid:slqnel56c2lougo3+state:results Thanks, but I would prefer having auto-detection if possible. Right now, I'm trying to figure out how to log / debug the information to ensure that everything is being sent, however, like I said, I don't even see the beans exposed in jConsole MBeans anywhere. Is there any other way to enable logging of the cluster? Thanks! Eric Using CATALINA_BASE: /opt/tomcat6 Using CATALINA_HOME: /opt/tomcat6 Using CATALINA_TMPDIR: /opt/tomcat6/temp Using JRE_HOME: /usr/java/jre1.6.0_11 Feb 11, 2009 10:25:06 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Feb 11, 2009 10:25:06 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 549 ms Feb 11, 2009 10:25:06 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Feb 11, 2009 10:25:06 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Feb 11, 2009 10:25:06 AM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Feb 11, 2009 10:25:06 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/208.85.114.235:4000 Feb 11, 2009 10:25:06 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Feb 11, 2009 10:25:06 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Feb 11, 2009 10:25:06 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{-48, 85, 114, -22}:4000,{-48, 85, 114, -22},4000, alive=66125434,id={-6 13 31 84 -113 28 73 39 -74 -91 122 -127 80 3 -54 -93 }, payload={}, command={}, domain={}, ] Feb 11, 2009 10:25:07 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Feb 11, 2009 10:25:07 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Feb 11, 2009 10:25:07 AM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Feb 11, 2009 10:25:08 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Feb 11, 2009 10:25:19 AM org.apache.catalina.ha.session.JvmRouteBinderValve start INFO: JvmRouteBinderValve started Feb 11, 2009 10:25:19 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Feb 11, 2009 10:25:19 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Feb 11, 2009 10:25:20 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/36 config=null Feb 11, 2009 10:25:20 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 13590 ms - 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: comet end vs. client_disconnect
Peter Warren wrote: How do I distinguish between a comet END event generated due to a client disconnect and an end event generated for some other reason? I'm using tomcat 6.0.18 with the nio connector. On both windows xp sp3 and ubuntu 8.10, I'm seeing END events generated when a client disconnects and for other situations. I never receive error events with a subtype of CLIENT_DISCONNECT, which is what I was expecting when a client disconnects. In the aio docs, I read: End will also be called when data is available and the end of file is reached on the request input (this usually indicates the client has pipelined a request). So END events get generated on a client disconnect but may also get generated for pipelined requests. So how can I tell definitively if a client disconnects? I also read: note: some of these events require usage of the org.apache.catalina.valves.CometConnectionManagerValve so I enabled the CometConnectionManagerValve, but still I don't receive error events with a CLIENT_DISCONNECT subtype. I've got stack traces for the 2 situations I encounter that generate end events. This partial stack is from a client disconnect that generates an END event: Http11NioProcessor.event(SocketStatus) line: 750 Http11NioProtocol$Http11ConnectionHandler.event(NioChannel, SocketStatus) line: 653 NioEndpoint$SocketProcessor.run() line: 2081 This partial stack is from something other than a client disconnect (maybe a pipelined request?) that generates an END event: Http11NioProcessor.process(NioChannel) line: 880 Http11NioProtocol$Http11ConnectionHandler.process(NioChannel) line: 719 NioEndpoint$SocketProcessor.run() line: 2081 Note that the traces diverge at NioEndpoint$SocketProcessor.run() line: 2081 due to the value of NioEndpoint$SocketProcessor.status, which is null in the second case. Is there a configuration issue that I can remedy to start receiving error events with subtype CLIENT_DISCONNECT? Barring that, is there some flag in the CometEvent or some object accessible from the CometEvent that I can use to tell if an END event was generated due to a client disconnect? CLIENT_DISCONNECT is only used a subtype of ERROR and that happens when the socket is closed from the client side Filip Thanks, Peter - 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: Session replication problem
that's easy I need server1.tomcat8080 server2.tomcat8080 to replicate their sessions make sure 8080 server have Membership port=X/ and server1.tomcat8081 server2.tomcat8081 to replicate their sessions and Membership port=Y/ http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-membership.html having a unique port will divide the membership Filip Mohamedin wrote: Let me give an example: I have server1 with tomcat8080 tomcat8081 server2 also with tomcat8080 tomcat8081 I need server1.tomcat8080 server2.tomcat8080 to replicate their sessions and server1.tomcat8081 server2.tomcat8081 to replicate their sessions What I see in the log is all see all sessions e.g. server1.tomcat8080, server2.tomcat8080, server1.tomcat8081 server2.tomcat8081 replicate the sessions all together Thanks a lot, Mohamedin - Original Message - From: Filip Hanik - Dev Lists devli...@hanik.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, February 10, 2009 4:10 AM Subject: Re: Session replication problem Mohamedin wrote: I have a problem with Session replication. I am running multible tomcat instance on the same server. And I have 4 servers of the same configuration (Multible tomcat instances). I have enabled the session replication on these 4 servers (In each instance with different port). The problem is that All instances see each other. while I only need similar instances to see each other. I'm not sure I understand what you are trying to achieve, what do you mean by similar Filip The config: Engine name=Catalina defaultHost=localhost jvmRoute=myserver Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=8 Manager className=org.apache.catalina.ha.session.DeltaManager expireSessionsOnShutdown=false notifyListenersOnReplication=true domainReplication=true / Channel className=org.apache.catalina.tribes.group.GroupChannel Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender / /Sender Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=245.245.245.245 port= autoBind=100 selectorTimeout=5000 maxThreads=6 / Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector / Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Intercepto r / Interceptor className=org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.246 domain=245.245.245.246 / Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.247 domain=245.245.245.247 / Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.248 domain=245.245.245.248 / /Interceptor /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= / ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener / ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener / /Cluster . . . other instances use the same config (Only different port) In the log I see: 07.02.2009 18:08:19 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/../lib/amd64 07.02.2009 18:08:20 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8083 07.02.2009 18:08:20 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 483 ms 07.02.2009 18:08:20 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 07.02.2009 18:08:20 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.16 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start 07.02.2009 18:08:20
Re: Clustering: Session replication
For each Tomcat set Receiver address=your-ip-goes-here ... / http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-receiver.html that way you broad cast your-ip-goes-here instead. alternatively, setup your hostname properly, and make sure the hostname resolves to the IP address, and not 127.0.0.1 Filip Jorge Medina wrote: Hi, I am trying to configure session replication using the Cluster object. The documentation says: The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() (make sure you don't broadcast 127.0.0.1, this is a common error) I just wrote a small java program to see what my system return for java.net.InetAddress.getLocalHost().getHostAddress() It returns 127.0.0.1 Is this something that needs to be changed by modifying the network configuration of the box? -Jorge - 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: Trouble with cluster and JMX
log looks good, the warning could be that you are using an old configuration option take a look at http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html also, what could mean that it doesn't work, would be that multicast is not working for you, and you need to enable multicast. you can also set up static members, http://tomcat.markmail.org/search/?q=cluster%20static%20member#query:cluster%20static%20member%20list%3Aorg.apache.tomcat.users%20date%3A200707-200902%20from%3A%22SANCHEZ%2C%20Michel%22+page:1+mid:slqnel56c2lougo3+state:results Filip Eric B. wrote: Hi, I'm brand new to clustering and read through the docs at http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html to get a better understanding of how it works. I tried the settings I would have expected to work, and on startup, I can see both tomcat's communicate and join the cluster (via standard logging). However, it seems as though my sessions are not replicating properly. Given that I probably messed something up along the line, I wanted to try and see if I could enable better logging. At the bottom of the how-to page, it indicates that monitoring can be done via JMX. So I enabled JMX, and launched jConsole to connect. However, once connected, I don't see any cluster MBeans defined anywhere. Am I missing something obvious somewhere? I've pasted an excerpt of my startup log at the bottom that indicates (I think) that the cluster has launched properly. However, the only MBeans I see are the JvmRouteBinderValve and ReplicationValve listed under the Valve bean. I don't see any beans for Cluster or for the Manager. I have tried both with the cluster configuration under the Host and Engine with no difference. I did get one warning (see below) regarding the SimpleTcpCluster, but didn't expect that to be anything critical as I am using all the default params. I figure there must be another way to enable some more detailed logging elsewhere so that I can see the tomcat instances communicating. Can anyone direct me to the right place how/where to enable that? I can't seem to find that in the docs anywhere. Thanks for any help! Eric Feb 10, 2009 5:32:22 PM org.apache.catalina.ha.tcp.SimpleTcpCluster setProperty WARNING: Dynamic setProperty(className,value) has been disabled, please use explicit properties for the element you are trying to identify INFO: Starting Servlet Engine: Apache Tomcat/6.0.14 Feb 10, 2009 5:14:54 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Feb 10, 2009 5:14:54 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/192.168.103.103:4000 Feb 10, 2009 5:14:54 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Feb 10, 2009 5:14:54 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Feb 10, 2009 5:14:55 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Feb 10, 2009 5:14:55 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Feb 10, 2009 5:14:56 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 ... ... Feb 10, 2009 5:33:27 PM org.apache.catalina.ha.session.JvmRouteBinderValve start INFO: JvmRouteBinderValve started - 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: Simple Tomcat 6, servlet tutorial. First draft for comment
What benefit do you get from running it with JSVC, vs just writing a simple script into /etc/init.d/ to manage it yourself? Filip Dave Pawson wrote: http://www.dpawson.co.uk/tomcat Any feedback/improvements appreciated. Particularly any errors. Meant as a simple example of getting a first servlet working, based on help I received from this list. regards - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: comet loop after webapp re-start
are you not getting the END event at all, even after the app is reloaded? Filip Peter Warren wrote: I'm running tomcat 6.0.18 on Ubuntu 8.10. I have a comet application that maintains an open connection with tomcat. If I re-start my webapp and then close the client connection, tomcat goes into a loop and chews up all cpu. This server is not live and only has my single client. The ClientPoller thread consumes most of the cpu running through the following stack over and over. Daemon Thread [http-80-ClientPoller] (Suspended (breakpoint at line 654 in ThreadPoolExecutor)) ThreadPoolExecutor.execute(Runnable) line: 654 NioEndpoint.processSocket(NioChannel, SocketStatus, boolean) line: 1161 NioEndpoint.processSocket(NioChannel, SocketStatus) line: 1148 NioEndpoint$Poller.processKey(SelectionKey, NioEndpoint$KeyAttachment) line: 1555 NioEndpoint$Poller.run() line: 1508 Thread.run() line: 619 This is not a problem with my CometProcessor not handling the comet events; the END event when the client connection is closed is never delivered to my CometProcessor, understandably since I just re-started the webapp and there is now a new CometProcessor instance. I believe what is happening is that the NIO connector is trying to deliver the END event to a CometProcessor that no longer exists and just keeps trying. Should the NIO connector recognize that the event is undeliverable and give up? Or is there something I need to do in webapp shutdown code to tell the NIO processor to disregard any open connections? The workaround is to always re-start the tomcat instead of just the webapp. This is possible for me since my server is only serving a single webapp. Peter - 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: Session replication problem
Mohamedin wrote: I have a problem with Session replication. I am running multible tomcat instance on the same server. And I have 4 servers of the same configuration (Multible tomcat instances). I have enabled the session replication on these 4 servers (In each instance with different port). The problem is that All instances see each other. while I only need similar instances to see each other. I'm not sure I understand what you are trying to achieve, what do you mean by similar Filip The config: Engine name=Catalina defaultHost=localhost jvmRoute=myserver Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=8 Manager className=org.apache.catalina.ha.session.DeltaManager expireSessionsOnShutdown=false notifyListenersOnReplication=true domainReplication=true / Channel className=org.apache.catalina.tribes.group.GroupChannel Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender / /Sender Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=245.245.245.245 port= autoBind=100 selectorTimeout=5000 maxThreads=6 / Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector / Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Intercepto r / Interceptor className=org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.246 domain=245.245.245.246 / Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.247 domain=245.245.245.247 / Member className=org.apache.catalina.tribes.membership.StaticMember port= securePort=-1 host=245.245.245.248 domain=245.245.245.248 / /Interceptor /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= / ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener / ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener / /Cluster . . . other instances use the same config (Only different port) In the log I see: 07.02.2009 18:08:19 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/amd64:/usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/../lib/amd64 07.02.2009 18:08:20 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8083 07.02.2009 18:08:20 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 483 ms 07.02.2009 18:08:20 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 07.02.2009 18:08:20 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.16 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start 07.02.2009 18:08:20 org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/245.245.245.245: 07.02.2009 18:08:20 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 07.02.2009 18:08:20 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://245.245.245.246:,245.245.245.246,, alive=0,id={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }, payload={}, command={}, domain={55 54 46 55 53 46 49 55 52 ...(12)}, ] 07.02.2009 18:08:20 org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://245.245.245.247:,245.245.245.247,, alive=0,id={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }, payload={}, command={}, domain={55 54 46 55 53 46 49 50 57 ...(13)}, ] 07.02.2009 18:08:20
Re: help Comet Tomcat
If you simply are looking for an example to use the CometProcessor interface, there is a module that is built around it https://svn.apache.org/repos/asf/tomcat/trunk/modules/bayeux/ Filip sam wrote: I am new to COMET in Tomcat, someone could show me one example on using COMET in Tomcat I have already changed the connector. i try example of http://tomcat.apache.org/tomcat-6.0-doc/aio.html and various example of this web I have managed to operate comet in Glassfish using Dojo, but Tomcat does not get anything sorry for my english any help will be good, thanx, thanx i using Tomcat 6.0.18 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: AJP vs HTTP connectors?
first and foremost, always apply ol' grandpa's logic The famous quote is if it ain't broke, don't fix it So if you are using something that is working, don't even consider switching just cause some dude on a webinar told you so. That should take you 90% of the way. The rest is understanding the technology. Filip Caldarale, Charles R wrote: From: Gregor Schneider [mailto:rc4...@googlemail.com] Subject: Re: AJP vs HTTP connectors? hm, since I'd like to avoid to browse through the whole webinar: what are the benefits / advantages / disadvantages? I'd like to know as well, since I watched the same webinar when it was presented, and don't remember anything specific about not using AJP. (Or maybe I just tuned that part out.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Transfer all HttpSessions from one cluster node to another
Ok, the backup manager which does two things 1. [every request] it selects a backup node and each time the session changes it publishes the delta to the back up node 2. [one time] upon session creation it also notifies the other nodes with the location of the backup node for session X should a fail over happen, the next node receiving the request is aware of the backup location. At this time, the new node, becomes the primary. in the file org/apache/catalina/tribes/tipis/LazyReplicatedMap.java there is a method called publishEntryInfo that does the selection above. that would be the starting point. It would be possible to create the scenario you are talking about, but never picking a backup node. and then implement a JMX call or other operation, that upon request, relocates all the sessions from one server to another with that, you would also get fail over capabilities Filip nlif wrote: Filip, Thanks. If you could elaborate some more, then maybe I can go ahead and implement this, and I'd be happy to send you the result, so you can use it and save yourself some of the work. Naaman Filip Hanik - Dev Lists wrote: nlif wrote: Hi all, We intend to run in a cluster, with stickiness enabled, and without replication. This of course does not give us failover capabilities, in case of a server crash, but it is sufficient for our needs. However, we would like to be able to transfer all sessions currently on one node, to another node, when we are about to shutdown a server for maintenance. This is different from the default behavior of session-replication, in that it only happens when we trigger it (e.g. via JMX), and with us specifying the source node and destination node. Is this supported? Has anyone done such a thing? hi Naaman, while this feature is not currently in place, it's something that has been brewing in the back of my head for a long time. It is an extremely useful feature, and its just a matter of time for me to get it implemented. The simplest way would be to start with the BackupManager, but simple remove the nr of backup nodes and therefore not replicate. And then simply implement a move sessions during a graceful shutdown. Filip I would appreciate any tips. Thanks, Naaman - 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: Tomcat Clustering trouble when starting up under high load
state transfer timeout -1 is not a good setting. one should prefer to timeout rather than getting stuck, even if the timeout means we didn't get everything you may also try the backup manager, which does the state transfer in a bit smarter manner. when your system is stuck, then thread dumps are crucial to resolving your actual issue Filip Mikel Ibiricu wrote: Hello all I´m Mikel, and me and my workmates have already been a while testing our environment in order to establish a in memory session replication cluster for our servers. The thing is that our servers are often loaded with up to a thousand (1000) and more sessions (and now, we have three tomcat nodes in different machines working in a load balancer). In hot moments, I have counted up to 4500 sessions distributed between the three servers. So, I'll tell you the main configuration our production environment. Web servers: Two windows server 2003 with IIS and isapi_redirect.dll conector. App servers node 1 2: IBM Xseries_3550 Intel Xeon CPU 5150 @2,66GHz, 2,00 GB RAM, Windows 2003 Server R2 node3: IBM XSeries_366 Intel Xeon CPU 3,20Ghz, 3,00 GB RAM, Windows Server 2003 R2 In our development environment, where we have been making our tests, we have 2 tomcats in two different machines node 1: Intel Xeon CPU E5440 @ 2,83GHz, 1,00 GB RAM, Windows Server 2003 R2 node 2: IBM XSeries_3550 Intel Xeon CPU E5440 @ 2,83 GHz, 2GB RAM, Windows Server 2003 R2 We have been testing the Tomcat 5.5.9 that we are using in production, finding some trouble, even after aplying the clustering fix pack from https://issues.apache.org/bugzilla/show_bug.cgi?id=34389 . Finally, we took the decission to upgrade to last Tomcat 6 available, version 6.0.18, to see if the announced refactoring of cluster subsystem could solve our trouble. After all this prety long intro, I'll tell you the reason of my request. When we test the cluster (in development environment) with both nodes running, we create up to a thousand sessions, keeping alive and modificating about 500. So, we can see that all of them get replicated to the other node quickly . The trouble comes when, after shutting down one of the instances, we start it again (while the half of the alive sessions are still beeing modified by the JMeter test). In our tests, the starting tomcat instance finally gets hunged when receiving sessions from the alive node. Theese are the traces seen in the catalina.log of node 1 when starting it: Jan 26, 2009 6:51:56 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\tomcat-6.0.18\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Serena\Dimensions 10.1\CM\prog;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\IBM\Director\bin;C:\Program Files\Common Files\IBM\ICC\cimom\bin;C:\Program Files\System Center Operations Manager 2007\ Jan 26, 2009 6:51:56 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-9080 Jan 26, 2009 6:51:56 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-9081 Jan 26, 2009 6:51:56 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1928 ms Jan 26, 2009 6:51:56 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jan 26, 2009 6:51:56 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Jan 26, 2009 6:51:56 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/172.26.102.233:4009 Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Attempting to bind the multicast socket to /228.0.0.9:45569 Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Binding to multicast address, failed. Binding to port only. Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting multihome multicast interface to:/172.26.102.233 Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 1000 Jan 26, 2009 6:51:56 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 2000 milliseconds to establish cluster membership, start level:4 Jan 26, 2009 6:51:57 PM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 26, 102, -60}:4009,{-84, 26, 102, -60},4009, alive=1938953,id={-57 67 34 -23 -38 83 74 68 -67 -87 -112 -94 13 102 -78 -20 }, payload={}, command={}, domain={}, ] Jan 26, 2009 6:51:58 PM
Re: Slightly OT: ApacheCon Europe 2009
Gregor Schneider wrote: Hi Mark, knowing those conferences, I know how hard it is to get hands on the speaker ;) I've registered for the 3 conference days only plus tuesday hackaton. I've got actually no idea how the hackaton works, but I'm curious to meet some of you guys. So if you have any information on what's actually going on during the hackaton or necessary preparations on the attendee's side, it would be great if you could share some infos. Hope to see you there for a *yuck* Heinecken... I will be there, usually the tomcat committers crowd at one table during the hackathon, so feel free to seek us out and join us at the table. if you wear a red rose in your hair, it will be easier to find you Filip Gregor - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Question abut CometProcessor EventSubType.TIMEOUT semantics
David Boreham wrote: Filip Hanik - Dev Lists wrote: are you able to submit a simple example, and we shall get it taken care of Yes...but only in the parallel universe where I have loads of spare time ;) 0.18 like the people helping you for free on the mailing lists? :) Realistically it'd be quicker for me to debug the problem in situ and fix it than to create an isolate reproduction case (since that involves creating a client too). One more question before I dive in : what's the 'correct' way for the application to terminate a live Comet request ? That is, suppose the client connects, sends an http request, which we process, then the client does exactly nothing, forever. Unless the server closes the TCP connection, this connection will stay open until the end of time (and that's what I observe practically). How should the application force the closure of the connection ? (possibly the answer is 'send a response to the client which causes it to close', but given the fact that Tomcat never sends anything to the client, that doesn't work). I've tried calling event.close(), and close() on the response stream. Neither seems to have the desired effect. event.close() during an event is the correct way, that will terminate it. In 6.0.19 you will also be able to call event.close() asynchronously, on a non worker thread It'd be useful to know the intended behavior of the CometProcessor interface, so I can determine if it's behaving as intended. Right now I don't have a clear definition in my mind of either the intended interface behavior, nor the actual implementation behavior, nor if the two are the same or different. before you debug 6.0.18, there are fixes in 6.0.x/trunk that you may want to try out before you dig into the older code base Filip Thanks again for your help. - 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: Question abut CometProcessor EventSubType.TIMEOUT semantics
are you able to submit a simple example, and we shall get it taken care of Filip David Boreham wrote: David Boreham wrote: Filip Hanik - Dev Lists wrote: are you calling response.flushBuffer() to flush your data? No, I was calling response.getOutputStream().flush(). I'll try your suggestion and report back, thanks. This made no difference, btw. It's broken in the same way as before. Do you want me to call flush() on the stream AND on the response ? - 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: Transfer all HttpSessions from one cluster node to another
nlif wrote: Hi all, We intend to run in a cluster, with stickiness enabled, and without replication. This of course does not give us failover capabilities, in case of a server crash, but it is sufficient for our needs. However, we would like to be able to transfer all sessions currently on one node, to another node, when we are about to shutdown a server for maintenance. This is different from the default behavior of session-replication, in that it only happens when we trigger it (e.g. via JMX), and with us specifying the source node and destination node. Is this supported? Has anyone done such a thing? hi Naaman, while this feature is not currently in place, it's something that has been brewing in the back of my head for a long time. It is an extremely useful feature, and its just a matter of time for me to get it implemented. The simplest way would be to start with the BackupManager, but simple remove the nr of backup nodes and therefore not replicate. And then simply implement a move sessions during a graceful shutdown. Filip I would appreciate any tips. Thanks, Naaman - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Question abut CometProcessor EventSubType.TIMEOUT semantics
are you calling response.flushBuffer() to flush your data? that is probably what you are missing David Boreham wrote: I'm re-writing an application to use the CometProcessor interface. Generally things are working but despite several late evenings single-stepping through the connector code, I'm still unclear on one issue and would appreciate some education: In my debugging I'm using NIO (production deployment is intended to use Linux and APR but for now my question pertains to my experiences with NIO on the Windows desktop). My application receives a BEGIN event and stores the event object, response and so on for later use to respond to the client, much like the example code. Until that time, which may be many minutes in the future, it sends nothing back to the client. I see EventSubType.TIMEOUT events delivered during the time after BEGIN event, one TIMEOUT ever soTimeout interval. This matches the documentation's description of timeout semantics. However, I have observed empirically that if an attempt is made to send data back to the client (via Response.outputStream.write/flush), no data is actually sent on the wire IF the write is done AFTER one of these timeout events has arrived. That is, if I change the timeout such that it is longer than the time at which the application responds to the client, the client receives the data. If I make the timeout shorted, the client does not receive the data. There is no exception thrown, and in fact I've single stepped into the NIO code all the way to the socket write and flush calls. Everything looks ok, but no data makes it to the wire (confirmed in a packet trace). So, I'm wondering: is this expected behavior ? If so then the documentation is incorrect. Also, if this is the intended behavior it would appear to make it hard to build a working application for APR because the timeout can't be set after connection establishment (the same timeout, it appears applies to all socket reads, and hence setting it to a very long time will cause thread pool starvation trouble with new connections that stall with the client never sending any data). Any thoughts on this are most welcome. - 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: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)
you are calling this method public Connection getConnection(String username, String password) throws SQLException { throw new UnsupportedOperationException(Not supported by BasicDataSource); } try calling DataSource.getConnection() without a username and password Filip jpmad4it wrote: David Smith-2 wrote: Case matters. Make sure you match case in all places where you refer to the jndi name of your datasource. Off the top, I see you configured jdbc/TestIDMS, but then try to use jdbc/testIDMS in the test jsp. --David Ah thanks for spotting that. I am now getting the error: Error: java.lang.UnsupportedOperationException: Not supported by BasicDataSource Not supported by BasicDataSource Is this to do with the JNDI not recognising the IDMS driver?? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Clustering Dies with error.
hi Nick, the issue in the email was caused by a dead lock in 6.0.14 and was later resolved. Upgrading to 6.0.18 should take care of the problem Filip Nick Ascione wrote: Filip, I am having the exact issue that is referred to in the link below. I have tried the recommended workarounds but I am still seeing the problem. Could you please let me know if this is a bug that has been resolved in new versions? We are running tomcat 6.0.14. The posting has no further information and the conversation went offline. http://mail-archives.apache.org/mod_mbox/tomcat-users/200801.mbox/%3c004001c8591b$5ca14100$15e3c3...@com%3e Thanks, Nick - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)
If your JDBC driver has a DataSource, then check to see if it has a javax.naming.spi.ObjectFactory implementation, this is the one you would specify in the factory=some.impl.DataSourceFactory attribute, for example. Some drivers don't have factories, and then you simply use Tomcat's own factory by omitting the factory attribute. In this case, Tomcat will provide the DataSource that is a wrapper around your driver. Provide 1. the configuration (only relevant parts) 2. the error you get Filip jpmad4it wrote: Hi there, I have a rather interesting / complex problem..creating a connection to CA-IDMS from Tomcat using JDBC type 4 drivers (CA provide the type 4 driver). We have a zSeries 9 IBM mainframe running CA-IDMS r16.1, and I need to connect to the IDMS from Tomcat (running on Linux) using the JDBC Type 4 drivers provided by CA. At this stage I am struggling with the actual setup and configuration of Tomcat’s server.xml and web.xml files. These are the files where the JDBC configuration is set (I think). I have to setup the CA-IDMS part of the configuration, but that is a different problem. Basically there is a TCP/IP listener on the IDMS, waiting for incoming connections from the JDBC type 4 driver. I set up a Tomcat to MySQL connection using MySQL Connector / J, which is a similar kind of process to what I am trying to achieve with IDMS. MySQL connector / J came with a jar file which is placed in Tomcat’s lib folder, and then the JDBC setup for the web application is created in Tomcat's server.xml and web.xml files. You can then connect to the MySQL database using JSP and the configured JDBC driver / connection. The CA-IDMS Server comes with an idmsjdbc.jar file, which I think is the JDBC typr 4 driver. I think it needs to be placed in the Tomcat /lib folder, but I don’t know how to set up the configuration. There is a JDBC DriverManager which allows JDBC drivers to connect to CA-IDMS. The DriverManager recognises the following syntax: jdbc:idms://hostname:port/database This allows the JDBC driver running within Tomcat to connect to the IDMS which is running on the IDM mainframe. CA IDMS r16 supports direct connections from the Type 4 JDBC driver to the Central Version on IDMS. hostname is the DNS name or IP address of the machine where the CV is running, and port is the IP port that was specified for the listener PTERM (setup on the IDMS side). There is a caidms.properties file for the JDBC driver, which is used to specify user ID, password, and optional accounting information. It can also be used to specify physical connection information, allowing an application to connect to a CA-IDMS database without requiring the definition of an ODBC style data source. However, I don’t know where to place this file within the Tomcat setup. There is also an IdmsDataSource class. I don’t know where to configure this or how to set it up; the CA-IDMS Server manual states the following: This class implements the JDBC DataSource interface. It is used with an application server (Tomcat) providing Java Naming and Directory Interface (JNDI) naming service to establish a connection to a CA IDMS database. IdmsDataSource properties conform to the Java Beans naming conventions and are implicitly defined by public “setter” and “getter” methods. For example, the “description” property, which is required for all DataSource implementations, is set using the setDescription(String) method. The application server may use the java.lang.reflection methods to discover DataSource properties and provide an interface to set them, or may simply require that they are defined in some configuration file. IdmsDataSource properties are used to specify the connection parameters. These properties are the equivalent of the DriverPropertyInfo attributes described in the previous section and can be used to completely define the parameters needed to connect to a database. Like a URL, an IdmsDataSource object can also reference an “ODBC” style data source name, where the connection parameters are defined in the configuration file on Linux. Is there anyone that can try to point me in the right direction to setting up the JDBC connection? I am totally new to Java and so the instructions are not making much sense at the moment. Any help, hints, tips…..anything will be greatly appreciated as I have just hit a brick wall here. I can't find much to do with setting up the CA-IDMS Server JDBC type 4 driver online eitherif anyone can point me to some resources that would also be extremely useful. Kind regards Jp - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to handle Expect: 100-continue
That is how it is with every single request. Tomcat will never read a body unless the servlet initiates the action. So to read a body you can either - read the input stream - read the reader - issue a request.getParameter (if the body is form encoded, tomcat will read the body and parse the parameters) I'm not sure what the Expect/100-continue headers have anything to do with reading the body. As a servlet/JSP developers, you are the trigger for reading the body, without any exceptions. Filip Nathan Ashworth wrote: What we are observing is: 1) Client initiates the POST with the 'Expect: 100-continue' header, 2) Tomcat responds with '100 Continue', 3) Tomcat calls the servlet. Now once we are in our servlet, unless we explicitly read from the request's BufferedReader, the client will not send the remainder of the POST. So, from my perspective, it looks like Tomcat is only handling half of the POST, while it is up to to servlet to read and parse the other half. Is that the expected process when dealing with 100-continue? Filip Hanik - Dev Lists wrote: if you use wireshark, you should see that Tomcat already does it automatically. if you look at the code StandardWrapperValve.java, it should call response.acknowledge(), and if the client sent an expect header, tomcat will write out the 100 continue Filip Nathan Ashworth wrote: What's the simplest way to support Expect: 100-continue requests in a servlet running on Tomcat 6? My current solution is to look for the expect header, check whether its value is 100-continue and if it is, then I get a BufferedReader from the request [request.getReader()] and dump the contents into a String. I then parse that String into a parameter Map. Now, this does work, but it feels like I am doing work that Tomcat should be handling transparently. Am I missing something here? Thanks, Nathan - 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: How to handle Expect: 100-continue
Nathan Ashworth wrote: Thanks, Filip. Upon further investigation, we've discovered that our POSTs were bigger than the default maxPostSize value (2MB). The call to getParameter(foo) was returning null and doing a trace showed that the client was not sending the body. good catch It appears that Tomcat is returning 100 Continue immediately, and then when it starts to read the body [as part of getParameter()] it notices that Content-Length is greater than maxPostSize and it skips the body. ack happens right away, regardless of body. Wouldn't it be better if Tomcat looked at the Content-Length before it acknowledges the request? Maybe reply with a 417 instead? not sure why it would not ack the request. its gonna do that everytime. However, if the knows that the body wont fit, it could throw an exception to the app, so that one knows what went wrong. you can always open a bug or enhancement request in bugzilla https://issues.apache.org/bugzilla/index.cgi Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 does not start in a cluster. It simply hangs... Any Idea..
hi Jaspal, the problem seems to be in the com.valleyoak package. The main thread is stuck at at com.valleyoak.model.Payment.clinit(Payment.java:136) (at com.valleyoak.util.IVosTableInfo.findColumnTables(IVosTableInfo.java:161)) - last line the cluster thread is stuck at at java.lang.Class.forName0(Native Method) because the main thread is stuck during a clinit (this is class init, happens directly after class loading, to do static initializers), the cluster thread can't continue. what you need to investigate is why at com.valleyoak.util.IVosTableInfo.findColumnTables(IVosTableInfo.java:161)) - last line is stuck, but it does look like its a problem with your code. Filip jsandhu2204 wrote: HI Filip: I did three dumps. It is hanging on the same class. Please let me know any ideas... We are in production. I have same setup on development and it works. However, cluster setup on development is on the same box with apache web server in front. In production there are three servers with hardware load balancer in the the front. Thanks Jaspal jsandhu2204 wrote: Please see the three stack dumps I did. http://www.nabble.com/file/p21367357/Thread-dump-three-times.txt Thread-dump-three-times.txt Filip Hanik - Dev Lists wrote: Could you take more than one thread dump, take 3, wait 5 seconds between each. As you can see, the startup thread is still executing your application code com.valleyoak.util.IVosTableInfo, this is the thread that starts up tomcat Filip main thread - the one starting tomcat main prio=6 tid=0x01dc1c00 nid=0x15cc in Object.wait() [0x01f4d000..0x01f4fc70] java.lang.Thread.State: RUNNABLE at com.valleyoak.util.IVosTableInfo.findColumnTables(IVosTableInfo.java:161) at com.valleyoak.db.IVosStorable.findColumnTables(IVosStorable.java:1245) at com.valleyoak.model.Payment.clinit(Payment.java:136) at com.valleyoak.model.ContextListener.contextInitialized(ContextListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) - locked 0x41f4f390 (a org.apache.catalina.core.StandardContext) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) - locked 0x41eef8b8 (a java.util.HashMap) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) One of the cluster threads have received the session state data from the other node and is deserializing it pool-2-thread-1 prio=6 tid=0x01dc5c00 nid=0xf00 in Object.wait() [0x777c000..0x0777fae0] java.lang.Thread.State: RUNNABLE at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.valleyoak.util.IVosTableInfo.class$(IVosTableInfo.java:504) at com.valleyoak.util.IVosTableInfo.loadTables(IVosTableInfo.java:522) at com.valleyoak.util.IVosTableInfo.clinit(IVosTableInfo.java:53) at com.valleyoak.db.IVosStorable.findColumnTables(IVosStorable.java:1245) at com.valleyoak.model.User.clinit(User.java:71) at java.io.ObjectStreamClass.hasStaticInitializer(Native Method) at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1696) at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:52) at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:205) at java.security.AccessController.doPrivileged(Native Method) at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:202) at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:558) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) jsandhu2204 wrote: I have created stack trace when servers hangs. Please see attached. I would appreciate if you can help me with this. If I put distributable/ flag in the web.xml of the application. Tomcat6 does not start sometimes. It simply hangs. http://www.nabble.com/file/p21347289/CheatSheet-ltr1vs02-Tomcat6-hangs-if-put-distributeable-tag.rtf CheatSheet-ltr1vs02-Tomcat6-hangs-if-put-distributeable-tag.rtf http://www.nabble.com/file/p21347289/CheatSheet-Tomcat6-hangs-if-put-distributeable-tag.rtf CheatSheet-Tomcat6-hangs-if-put-distributeable-tag.rtf Filip Hanik - Dev Lists wrote: When this happens, simply take a thread dump, and we can see why it is hanging Unix: kill -3 pid jstack -l pid Windows Ctrl+Break in the console jstack -l pid Filip jsandhu2204 wrote: Problem1 : While starting
Re: Tomcat 6 does not start in a cluster. It simply hangs... Any Idea..
Could you take more than one thread dump, take 3, wait 5 seconds between each. As you can see, the startup thread is still executing your application code com.valleyoak.util.IVosTableInfo, this is the thread that starts up tomcat Filip main thread - the one starting tomcat main prio=6 tid=0x01dc1c00 nid=0x15cc in Object.wait() [0x01f4d000..0x01f4fc70] java.lang.Thread.State: RUNNABLE at com.valleyoak.util.IVosTableInfo.findColumnTables(IVosTableInfo.java:161) at com.valleyoak.db.IVosStorable.findColumnTables(IVosStorable.java:1245) at com.valleyoak.model.Payment.clinit(Payment.java:136) at com.valleyoak.model.ContextListener.contextInitialized(ContextListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) - locked 0x41f4f390 (a org.apache.catalina.core.StandardContext) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) - locked 0x41eef8b8 (a java.util.HashMap) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) One of the cluster threads have received the session state data from the other node and is deserializing it pool-2-thread-1 prio=6 tid=0x01dc5c00 nid=0xf00 in Object.wait() [0x777c000..0x0777fae0] java.lang.Thread.State: RUNNABLE at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.valleyoak.util.IVosTableInfo.class$(IVosTableInfo.java:504) at com.valleyoak.util.IVosTableInfo.loadTables(IVosTableInfo.java:522) at com.valleyoak.util.IVosTableInfo.clinit(IVosTableInfo.java:53) at com.valleyoak.db.IVosStorable.findColumnTables(IVosStorable.java:1245) at com.valleyoak.model.User.clinit(User.java:71) at java.io.ObjectStreamClass.hasStaticInitializer(Native Method) at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1696) at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:52) at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:205) at java.security.AccessController.doPrivileged(Native Method) at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:202) at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:558) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) jsandhu2204 wrote: I have created stack trace when servers hangs. Please see attached. I would appreciate if you can help me with this. If I put distributable/ flag in the web.xml of the application. Tomcat6 does not start sometimes. It simply hangs. http://www.nabble.com/file/p21347289/CheatSheet-ltr1vs02-Tomcat6-hangs-if-put-distributeable-tag.rtf CheatSheet-ltr1vs02-Tomcat6-hangs-if-put-distributeable-tag.rtf http://www.nabble.com/file/p21347289/CheatSheet-Tomcat6-hangs-if-put-distributeable-tag.rtf CheatSheet-Tomcat6-hangs-if-put-distributeable-tag.rtf Filip Hanik - Dev Lists wrote: When this happens, simply take a thread dump, and we can see why it is hanging Unix: kill -3 pid jstack -l pid Windows Ctrl+Break in the console jstack -l pid Filip jsandhu2204 wrote: Problem1 : While starting tomcat6, sometimes it starts other times it simply hangs on the following message: INFO: Manager [localhost#/ivos]; session state send at 12/12/08 12:34 AM received in 110 ms. Tomcat Log: INFO: Register manager /ivos to cluster element Engine with name Catalina Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager start INFO: Starting clustering manager at /ivos Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [localhost#/ivos], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 88, 8, 28}:4002,{10, 88, 8, 28},4002, alive=123501,id={27 -68 111 -64 -49 -117 68 38 -98 -27 -49 39 -22 6 -88 -38 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [localhost#/ivos]; session state send at 12/12/08 12:34 AM received in 110 ms. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6; getting logging to work
have you defined 6mmi.org.apache.juli.FileHandler I don't see that in your addition Filip juan.velez wrote: I followed the directions in that link (http://tomcat.apache.org/tomcat-6.0-doc/logging.html) and my logging messages still do not show up. I mean, I see the INFO messages generated by my web-app but if I change the level to FINE (or FINEST) I do not see it. I am using Tomcat 6.0.18 and Java Util Logging I have modified the %CATALINA_HOME%\conf\logging.properties (Using Jconsole I can see that this is the file being used as the logging properties) to add a new file handler 6mmi.org.apache.juli.FileHandler, changed the level for the console handler to FINEST java.util.logging.ConsoleHandler.level = FINEST And added org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mmi].level = FINEST org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mmi].handlers = 6mmi.org.apache.juli.FileHandler I do see the mmi.-mm-dd.log file created but the only contents are INFO messages generated by catalina. And messages below INFO are not seen on either the console or any of the log files. Any idea what I am doing wrong? Thanks, Juan Mark Thomas-18 wrote: Peter Hawkins wrote: Basically, I would like to enable logging for my JSP app. How do I do it? Take a look at http://tomcat.apache.org/tomcat-6.0-doc/logging.html You want the java.util.logging section. Replace the examples web app with your own and then just use java.util.logging as per normal. Is it the same procedure for tomcat 5.5 and 6.0? No. Do I need to rebuild tomcat with log4j to get ANY logging? No. Only if you want to use log4j for all Tomcat logging. Where is the catalina.out file? I can't find it anyplace, but I see it being discussed. It is now catalina.-mm-dd and is in the logs directory. How do I direct the stdout logging to a file with Tomcat 6. Set the swallowOutput for the context. See http://tomcat.apache.org/tomcat-6.0-doc/config/context.html HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tribes Startup Help
hi Mike, it all looks good. There is one side effect you may not be aware of. by default the 'receiver' autobind is enabled. that means if receiver.setPort(port) is not available, it will increment the port number and try again. so the actual port might be different from what you think you have set. To disable this behavior, you would receiver.setAutoBind(0); Filip Mike Wannamaker wrote: Hi, We are using 5.5.27 and using tribes, however instead of tomcat initializing and starting tribes we are doing it ourselves. Below is my code. I was just wondering if you see anything wrong with what I'm doing. public synchronized void startup() { if(_tribesChannel == null) { // nothing to do if already running try { _tribesChannel = new GroupChannel(); // must be done before start: MembershipService mService = _tribesChannel.getMembershipService(); McastService mCastService = (McastService)mService; mCastService.setPort(_mainPort); mCastService.setAddress(_multicastIPAddr); mCastService.setRecoveryCounter(10); // 10 Seconds instead of 3 seconds? mCastService.setDropTime(10*1000); ChannelReceiver receiver = _tribesChannel.getChannelReceiver(); // _desiredLocalIPAddr may be set to select one nic in multihome environments if(_desiredLocalIPAddr != null _desiredLocalIPAddr.length() 0) { // Question: Set both of these, to have heartbeat and messages sent on same nic? mCastService.setBind(_desiredLocalIPAddr); if(receiver instanceof ReceiverBase) { ((ReceiverBase)receiver).setAddress(_desiredLocalIPAddr); } } // Set if we want a different port than what tomcat uses as default 4000 if(_ancillaryPort 0) { if(receiver.getPort() != _ancillaryPort) { if(receiver instanceof ReceiverBase) { ((ReceiverBase)receiver).setPort(_ancillaryPort); } } } _tribesChannel.addInterceptor(new TcpFailureDetector()); _tribesChannel.addMembershipListener(_tribesMembershipListener); _tribesChannel.addChannelListener(_tribesChannelListener); _tribesChannel.start(CHANNEL_COMPONENTS); // This just adds this machine to our internal cluster topology list addToTopology(); } catch(ChannelException ex) { try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/} _tribesChannel = null; throw new RuntimeException(ex); // todo, exception handling? } } } public void shutdown() { super.shutdown(); if(_tribesChannel != null) { try { synchronized(_tribesChannel) { _tribesChannel.removeMembershipListener(_tribesMembershipListener); _tribesChannel.removeChannelListener(_tribesChannelListener); _tribesChannel.stop(CHANNEL_COMPONENTS); } } catch(ChannelException ex) { throw new RuntimeException(ex); // todo, exception handling? } finally { _tribesChannel = null; } } } - 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: Tomcat 6; getting logging to work
yes, but you havent defined what 6mmi actually logs to all the other loggers have defined what directory and what file name is used, Filip juan.velez wrote: Yes I have handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, \ 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, \ 5host-manager.org.apache.juli.FileHandler, 6mmi.org.apache.juli.FileHandler, \ java.util.logging.ConsoleHandler Filip Hanik - Dev Lists wrote: have you defined 6mmi.org.apache.juli.FileHandler I don't see that in your addition Filip juan.velez wrote: I followed the directions in that link (http://tomcat.apache.org/tomcat-6.0-doc/logging.html) and my logging messages still do not show up. I mean, I see the INFO messages generated by my web-app but if I change the level to FINE (or FINEST) I do not see it. I am using Tomcat 6.0.18 and Java Util Logging I have modified the %CATALINA_HOME%\conf\logging.properties (Using Jconsole I can see that this is the file being used as the logging properties) to add a new file handler 6mmi.org.apache.juli.FileHandler, changed the level for the console handler to FINEST java.util.logging.ConsoleHandler.level = FINEST And added org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mmi].level = FINEST org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mmi].handlers = 6mmi.org.apache.juli.FileHandler I do see the mmi.-mm-dd.log file created but the only contents are INFO messages generated by catalina. And messages below INFO are not seen on either the console or any of the log files. Any idea what I am doing wrong? Thanks, Juan Mark Thomas-18 wrote: Peter Hawkins wrote: Basically, I would like to enable logging for my JSP app. How do I do it? Take a look at http://tomcat.apache.org/tomcat-6.0-doc/logging.html You want the java.util.logging section. Replace the examples web app with your own and then just use java.util.logging as per normal. Is it the same procedure for tomcat 5.5 and 6.0? No. Do I need to rebuild tomcat with log4j to get ANY logging? No. Only if you want to use log4j for all Tomcat logging. Where is the catalina.out file? I can't find it anyplace, but I see it being discussed. It is now catalina.-mm-dd and is in the logs directory. How do I direct the stdout logging to a file with Tomcat 6. Set the swallowOutput for the context. See http://tomcat.apache.org/tomcat-6.0-doc/config/context.html HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 JDBC connection not found
post the actual error you see with the new config arturoguedez wrote: Thanks for the help. I just tried it and it still does work. Here is the exact content of my current server.xml and my context.xml Server.xml: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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 / Resource name=jdbc/workout_logger auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/workout_logging?autoReconnect=true/ /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /Service /Server Context.xml ?xml version='1.0' encoding='utf-8'? Context WatchedResourceWEB-INF/web.xml/WatchedResource ResourceLink name=jdbc/workout_logger global=jdbc/workout_logger/ /Context I check and my db user user has full access to the DB it's trying to use. Is it possible that I am missing a library or something in the classpath of tomcat? I already have the mysql connector library ( I had my DB connections working fine without datasources before, but I am trying to switch to using datasources). Thanks again Arturo Filip Hanik - Dev Lists wrote: put this Resource name=jdbc/workout_logger auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true/ inside the GlobalNamingResources in server.xml Put this ResourceLink name=jdbc/workout_logger global=jdbc/workout_logger/ inside the Context elemement in conf/context.xml and try again Filip arturoguedez wrote: hey, sorry about that. The actual string I have in my app is workout_logger I just tried to replace my strings for my_jdbc_name for the posting. I guess I forgot to rename the in the error. other than that, do you see anything else wrong? Filip Hanik - Dev Lists wrote: here is the name you specify res-ref-namejdbc/my_jdbc_name/res-ref-name and here is your error Could not find datasource:jdbc/workout_logger as you can see, somewhere you have configured the string workout_logger, and that one doesn't exist Filip arturoguedez wrote: Hi! I have been reading how to setup datasources for Tomcat 6.0.18 in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html and nothing I have done has allowed my web application to view the datasource i have created. Here are some snippets of my web.xml, and my server.xml In the web.xml resource-ref descriptionDB Connection/description res-ref-namejdbc/my_jdbc_name/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In server.xml I have tried to place the following snip it anywhere I saw in the docs it could belong to (ei, in the GlobalNamingResources, inside the Host tag, or inside the Context tag in all possible locations (under META-INF/context.xml, under $CATALINA_BASE/conf/[engine]/[host]/[path].xml) and I haven't been successful. Resource name=jdbc/my_jdbc_name auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true/ I am using Entity Managers to get my connections opened, here is the snip it of my persistence.xml persistence-unit name=my_pu_name transaction-type=RESOURCE_LOCAL non-jta-data-sourcejdbc/my_jdbc_name/non-jta-data-source /persistence-unit Here is what I get in my tomcat logs: 08/12/21 17:32:17 ERROR ceConnectionProvider: Could not find datasource: jdbc/workout_logger
Re: NullPointerExceptions on startup with NIO connector
already there http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?r1=719262r2=719267 Filip ssenecal wrote: Is there any chance of getting this backported to 6.0.18? I'm hoping to not have to maintain a custom release of Tomcat in order to address the issue :) Filip Hanik - Dev Lists wrote: yes, that is correct Alex Talis wrote: Filip, does this mean that this fix will be in 6.0.19 production release? Thanks - Original Message From: Filip Hanik - Dev Lists devli...@hanik.com To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, October 29, 2008 7:15:01 AM Subject: Re: NullPointerExceptions on startup with NIO connector thanks for the report, looks it was fixed in trunk http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diffr1=618058r2=618059 I just forgot to backport it Filip Alex Talis wrote: Hi, My Tomcat 6.0.18 throws NPEs if there are incoming connections to an NIO connector before the connector had a chance to initialize. The behavior that I would expect is for Tomcat to simply refuse incoming connections until the connector is ready. I found a similar post on this mailing list (http://mail-archives.apache.org/mod_mbox/tomcat-users/200802.mbox/%3c47a5f469.40...@apache.org%3e), which links to Bug 43701 (https://issues.apache.org/bugzilla/show_bug.cgi?id=43701). The bug report describes the behavior that I'm seeing with 6.0.18, but says that it's fixed in 6.0.15 onwards. Is it back? Below is my config and how I reproduce the problem. Exceptions are the same as in the bug report above, but with different line numbers. Thanks in advance for your help. Tomcat version info (from running version.bat) --- Server version: Apache Tomcat/6.0.18 Server built: Jul 22 2008 02:00:36 Server number: 6.0.18.0 OS Name:Windows 2003 OS Version:5.2 Architecture: x86 JVM Version:1.5.0_05-b05 JVM Vendor:Sun Microsystems Inc. Steps to reproduce 1. Add an NIO connector to server.xml, like this Connector port=8081 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 acceptorThreadCount=1 redirectPort=8444 socket.directBuffer=false/ 2. Open browser and point it to http://localhost:8081/. It's easier to reproduce with Firefox for some reason. 3. Start Tomcat by double-clicking startup.bat 4. As Tomcat is starting, keep refreshing the browser by quickly clicking the refresh button as fast as you can. It may not work the first time. You should see some NullPointerExceptions in Tomcat log, like this: Oct 28, 2008 11:10:22 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions SEVERE: java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1011) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204) at java.lang.Thread.run(Unknown Source) Oct 28, 2008 11:10:22 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions SEVERE: java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1011) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204) at java.lang.Thread.run(Unknown Source) Oct 28, 2008 11:10:22 AM org.apache.coyote.http11.Http11NioProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Oct 28, 2008 11:10:22 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 831 ms - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: NullPointerExceptions on startup with NIO connector
its in the source control repository, and that means it will be included in the next release 6.0.19 Filip Shaun Senecal wrote: Thats odd... I am still getting the NPE on startup. Is it included in the binaries downloaded or do I need to rebuild myself for this patch to take effect? On Wed, Dec 24, 2008 at 11:01 AM, Filip Hanik - Dev Lists devli...@hanik.com wrote: already there http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?r1=719262r2=719267 Filip ssenecal wrote: Is there any chance of getting this backported to 6.0.18? I'm hoping to not have to maintain a custom release of Tomcat in order to address the issue :) Filip Hanik - Dev Lists wrote: yes, that is correct Alex Talis wrote: Filip, does this mean that this fix will be in 6.0.19 production release? Thanks - Original Message From: Filip Hanik - Dev Lists devli...@hanik.com To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, October 29, 2008 7:15:01 AM Subject: Re: NullPointerExceptions on startup with NIO connector thanks for the report, looks it was fixed in trunk http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diffr1=618058r2=618059 I just forgot to backport it Filip Alex Talis wrote: Hi, My Tomcat 6.0.18 throws NPEs if there are incoming connections to an NIO connector before the connector had a chance to initialize. The behavior that I would expect is for Tomcat to simply refuse incoming connections until the connector is ready. I found a similar post on this mailing list ( http://mail-archives.apache.org/mod_mbox/tomcat-users/200802.mbox/%3c47a5f469.40...@apache.org%3e ), which links to Bug 43701 (https://issues.apache.org/bugzilla/show_bug.cgi?id=43701). The bug report describes the behavior that I'm seeing with 6.0.18, but says that it's fixed in 6.0.15 onwards. Is it back? Below is my config and how I reproduce the problem. Exceptions are the same as in the bug report above, but with different line numbers. Thanks in advance for your help. Tomcat version info (from running version.bat) --- Server version: Apache Tomcat/6.0.18 Server built: Jul 22 2008 02:00:36 Server number: 6.0.18.0 OS Name:Windows 2003 OS Version:5.2 Architecture: x86 JVM Version:1.5.0_05-b05 JVM Vendor:Sun Microsystems Inc. Steps to reproduce 1. Add an NIO connector to server.xml, like this Connector port=8081 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 acceptorThreadCount=1 redirectPort=8444 socket.directBuffer=false/ 2. Open browser and point it to http://localhost:8081/. It's easier to reproduce with Firefox for some reason. 3. Start Tomcat by double-clicking startup.bat 4. As Tomcat is starting, keep refreshing the browser by quickly clicking the refresh button as fast as you can. It may not work the first time. You should see some NullPointerExceptions in Tomcat log, like this: Oct 28, 2008 11:10:22 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions SEVERE: java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1011) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204) at java.lang.Thread.run(Unknown Source) Oct 28, 2008 11:10:22 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions SEVERE: java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1011) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204) at java.lang.Thread.run(Unknown Source) Oct 28, 2008 11:10:22 AM org.apache.coyote.http11.Http11NioProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Oct 28, 2008 11:10:22 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 831 ms - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 JDBC connection not found
check the logs earlier, if you havent moved the mysql-xxx.jar into TC_HOME/lib, then tomcat can't create the connection pool, and the JDBC name will not exist Filip arturoguedez wrote: The error hasn't actually changed from the one I posted originally. Is there any way of changing Tomcat's logging to display more information? I know there is a reference to a Ejb3Configuration.buildEntityManagerFactory but i am not actually using EJB3's. I am just using the EntityManagers/EntityManagerFactory that uses config from persistence.xml, a file in which you can tell it what datasource to make your persistence unit to use. I tell it to use jdbc/workout_logger. I guess I can try writing a simple Servlet that tries to get the context using the example in Tomcat's docs. I just thought that in the end, all ways call the same InitialContext.lookup method. Arturo - I have copied the same stacktrace that I am getting. It's almost as if the config changes haven't done anything. Just to make sure that it's loading the files, I tried to start tomcat with a broken xml and it fails to start, so I know that it's loading the right config files. 1 17:32:17 ERROR ceConnectionProvider: Could not find datasource: jdbc/workout_logger javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52) Filip Hanik - Dev Lists wrote: post the actual error you see with the new config arturoguedez wrote: Thanks for the help. I just tried it and it still does work. Here is the exact content of my current server.xml and my context.xml Server.xml: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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 / Resource name=jdbc/workout_logger auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/workout_logging?autoReconnect=true/ /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /Service /Server Context.xml ?xml version='1.0' encoding='utf-8'? Context WatchedResourceWEB-INF/web.xml/WatchedResource ResourceLink name=jdbc/workout_logger global=jdbc/workout_logger/ /Context I check and my db user user has full access to the DB it's trying to use. Is it possible that I am missing a library or something in the classpath of tomcat? I already have the mysql connector library ( I had my DB connections working fine without datasources before, but I am trying to switch to using datasources). Thanks again Arturo Filip Hanik - Dev Lists wrote: put
Re: Tomcat 6 JDBC connection not found
here is the name you specify res-ref-namejdbc/my_jdbc_name/res-ref-name and here is your error Could not find datasource:jdbc/workout_logger as you can see, somewhere you have configured the string workout_logger, and that one doesn't exist Filip arturoguedez wrote: Hi! I have been reading how to setup datasources for Tomcat 6.0.18 in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html and nothing I have done has allowed my web application to view the datasource i have created. Here are some snippets of my web.xml, and my server.xml In the web.xml resource-ref descriptionDB Connection/description res-ref-namejdbc/my_jdbc_name/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In server.xml I have tried to place the following snip it anywhere I saw in the docs it could belong to (ei, in the GlobalNamingResources, inside the Host tag, or inside the Context tag in all possible locations (under META-INF/context.xml, under $CATALINA_BASE/conf/[engine]/[host]/[path].xml) and I haven't been successful. Resource name=jdbc/my_jdbc_name auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true/ I am using Entity Managers to get my connections opened, here is the snip it of my persistence.xml persistence-unit name=my_pu_name transaction-type=RESOURCE_LOCAL non-jta-data-sourcejdbc/my_jdbc_name/non-jta-data-source /persistence-unit Here is what I get in my tomcat logs: 08/12/21 17:32:17 ERROR ceConnectionProvider: Could not find datasource: jdbc/workout_logger javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52) Does anybody know what I am doing wrong? Is there any way to check which resources Tomcat makes avaiable? I am having a really hard time understanding what I am doing wrong. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Using precompiled JSPs
http://people.apache.org/~fhanik/precompile.html Filip motit wrote: 1. see my ant script below 2. I didn’t change the jasper’s package name hierarchy (e.g org.apache.jsp) 3. I did update my war’s web.xml with the jspservet mapping with *.jsp 4. I have assisted by http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html target name=compile.jsp taskdef classname=org.apache.jasper.JspC name=jasper classpath fileset dir=${tomcat.home}/lib include name=jasper.jar/ include name=jasper-el.jar/ include name=servlet-api.jar/ include name=jsp-api.jar/ include name=el-api.jar/ /fileset fileset dir=${tomcat.home}/bin include name=tomcat-juli.jar/ /fileset /classpath /taskdef jasper uriRoot={jsp.src} outputDir={temp}/ javac srcdir={temp} destdir=${tomcat.home}/${webapp.path}/WEB-INF/classes debug=on verbose=true classpath … /classpath /javac /target Thanks Moti - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 does not start in a cluster. It simply hangs... Any Idea..
When this happens, simply take a thread dump, and we can see why it is hanging Unix: kill -3 pid jstack -l pid Windows Ctrl+Break in the console jstack -l pid Filip jsandhu2204 wrote: Problem1 : While starting tomcat6, sometimes it starts other times it simply hangs on the following message: INFO: Manager [localhost#/ivos]; session state send at 12/12/08 12:34 AM received in 110 ms. Tomcat Log: INFO: Register manager /ivos to cluster element Engine with name Catalina Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager start INFO: Starting clustering manager at /ivos Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [localhost#/ivos], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 88, 8, 28}:4002,{10, 88, 8, 28},4002, alive=123501,id={27 -68 111 -64 -49 -117 68 38 -98 -27 -49 39 -22 6 -88 -38 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Dec 12, 2008 12:34:53 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [localhost#/ivos]; session state send at 12/12/08 12:34 AM received in 110 ms. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: problem in getting large object in pooled database
accessToUnderlyingConnectionAllowed=true see exact steps here http://commons.apache.org/dbcp/configuration.html Filip ahmet temiz wrote: hello I try to develop jsf application with pooled postgresql and tomcat 6. when I try to retrieve large object, I get exception. here is the code that creates exception: PGConnection pgCon = (PGConnection) ((DelegatingConnection)conn).getInnermostDelegate(); java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to org.apache.commons.dbcp.DelegatingConnection what changes should I made ? regards - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 JDBC connection not found
put this Resource name=jdbc/workout_logger auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true/ inside the GlobalNamingResources in server.xml Put this ResourceLink name=jdbc/workout_logger global=jdbc/workout_logger/ inside the Context elemement in conf/context.xml and try again Filip arturoguedez wrote: hey, sorry about that. The actual string I have in my app is workout_logger I just tried to replace my strings for my_jdbc_name for the posting. I guess I forgot to rename the in the error. other than that, do you see anything else wrong? Filip Hanik - Dev Lists wrote: here is the name you specify res-ref-namejdbc/my_jdbc_name/res-ref-name and here is your error Could not find datasource:jdbc/workout_logger as you can see, somewhere you have configured the string workout_logger, and that one doesn't exist Filip arturoguedez wrote: Hi! I have been reading how to setup datasources for Tomcat 6.0.18 in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html and nothing I have done has allowed my web application to view the datasource i have created. Here are some snippets of my web.xml, and my server.xml In the web.xml resource-ref descriptionDB Connection/description res-ref-namejdbc/my_jdbc_name/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref In server.xml I have tried to place the following snip it anywhere I saw in the docs it could belong to (ei, in the GlobalNamingResources, inside the Host tag, or inside the Context tag in all possible locations (under META-INF/context.xml, under $CATALINA_BASE/conf/[engine]/[host]/[path].xml) and I haven't been successful. Resource name=jdbc/my_jdbc_name auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=user password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/database_name?autoReconnect=true/ I am using Entity Managers to get my connections opened, here is the snip it of my persistence.xml persistence-unit name=my_pu_name transaction-type=RESOURCE_LOCAL non-jta-data-sourcejdbc/my_jdbc_name/non-jta-data-source /persistence-unit Here is what I get in my tomcat logs: 08/12/21 17:32:17 ERROR ceConnectionProvider: Could not find datasource: jdbc/workout_logger javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137) at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52) Does anybody know what I am doing wrong? Is there any way to check which resources Tomcat makes avaiable? I am having a really hard time understanding what I am doing wrong. - 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: tomcat 6 delta manager dirtyFlag
rohit aman wrote: Hi, I have tomcat cluster setup and it's working fine. All I need to do now is to replicate the session after every request. For SimpleTcpReplicationManagerhttp://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/cluster/session/SimpleTcpReplicationManager.html we can use useDirtyFlag. But, is there a way to do it with DeltaManger? So, I guess the question is, to replicate the session after each request, with DeltaManager (for tomcat 6), what flag needs to be set? Its not possible, DeltaManager replicates delta's only. However, you can easily achieve the same thing by writing a filter that creates the delta for you pseudo code for your filter 1. extract all attribute names from the session 2. for each attribute name 3. decide if you want it replicated 4. if yes, get the attribute and set it again Filip Thanks for the help Rohit - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TOMCAT Win Server 2003
you probably compiled your .class using JDK 1.6, and then you run Tomcat using JDK 1.5 Filip gen wrote: Hi, All Thanks in advance, I need helps on the follows. I have the following problems/questions. 1. Is TOMCAT6 running at the platform of Win server 2003? 2. I faied to install TOMCAT6, so I swith to TOMCAT5.5, it is running, but I had another problems as follows: I use Eclipse3.3 as my tool. I use TOMCAT5.5.27+MySQL5.1+JSP+JAVA to develope. All, including server, run under Eclipse. Everything seems running well under environment of Eclipse3.3. So I create the *.war file and exit Eclipse3.3, start TOMCAT5.5 by service, deploy *.war. And start I.E. to browse, the 1st page (only *.jsp code) was shown OK. But when I click the link which will access to java classes, it gave me the following bad-version errors. I just get confused when everything running well under Eclipse3.3, but failed under on service. What/how can I solve this? Thanks again. org.apache.jasper.JasperException: Bad version number in .class file org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra pper.java:460) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 55) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 原因 javax.servlet.ServletException: Bad version number in .class file org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:774) org.apache.jsp.hoshu.com_jsp._jspService(com_jsp.java:149) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 31) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 原因 java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(Unknown Source) java.security.SecureClassLoader.defineClass(Unknown Source) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo ader.java:1876) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav a:889) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1353) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1232) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:125) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63) java.lang.ClassLoader.loadClassInternal(Unknown Source) org.apache.jsp.hoshu.com_jsp._jspService(com_jsp.java:60) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 31) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) Regards - 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: How do you determine the amount of Tomcat threads in use?
I'd say this is the best way to do it, since it gives you an accurate count. Filip Mark Stevens wrote: Hi all, Just a quick question on how to see threads in use, I have been using prstat -L -p tomcat java process, however I suspect this is not the correct way to do it. Thanks, Mark. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: A few clustering related doubts
Pieter Temmerman wrote: Hi I got a Tomcat cluster set up, which is working for most applications. However, since I am experiencing some problems (See another thread of mine Deltamanager + Session beans: Do they like eachother?), I reread the Tomcat clustering documentation. The following are a few things that are not clear to me, I would definitely appreciate it if someone could answer my doubts :) Note: I'm using Tomcat 5.5.27 According to http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html : 1. Make sure that jvmRoute attribute is set at your Engine Engine name=Catalina jvmRoute=node01 I thought this was only necessary if I wanted to have session affinity. I just want my sessions to be replicated, I don't want to have session affinity. With the delta manager you don't need session affinity, but from a performance standpoint, it is unwise not to use it. However, it should still work without session affinity. If you don't want to use affinity, remove the jvmRoute attribute 2. Make sure that your loadbalancer is configured for sticky session mode Again, I thought this was not necessary if session affinity was not required. see above 3. From the O'reilly: Tomcat The definitive guide book: You must have both the distributable=true attribute set on the webapp’s Context and the distributable/ element in the webapp’s web.xml for session clustering to work. The Tomcat website states: Make sure your web.xml has the distributable/ element or set at your Context distributable=true / Note the -OR-, it does not say -AND-. Until now I only specified this tag in web.xml, which seemed to work just fine. That is correct, you only need web.xml (that is the spec defined way) you don't need a Context element/attribute. Filip - 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: DeltaManager + Session beans: Do they like eachother?
the DeltaManager (and BackupManager 6.0) only triggers on setAttribute/removeAttribute so this wont work Cart cart = (Cart)session.getAttribute(cart); cart.addItem(cucumber); the simple tcp replication manager replicates the entire session and is able to capture this scenario but that is not the way to go, if you change something in the session, just call setAttribute Cart cart = (Cart)session.getAttribute(cart); cart.addItem(cucumber); session.setAttribute(cart,cart); Filip Pieter Temmerman wrote: Hello everybody, First of all, to avoid any misunderstandings, below problems relate to applications that I did not write, neither do I exactly know the implementation of them. Although, if required, I can ask the programmer for more information. That being said, the problem that I am seeing is that the application that I deployed on a Tomcat 5.5.27 cluster is not correctly handling session replication. (The application works perfectly on a single server). The reason for thinking this is that the application fails, but only at irregular intervals. When I press F5, then the page eventually comes true. As said before, this does not happen in a single server environment. According to the Tomcat logs, I can see that my request is being served by Tomcat1 and by Tomcat2, and vice versa. My server.xml configuration: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true clusterLog=true clusterLogName=clusterlog Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.6 mcastPort=45566 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=172.18.0.39 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=25/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 keepAliveTimeout=2 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 Something interesting that I figured out is that if I change the managerClass from managerClassName=org.apache.catalina.cluster.session.DeltaManager to managerClassName=org.apache.catalina.cluster.session.SimpleTcpReplicationManager then the application works fine. (It keeps working when I set useDirtyFlag to false). One would think that the DeltaManager is just not replicating, but I can see the following messages in catalina.out: catalina.out:INFO: Manager[/Application1], requesting session state from org.apache.catalina.cluster.mcast.McastMember[tcp://172.18.0.40:4001,catalina,172.18.0.40,4001, alive=73627]. This operation will timeout if no session state has been received within 60 seconds catalina.out:INFO: Manager[/Application1], session state received in 104 ms. Currently the only information that I have about the application is that it's using JSF and session beans. The developer said he does not need to explicitly put session.SetAttribute(whatever), since this is automatically taken care of by the session bean object. I'm not a Java programmer, so I'm not sure whether that is correct. I would really appreciate if someone could point me into the right direction. Btw. I cannot change the managerclass to SimpleTcpReplicationManager, as I got other applications on the same server that start failing if that manager is used. - 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: tomcat 6.0.18 clustering.. session getting replicated partially
after modifying the cart, you must add session.setAttribute(cart,cart) to trigger replication Filip rohit aman wrote: Hey Filip, sorry abt that. here is the example web application zip file: http://www.yousendit.com/download/TTZuRFFhbEo5eFh2Wmc9PQ please unzip it, put it in your webapps directory, then you should be able to access the cart using https://hostname/clusterex/sessions/carts.jsphttps://%3chostname%3e/clusterex/sessions/carts.jsp juss FYI...this is how u can reproduce it 1) set the LB for sticky sessions 2) start tomcat1 3) access the cart and add some items (lets say 6 items) 4) now start tomcat2 5) add some more items ( lets say 3 more...so total items would be 6+3=9) (here request still goes to tomcat 1 because of sticky sessions setup) 6) stop tomcat1 7) add some more items (now request goes to tomcat2, here we can see that the new item gets added as 7th item to the first 6 items and the 3 items we added later can not be seen) Thanks for the help rohit On Tue, Nov 25, 2008 at 10:20 AM, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: you're attachment didn't go through, just post a complete example somewhere on the web. for free support, you can't expect the other guy (me in this case) to have to spend time setting up to replicate your environment instead, you do the legwork, and you get help for free, not a bad trade if you ask me Filip rohit aman wrote: Hi Filip, All I did was to modify sessions application that comes with tomcat. It's just two simple changes shown below. 1) Replace the DummCart.class in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions with the attached one. 2)mark the web.xml in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF as distributable by adding /distributable tag 3)then access this by using https://localhost/examples/jsp/sessions/carts.jsp Please let me know...Thanks for doing this Rohit On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: post a sample app, and we can test it out Filip rohit aman wrote: Hi, I had setup a tomcat cluster with two nodes. followed the instructions from tomcat 6 clustering how to document. I created a sample application to test out my cluster. This application has a cart where u can add items. now, the problem is, not all session variables are getting replicated. below is the scenario.. 1)start tomcat 1 2)access the cart add items to it ( lets say added 5 items ) 3)start tomcat 2 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat 1 again because my LB is configured for sticky sessions) 5)stop tomcat 1 6)access the cart (now the request goes to tomcat 2)...here *I can only see the first 5 items where as it should be 8. *So, the next three did not get replicated. whichever session or session attribute gets created when both nodes are running is not getting replicated for some reason. I am monitoring both nodes with Jconsole. In Jconsole the number of session for the application = sessions in node 1 + sessions in node 2. So, this says that sessions are being replicated. But, I am not sure why I am not able to access all sessions/sessionAttributes. Any help is very much appreciated. Thanks Rohit - To start a new topic, e-mail: users@tomcat.apache.org mailto:users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[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 unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Saved state has incompatible save version
I don't think that is a Tomcat error, more likely to come from the application running inside tomcat Filip [EMAIL PROTECTED] wrote: Dear all, i got this error message in catalina.out: FATAL ERROR: Saved state has incompatible save version Does anybody know what this means and what causes this error? Thank you Thinh - 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 gets stuck after a load for streams writing
6.0.18 tons of bug fixes (and security) Filip Michal Singer wrote: * I see that the requests processors increase but it does not stop the stuck * The data base is slow on get connection but i checked the connections and i still have many left that can be used * i see that the active threads count get to the limit before the stuck (according to jconsole) but after the stuck it goes down to 0 back again and it is still stuck so i don't believe the problem is no threads available for work * as for the stream requests: i use jmeter to create soap requests. i saw that it uses org.apache.commons.httpclient.methods.RequestEntity to write the requests as streams. when i use the jmeter to send after tomcat stops processing requests, it does not get the request when i use my own simulator which writes a regular string using http client - the tomcat does receive the request Caldarale, Charles R wrote: From: Michal Singer [mailto:[EMAIL PROTECTED] Subject: RE: tomcat gets stuck after a load for streams writing i configured the maxThreads on the executor and didn't help. It should have let you get to 400 request processors, rather than the default of 200 that you were seeing. i also checked the thread dumps. And where do they show the threads are? If you can force the hang with any number of threads, then set maxThreads to a low value, and see where they are executing when the stall occurs; things will be easier to figure out when there's less to look at. i still don't understand why it would cause a completey unrecovable tomcat stuck. If all the possible threads are already working on requests, no more requests will be honored. You could also be out of data base connections (assuming you are using one), resulting in all threads waiting until a connection becomes available. If you webapp fails to return connections to the pool in *all* circumstances, eventually you'll hang. What also is weird is that it gets stuck only for stream writing. this does not seem like a problem in our server. why can i still send string messages? I don't know what you mean by stream writing vs string messages. If these are actions performed by the client you're using to test Tomcat with, it's irrelevant how the requests are constructed on the client end - it's all HTTP by the time it comes over the wire. If one of the mechanisms is passing in bad headers, that's a different matter. An improperly terminated chunked request could tie up a thread for quite some time. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to stop SimpleTcpReplicationManager
If you are using Tomcat 6, you can also use BackupManager Filip Pieter Temmerman wrote: This problem is solved. I replaced the SimpleTcpReplicationManager by the DeltaManager and everything works as expected. On Wed, 2008-12-03 at 23:48 +0100, Pieter Temmerman wrote: Hi all, I'm having two Tomcats which are placed in a cluster. If I stop and start a context (instead of completely stopping/restarting Tomcat), then I see the following error in catalina.out: ERROR: Unable to stop SimpleTcpReplicationManager No other information is specified. I have been Googling, but haven't found any explanation. I took a look at the source code of the SimpleTcpReplicationManager, but I can't derive from it what could have gone wrong. When I try to restart the context, then I see the following error: ERROR: Starting... no cluster associated with this context:/dist/preproduction/wasuzi I'm guessing the latter error is related to the first one. Unfortunately, right now I don't have access to the server.xml to post the configuration info. In a couple of hours I will, but I thought I'd give a heads up, just in case anybody has seen this error before. Before I forget, when I stop/start Tomcat completely, I don't see this error, it's only happening when reloading a context. 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: Rogue https threads
a simple upgrade to 6.0.18 would most likely solve your problem Filip Robert J Morman wrote: Good afternoon. We have a problem with our production tomcat server in that the CPU will climb after a restart from 1-2% to 100%. The rate of climb corresponds to the amount of traffic we receive (the more we have, the faster it climbs). I noticed a couple days ago (by using Lambda Probe), that we are getting 'rogue' https threads. These are threads that are stuck in the Service stage for a particular request. I notice that as these threads become stuck persistently-serviced, the CPU seems to jump about 6% at a time (for each thread). Once we hit 99-100% CPU, we have about 15 of these and we are required to restart tomcat (as it's not responding with much priority). Lmbda Probe notes that there are no Current Busy threads, even though it shows these as being Serviced. Is there a way to get these to time out? Specifics: Tomcat 6.0.16 Java 1_5_16 Conf connection snippets: Connector port=80 protocol=HTTP/1.1 connectionTimeout=2 enableLookups=false maxThreads=100 minSpareThreads=5 maxSpareThreads=40 redirectPort=443 / Connector protocol=org.apache.coyote.http11.Http11NioProtocol connectionTimeout=6 port=443 minSpareThreads=5 maxSpareThreads=15 enableLookups=false disableUploadTimeout=false acceptCount=100 maxThreads=100 scheme=https secure=true SSLEnabled=true keystoreFile=e:\apache\tomcat6\.keystore keystorePass=changeit clientAuth=false sslProtocol=TLS/ Session timeout is set to 30 minutes in web.xml. Bob Morman EMCSA, MCSA Enterprise Systems Manager ASM International Headquarters http://www.asminternational.org blocked::http://www.asminternational.org/ 440/338-5151 x5478 The No. 1 reference on metals casting is back with new ways to improve energy efficiency, productivity and product performance! Read free sample articles from the all-new ASM Handbook, Volume 15: Casting, and take advantage of special pre-publication prices before Dec. 15. For more on ASM Handbooks: http://asmcommunity.asminternational.org/portal/site/www/MatInformation/Handbooks/. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tribes and IPv6 Support
Thanks Mike, This would really be a JVM issue, and it doesn't look that promising http://x86.sun.com/thread.jspa?messageID=10274291 http://forums.java.net/jive/thread.jspa?messageID=247308 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4640544 Filip Mike Wannamaker wrote: I'm having an issue starting tribes under tomcat 5.5 on Windows 2008 Server, IPv6 only setup. Get the following exception Dec 1, 2008 11:25:07 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Unable to bind server socket to:/fe80:0:0:0:c8cb:7933:1d84:c05d:4099 throwing error. Dec 1, 2008 11:25:07 AM org.apache.catalina.tribes.transport.nio.NioReceiver start SEVERE: Unable to start cluster receiver java.net.SocketException: Address family not supported by protocol family: bind at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:205) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:217) at
Re: Threadpool doesn't contain any threads
could just be flaky jmx code, meaning we don't publish completely accurate numbers Filip Kees Jan Koster wrote: Dear Praveen, Everyday we are noticing the tomcat not responding on a port. On further inspection we noticed that the thread pool that is serving this port has no threads. Right around the time tomcat goes into this state, we noticed that there is a thread death, and get the following stack trace Does this happen randomly on the day, or at a specific time of day? Is it reproducible on a test machine? What other activity is going on around the time that Tomcat dies? Cron jobs? Backups? Network changes? Did anyone else notice this issue. Another minor caveat is, we built Tomcat using JDK 1.5 but are running it on JDK 1.6. Could this be causing any issue? Hum. You built your own Tomcat? Is there a test environment that you can test this application with a pre-built one from Apache.org? Just to make sure. Also I used Jconsole and noticed that currentThreadBusy and currentThreadCount are both -1. I'm not sure that these figures can be trusted once the thread pool has died. -- Kees Jan http://java-monitor.com/forum/ [EMAIL PROTECTED] 06-51838192 Human beings make life so interesting. Do you know that in a universe so full of wonders, they have managed to invent boredom. Quite astonishing... -- Terry Partchett - 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.18 clustering.. session getting replicated partially
you're attachment didn't go through, just post a complete example somewhere on the web. for free support, you can't expect the other guy (me in this case) to have to spend time setting up to replicate your environment instead, you do the legwork, and you get help for free, not a bad trade if you ask me Filip rohit aman wrote: Hi Filip, All I did was to modify sessions application that comes with tomcat. It's just two simple changes shown below. 1) Replace the DummCart.class in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions with the attached one. 2)mark the web.xml in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF as distributable by adding /distributable tag 3)then access this by using https://localhost/examples/jsp/sessions/carts.jsp Please let me know...Thanks for doing this Rohit On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: post a sample app, and we can test it out Filip rohit aman wrote: Hi, I had setup a tomcat cluster with two nodes. followed the instructions from tomcat 6 clustering how to document. I created a sample application to test out my cluster. This application has a cart where u can add items. now, the problem is, not all session variables are getting replicated. below is the scenario.. 1)start tomcat 1 2)access the cart add items to it ( lets say added 5 items ) 3)start tomcat 2 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat 1 again because my LB is configured for sticky sessions) 5)stop tomcat 1 6)access the cart (now the request goes to tomcat 2)...here *I can only see the first 5 items where as it should be 8. *So, the next three did not get replicated. whichever session or session attribute gets created when both nodes are running is not getting replicated for some reason. I am monitoring both nodes with Jconsole. In Jconsole the number of session for the application = sessions in node 1 + sessions in node 2. So, this says that sessions are being replicated. But, I am not sure why I am not able to access all sessions/sessionAttributes. Any help is very much appreciated. Thanks Rohit - To start a new topic, e-mail: users@tomcat.apache.org mailto:users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[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: tomcat 6.0.18 clustering.. session getting replicated partially
post a sample app, and we can test it out Filip rohit aman wrote: Hi, I had setup a tomcat cluster with two nodes. followed the instructions from tomcat 6 clustering how to document. I created a sample application to test out my cluster. This application has a cart where u can add items. now, the problem is, not all session variables are getting replicated. below is the scenario.. 1)start tomcat 1 2)access the cart add items to it ( lets say added 5 items ) 3)start tomcat 2 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat 1 again because my LB is configured for sticky sessions) 5)stop tomcat 1 6)access the cart (now the request goes to tomcat 2)...here *I can only see the first 5 items where as it should be 8. *So, the next three did not get replicated. whichever session or session attribute gets created when both nodes are running is not getting replicated for some reason. I am monitoring both nodes with Jconsole. In Jconsole the number of session for the application = sessions in node 1 + sessions in node 2. So, this says that sessions are being replicated. But, I am not sure why I am not able to access all sessions/sessionAttributes. Any help is very much appreciated. Thanks Rohit - 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: Connectors and apache with mpm worker
remove this worker.maintain=30 worker.worker1.connection_pool_size=1 for now, and just accept the defaults Filip Martin Spinassi wrote: Hi everyone! I'm doing some performance tests under apache and tomcat using jakarta connectors. Searching around, I've read about apache-worker (not jakarta), to make it multi-process and multi-thread, but I'm having some troubles with connectors now. Here is the output of jk_mod_log: [error] jk_handler::mod_jk.c (2410): Could not get endpoint for worker=worker1 [info] jk_handler::mod_jk.c (2476): Service error=0 for worker=worker1 And here is my workers.properties: worker.worker1.port=8009 worker.worker1.host=127.0.0.1 worker.worker1.type=ajp13 worker.maintain=30 worker.worker1.connection_pool_size=1 worker.worker1.fail_on_status=503 worker.list=worker1 If I browse the site, it loads really faster, but with some little more traffic (2 connections by second), I get all those errors at jk_mod_log. Can you give me some help? I just can't find what to modify or what is wrong with my configuration. Thanks to all! Martin - 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: cluster configuration
239.176.50.121 should be in the address attribute, not in the bind attribute. the bind attribute is what network card you wanna use for multicasting, the address is what address you wanna use to send your pings over Filip Mike Wannamaker wrote: Hi Filip 1. We are using tribes from 6.0.18, we have a unique situation we are on 5.5.25, however we are starting tribes ourselves. See my startup code below. 2. It should be valid 239.176.50.121 is a valid Class D IPv4 address (224.0.0.0 - 239.255.255.255) 3. No Windows XP 64 bit. Tribes startup code: public synchronized void startup() { if(_tribesChannel == null) { // nothing to do if already running try { _tribesChannel = new GroupChannel(); // must be done before start: MembershipService mService = _tribesChannel.getMembershipService(); McastService mCastService = (McastService)mService; mCastService.setPort(_mainPort); mCastService.setAddress(_multicastIPAddr); mCastService.setRecoveryCounter(10); // 10 Seconds instead of 3 seconds? mCastService.setDropTime(10*1000); if(_desiredLocalIPAddr != null) { mCastService.setBind(_desiredLocalIPAddr); } if(_ancillaryPort 0) { ChannelReceiver receiver = _tribesChannel.getChannelReceiver(); if(receiver.getPort() != _ancillaryPort) { if(receiver instanceof ReceiverBase) { ((ReceiverBase)receiver).setPort(_ancillaryPort); } } } _tribesChannel.addInterceptor(new TcpFailureDetector()); _tribesChannel.addMembershipListener(_tribesMembershipListener); _tribesChannel.addChannelListener(_tribesChannelListener); _tribesChannel.start(CHANNEL_COMPONENTS); addToTopology(); } catch(ChannelException ex) { try { _tribesChannel.stop(CHANNEL_COMPONENTS); } catch(Throwable t) { /*gulp*/} _tribesChannel = null; throw new RuntimeException(ex); // todo, exception handling? } } } -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: November 19, 2008 5:01 PM To: Tomcat Users List Subject: Re: cluster configuration just to make sure 1. you are using 6.0.18 and 2. the IP you are trying to bind to is valid and 3. could you be using linux? this is the code that is telling you about the failure 186 : fhanik 586228 if (mcastBindAddress != null) { 187 : try { 188 : log.info(Attempting to bind the multicast socket to +address+:+port); 189 : socket = new MulticastSocket(new InetSocketAddress(address,port)); 190 : } catch (BindException e) { 191 : /* 192 : * On some plattforms (e.g. Linux) it is not possible to bind 193 : * to the multicast address. In this case only bind to the 194 : * port. 195 : */ 196 : log.info(Binding to multicast address, failed. Binding to port only.); 197 : socket = new MulticastSocket(port); 198 : } Mike Wannamaker wrote: I'm having an issue with clustering in tomcat and tribes. I get this output, I'm not sure why Tribes can't bind to the multicast address? It then binds to localhost which doesn't allow machines to see each other. Any help is appreciated. 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.6.2.89:4000 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Attempting to bind the multicast socket to /239.176.50.121:45566 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Binding to multicast address, failed. Binding to port only. 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting multihome multicast interface to:localhost/127.0.0.1 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 19-Nov-2008 3:30:24 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 19-Nov-2008 3:30:24 PM org.apache.catalina.tribes.membership.McastServiceImpl
Re: SSL setup question
the infinite loop is fixed in 6.0.18, the system will still not start, since the JVM you're running with doesn't support the type of cipher that you're keystore is trying to use search http://tomcat.markmail.org for the same error, it's been answered before Filip Neil B. Cohen wrote: I'm having a problem setting up SSL with Tomcat. The situation is this: I have a system running IBM's Netcool/Portal software. We added SSL to the Portal a while back. I created a certificate for the machine. However, Netcool/Portal does not create a keystore file - you simply copy the certificate as a text file into a specific directory and it works from there. Netcool/Portal has its own version of the JDK. Now, on the same machine, I have installed a current JDK (v1.6) and my own installation of Tomcat (v6.0.16). Runs just fine on port 8080. I want to add SSL capability to the Tomcat setup so I can talk to it using https. I created a keystore file using the certificate we generated for Netcool, as follows: keytool -importcert -v -trustcacerts -alias tomcat -keystore path_to_keystore/keystore.kdb -file /opt/netcool/portal/path_to_cert/server.crt Then, keytool -list -keystore ./keystore.kdb Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry tomcat, Nov 20, 2008, trustedCertEntry, Certificate fingerprint (MD5): 11:87:A8:7C:BB:55:AC:68:46:34:4F:45:7D:62:9C:AF So I have a keystore. I set up the tomcat server.xml file: Connector port=7443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true clientAuth=false keystoreFile=/usr/path_to_keystore/keystore.kdb keystorePass=password sslProtocol=TLS / And when I start Tomcat, I get an infinite loop in the log file that looks like: Nov 20, 2008 1:40:17 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 20, 2008 1:40:17 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-7443 Nov 20, 2008 1:40:17 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 886 ms Nov 20, 2008 1:40:17 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 20, 2008 1:40:17 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.16 Nov 20, 2008 1:40:18 PM com.sun.faces.config.ConfigureListener contextInitialize d INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for co ntext '/NCAdmin' Nov 20, 2008 1:40:20 PM org.apache.catalina.core.StandardContext addApplicationL istener INFO: The listener listeners.ContextListener is already configured for this co ntext. The duplicate definition has been ignored. Nov 20, 2008 1:40:20 PM org.apache.catalina.core.StandardContext addApplicationL istener INFO: The listener listeners.SessionListener is already configured for this co ntext. The duplicate definition has been ignored. Nov 20, 2008 1:40:20 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 20, 2008 1:40:20 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-7443 Nov 20, 2008 1:40:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No avai lable certificate or key corresponds to the SSL cipher suites which are enabled. at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESo cketFactory.java:150) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java: 310) at java.lang.Thread.run(Thread.java:619) Nov 20, 2008 1:40:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No avai lable certificate or key corresponds to the SSL cipher suites which are enabled. at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESo cketFactory.java:150) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java: 310) at java.lang.Thread.run(Thread.java:619) Nov 20, 2008 1:40:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No avai lable certificate or key corresponds to the SSL cipher suites which are enabled. at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESo cketFactory.java:150) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java: 310) at java.lang.Thread.run(Thread.java:619) Nov 20, 2008 1:40:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed I'm not an SSL expert, so I'm not
Re: CometProcessor questions
Franck Wolff wrote: Hi Filip, Hum... I need a CometProcessor (long-polling) for data push, even if requests/responses are encoded in AMF3. you can do this, that's ok. Not as efficent as using send file, which you could write your own long poll servlet to do (see DefaultServlet.java how to initiate a send file) Everything is based on subscription to topics (Consumer) messages publication (Producer) and, while it could work with a standard servlet (polling), it won't be efficient. Anyway: my code mostly work, I'm just experiencing unexpected behaviors on (rather) heavy load: some events are invalid (getHttpRequest throws a NPE) and I'm wondering what should be done with those events (I currently try to close them). I'm also wondering what should be done when a TIMEOUT is received when a previous BEGIN event is used for writing a response: for example, after a 20s (APR timeout), it is possible (but rare) that a message is received (from another client) and dispatched so a previous BEGIN event (long-polling again) is used when writing the response. In that case, is the BEGIN event still valid? shouldn't be, you could use the NIO connector and control the timeout behaviour using CometEvent.setTimeout And what about the CLIENT_DISCONNECT event? disconnect is just a subtype, its would be captured by a CometEvent.EventType.ERROR or CometEvent.EventType.END event. a client disconnect really means nothing in the bayeux world though, the client has to explicitly send a I'm done message or the server has to have a separate timeout, unrelated to socket events. I'm sorry to ask the same questions again but I would love some answers ;-) I'll try Tomcat trunk when I'll have some time. please do, its easy to build ant download ant and the tomcat build is in output/build Regards, Franck. hi Franck, Franck Wolff wrote: Hi Filip, Ok, my (partly) mistake. I've missread this comment: ///GET method or application/x-www-form-urlencoded/ in BayeuxServlet.checkBayeux... Anyway, I can't change everything now and I need to read the request input stream (I'm getting AMF3 binary data), not to get a request parameter as in: if you need to stream up data, no need to do that using Bayeux, just use a regular servlet for that. String message = cometEvent.getHttpServletRequest().getParameter(Bayeux.MESSAGE_PARAMETER); When you speak about patches in the trunk, does it apply to comet support in general or the Bayeux impl, and what issue is it intented to fix? Will it be available in 6.0.19 and (approximatively) when? both, some fixes are for the Comet behavior and Bayeux will exist as an independent module. There are a few fixes already applied in the 6.0.x branch, and a couple of more are pending, waiting for review Filip Thanks for your reply, Franck. it only does POST, no GET messages, there is a patch pending (and one already applied) for 6.0 when it comes to comet, so testing with trunk would be best Filpi Franck Wolff wrote: Hi again, I just checked the Bayeux in Tomcat and it cannot work for me: it seems to only support GET request (am I wrong?)... Regards, Franck. Hi, Thanks for your reply! I didn't know about this Bayeux impl in Tomcat, so I developed my own implementation (that is not strictly conforming to the spec, just very close). I'm going to check this module and see if I can get some hints. What about the CLIENT_DISCONNECT event sub type? Any hints? Regards, Franck. hi Franck, are you using this Bayeux impl? http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/ or do you have your own? Filip Franck Wolff wrote: Hi, I'm developing Tomcat/Comet support for Granite Data Service http://www.graniteds.org (Flex clients) and I've got few questions about CometEvents processing. Basically, my implementation is based on the Bayeux protocol (long-polling only) and two connections (command/tunnel) are opened for each clients (producer/consumer). I use a thread pool in order to dispatch received messages to each consumer subscribed to the relevant topic. Here are my questions: 1. What should happen exactly if Tomcat send a timeout event when the current event (ie: a previous BEGIN event whose request input stream was fully read when it was received) is used for writing a response? Is this previous BEGIN still valid and may be used to write the response? If not, should it be close right away and may I use the timeout event instead or should I wait for a next BEGIN event? Is it the same event instance whose type/subtype has changed? 2. Tomcat send me sometime (rather rare but it happens) invalid END events (getHttpServletRequest() issues a NullPointerException). I'm just trying by now to close them and it don't affect my application behavior but I'm wondering why those invalid event aren't thrown away by Tomcat from the beginning and what should be done exactly with them? 3. I'm never receiving any ERROR event except for
Re: CometProcessor questions
for very small responses you don't need send file, and can just write the response out to the servlet output stream on an async thread while the request thread is used to do other stuff in the contains Filip Franck Wolff wrote: I'm not doing file streaming... A typical usage of my implementation is a Flex based chat application with very small requests/responses. The important thing for me is: I want the request thread to be reused for other incoming requests and, as far as I understand long-polling issues (keeping the request thread busy while waiting for something to send), this exactly what Tomcat CometProcessor (or Jetty Continuation, or Grizzly CometEngine, etc.) may offer. Maybe I'm missing something, but send file is not very suitable for chat applications... Regards, Franck. Franck Wolff wrote: Hi Filip, Hum... I need a CometProcessor (long-polling) for data push, even if requests/responses are encoded in AMF3. you can do this, that's ok. Not as efficent as using send file, which you could write your own long poll servlet to do (see DefaultServlet.java how to initiate a send file) Everything is based on subscription to topics (Consumer) messages publication (Producer) and, while it could work with a standard servlet (polling), it won't be efficient. Anyway: my code mostly work, I'm just experiencing unexpected behaviors on (rather) heavy load: some events are invalid (getHttpRequest throws a NPE) and I'm wondering what should be done with those events (I currently try to close them). I'm also wondering what should be done when a TIMEOUT is received when a previous BEGIN event is used for writing a response: for example, after a 20s (APR timeout), it is possible (but rare) that a message is received (from another client) and dispatched so a previous BEGIN event (long-polling again) is used when writing the response. In that case, is the BEGIN event still valid? shouldn't be, you could use the NIO connector and control the timeout behaviour using CometEvent.setTimeout And what about the CLIENT_DISCONNECT event? disconnect is just a subtype, its would be captured by a CometEvent.EventType.ERROR or CometEvent.EventType.END event. a client disconnect really means nothing in the bayeux world though, the client has to explicitly send a I'm done message or the server has to have a separate timeout, unrelated to socket events. I'm sorry to ask the same questions again but I would love some answers ;-) I'll try Tomcat trunk when I'll have some time. please do, its easy to build ant download ant and the tomcat build is in output/build Regards, Franck. hi Franck, Franck Wolff wrote: Hi Filip, Ok, my (partly) mistake. I've missread this comment: ///GET method or application/x-www-form-urlencoded/ in BayeuxServlet.checkBayeux... Anyway, I can't change everything now and I need to read the request input stream (I'm getting AMF3 binary data), not to get a request parameter as in: if you need to stream up data, no need to do that using Bayeux, just use a regular servlet for that. String message = cometEvent.getHttpServletRequest().getParameter(Bayeux.MESSAGE_PARAMETER); When you speak about patches in the trunk, does it apply to comet support in general or the Bayeux impl, and what issue is it intented to fix? Will it be available in 6.0.19 and (approximatively) when? both, some fixes are for the Comet behavior and Bayeux will exist as an independent module. There are a few fixes already applied in the 6.0.x branch, and a couple of more are pending, waiting for review Filip Thanks for your reply, Franck. it only does POST, no GET messages, there is a patch pending (and one already applied) for 6.0 when it comes to comet, so testing with trunk would be best Filpi Franck Wolff wrote: Hi again, I just checked the Bayeux in Tomcat and it cannot work for me: it seems to only support GET request (am I wrong?)... Regards, Franck. Hi, Thanks for your reply! I didn't know about this Bayeux impl in Tomcat, so I developed my own implementation (that is not strictly conforming to the spec, just very close). I'm going to check this module and see if I can get some hints. What about the CLIENT_DISCONNECT event sub type? Any hints? Regards, Franck. hi Franck, are you using this Bayeux impl? http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/ or do you have your own? Filip Franck Wolff wrote: Hi, I'm developing Tomcat/Comet support for Granite Data Service http://www.graniteds.org (Flex clients) and I've got few questions about CometEvents processing. Basically, my implementation is based on the Bayeux protocol (long-polling only) and two connections (command/tunnel) are opened for each clients (producer/consumer). I use a thread pool in order to dispatch received messages to each consumer subscribed to the relevant topic. Here are my questions: 1. What should happen exactly if Tomcat send a timeout event
Re: tomcat 6 clustering issue
this message 2008-11-20 17:08:29.999 [main] [INFO] org.apache.coyote.http11.Http11Protocol - Stopping Coyote HTTP/1.1 on http-8080 tells us that you stopped the tomcat instance Filip rohit aman wrote: Hi, I have a tomcat cluster ( with tomcat 1 and tomcat 2 ) with a hardware load balancer infront. Session replication only works in some scenario and does not in others. Here is the scenario where it works... 1) Start tomcat 1 2) access the web application ( session gets created in tomcat 1 ) 3) Start tomcat 2 ( session gets replicated onto tomcat 2 ) 4) kill tomcat 1 5) access the web application ( works fine ) N here is the scenario where it does not work 1) Start tomcat 1 2) Start tomcat 2 3) create atleast once session on tomcat 1 and tomcat 2 by accessing the web application 4) kill any tomcat.. lets say tomcat 1 5) try to access the session that got created in tomcat1 ( logs out from the we application...session attributes are lost ) and also gives the below warning on tomcat 1 Tribes-MembershipReceiver] [WARN] org.apache.catalina.tribes.membership.McastService - Error receiving mcast package. Sleeping 500ms java.net.SocketException: socket closed at java.net.PlainDatagramSocketImpl.receive0(Native Method) at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136) at java.net.DatagramSocket.receive(DatagramSocket.java:712) at org.apache.catalina.tribes.membership.McastServiceImpl.receive(McastServiceImpl.java:314) at org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:414) 2008-11-20 17:08:29.999 [Tribes-MembershipReceiver] [WARN] org.apache.catalina.tribes.membership.McastService - Error receiving mcast package. Sleeping 500ms java.net.SocketException: socket closed at java.net.PlainDatagramSocketImpl.receive0(Native Method) at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136) at java.net.DatagramSocket.receive(DatagramSocket.java:712) at org.apache.catalina.tribes.membership.McastServiceImpl.receive(McastServiceImpl.java:314) at org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:414) 2008-11-20 17:08:29.999 [main] [INFO] org.apache.coyote.http11.Http11Protocol - Stopping Coyote HTTP/1.1 on http-8080 I have my logs configured to debug level and all the messages I see from tribes show that the session is being replicated successfully. Please let me know if any of those logs are needed for better understanding. I am also monitoring tomcats with JConsole and it shows that the sessions are getting replicated. Thanks for your help Rohit - 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: CometProcessor questions
hi Franck, Franck Wolff wrote: Hi Filip, Ok, my (partly) mistake. I've missread this comment: ///GET method or application/x-www-form-urlencoded/ in BayeuxServlet.checkBayeux... Anyway, I can't change everything now and I need to read the request input stream (I'm getting AMF3 binary data), not to get a request parameter as in: if you need to stream up data, no need to do that using Bayeux, just use a regular servlet for that. String message = cometEvent.getHttpServletRequest().getParameter(Bayeux.MESSAGE_PARAMETER); When you speak about patches in the trunk, does it apply to comet support in general or the Bayeux impl, and what issue is it intented to fix? Will it be available in 6.0.19 and (approximatively) when? both, some fixes are for the Comet behavior and Bayeux will exist as an independent module. There are a few fixes already applied in the 6.0.x branch, and a couple of more are pending, waiting for review Filip Thanks for your reply, Franck. it only does POST, no GET messages, there is a patch pending (and one already applied) for 6.0 when it comes to comet, so testing with trunk would be best Filpi Franck Wolff wrote: Hi again, I just checked the Bayeux in Tomcat and it cannot work for me: it seems to only support GET request (am I wrong?)... Regards, Franck. Hi, Thanks for your reply! I didn't know about this Bayeux impl in Tomcat, so I developed my own implementation (that is not strictly conforming to the spec, just very close). I'm going to check this module and see if I can get some hints. What about the CLIENT_DISCONNECT event sub type? Any hints? Regards, Franck. hi Franck, are you using this Bayeux impl? http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/ or do you have your own? Filip Franck Wolff wrote: Hi, I'm developing Tomcat/Comet support for Granite Data Service http://www.graniteds.org (Flex clients) and I've got few questions about CometEvents processing. Basically, my implementation is based on the Bayeux protocol (long-polling only) and two connections (command/tunnel) are opened for each clients (producer/consumer). I use a thread pool in order to dispatch received messages to each consumer subscribed to the relevant topic. Here are my questions: 1. What should happen exactly if Tomcat send a timeout event when the current event (ie: a previous BEGIN event whose request input stream was fully read when it was received) is used for writing a response? Is this previous BEGIN still valid and may be used to write the response? If not, should it be close right away and may I use the timeout event instead or should I wait for a next BEGIN event? Is it the same event instance whose type/subtype has changed? 2. Tomcat send me sometime (rather rare but it happens) invalid END events (getHttpServletRequest() issues a NullPointerException). I'm just trying by now to close them and it don't affect my application behavior but I'm wondering why those invalid event aren't thrown away by Tomcat from the beginning and what should be done exactly with them? 3. I'm never receiving any ERROR event except for TIMEOUTs. I would be of course very interested in CLIENT_DISCONNECT events but I couldn't find any case where Tomcat would send me this handful event... I was expecting this event to be raised when the client app is closed or the net connection broken but Tomcat just stops sending me TIMEOUT events. It may be useful to say that I'm using APR and not NIO... 3. Would it be possible to use the Tomcat pool thread for sending the responses instead of creating and managing my own thread pool (I'm using standard Runnable objects submitted to my own pool but I could submit them to any other thread pool as well)? 4. Under stress tests (12 clients sending 10 messages/sec. while listening for the same topic, ie: they may get 12*10 messages/sec., but some of them (~5-10) are generally packaged in the same response), asynchronous read doesn't work anymore: a full read of the input stream must be done on the BEGIN event, otherwise, it seems that most incomming requests are lost... I didn't try to figure out what's going on but, as a matter of fact, asynchronous read seems to be broken on heavy load (just informative, I can use full read on the begin event). Regards, thanks in advance for any reply, Franck. - 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
Re: cluster configuration
just to make sure 1. you are using 6.0.18 and 2. the IP you are trying to bind to is valid and 3. could you be using linux? this is the code that is telling you about the failure 186 : fhanik 586228 if (mcastBindAddress != null) { 187 : try { 188 : log.info(Attempting to bind the multicast socket to +address+:+port); 189 : socket = new MulticastSocket(new InetSocketAddress(address,port)); 190 : } catch (BindException e) { 191 : /* 192 : * On some plattforms (e.g. Linux) it is not possible to bind 193 : * to the multicast address. In this case only bind to the 194 : * port. 195 : */ 196 : log.info(Binding to multicast address, failed. Binding to port only.); 197 : socket = new MulticastSocket(port); 198 : } Mike Wannamaker wrote: I'm having an issue with clustering in tomcat and tribes. I get this output, I'm not sure why Tribes can't bind to the multicast address? It then binds to localhost which doesn't allow machines to see each other. Any help is appreciated. 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.6.2.89:4000 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Attempting to bind the multicast socket to /239.176.50.121:45566 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Binding to multicast address, failed. Binding to port only. 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting multihome multicast interface to:localhost/127.0.0.1 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 19-Nov-2008 3:30:23 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 19-Nov-2008 3:30:24 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 19-Nov-2008 3:30:24 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 19-Nov-2008 3:30:25 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Initializing 3rdParty Loggers - 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 with Connection pooling in tomcat 5.5
the factory factory=oracle.jdbc.driver.OracleDriver should not be a driver, but a factory object for a javax.sql.DataSource Filip Felix Schumacher wrote: Am Dienstag, den 18.11.2008, 23:37 +0530 schrieb Sridhar n: Hello friends, I am doing small web application ,in that I am doing connection pooling.I followed these steps: *1.In Conf/server.xml - added below code* Server port=8005 shutdown=SHUTDOWN... Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource description=Oracle 9i database that can be updated and saved factory=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:oci9:@oracle username=scott password=tiger maxActive=20 maxIdle=10 maxWait=-1/ There seems to be surplus after -1, which would explain the excellent error message: Nov 18, 2008 11:31:22 PM org.apache.tomcat.util.digester.Digester fatalError SEVERE: Parse Fatal Error at line 42 column 85: Element type Resource must be followed by either attribute specifications, or /. org.xml.sax.SAXParseException: Element type Resource must be followed by either attribute specifications, or /. bye Felix - 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: CometProcessor questions
it only does POST, no GET messages, there is a patch pending (and one already applied) for 6.0 when it comes to comet, so testing with trunk would be best Filpi Franck Wolff wrote: Hi again, I just checked the Bayeux in Tomcat and it cannot work for me: it seems to only support GET request (am I wrong?)... Regards, Franck. Hi, Thanks for your reply! I didn't know about this Bayeux impl in Tomcat, so I developed my own implementation (that is not strictly conforming to the spec, just very close). I'm going to check this module and see if I can get some hints. What about the CLIENT_DISCONNECT event sub type? Any hints? Regards, Franck. hi Franck, are you using this Bayeux impl? http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/ or do you have your own? Filip Franck Wolff wrote: Hi, I'm developing Tomcat/Comet support for Granite Data Service http://www.graniteds.org (Flex clients) and I've got few questions about CometEvents processing. Basically, my implementation is based on the Bayeux protocol (long-polling only) and two connections (command/tunnel) are opened for each clients (producer/consumer). I use a thread pool in order to dispatch received messages to each consumer subscribed to the relevant topic. Here are my questions: 1. What should happen exactly if Tomcat send a timeout event when the current event (ie: a previous BEGIN event whose request input stream was fully read when it was received) is used for writing a response? Is this previous BEGIN still valid and may be used to write the response? If not, should it be close right away and may I use the timeout event instead or should I wait for a next BEGIN event? Is it the same event instance whose type/subtype has changed? 2. Tomcat send me sometime (rather rare but it happens) invalid END events (getHttpServletRequest() issues a NullPointerException). I'm just trying by now to close them and it don't affect my application behavior but I'm wondering why those invalid event aren't thrown away by Tomcat from the beginning and what should be done exactly with them? 3. I'm never receiving any ERROR event except for TIMEOUTs. I would be of course very interested in CLIENT_DISCONNECT events but I couldn't find any case where Tomcat would send me this handful event... I was expecting this event to be raised when the client app is closed or the net connection broken but Tomcat just stops sending me TIMEOUT events. It may be useful to say that I'm using APR and not NIO... 3. Would it be possible to use the Tomcat pool thread for sending the responses instead of creating and managing my own thread pool (I'm using standard Runnable objects submitted to my own pool but I could submit them to any other thread pool as well)? 4. Under stress tests (12 clients sending 10 messages/sec. while listening for the same topic, ie: they may get 12*10 messages/sec., but some of them (~5-10) are generally packaged in the same response), asynchronous read doesn't work anymore: a full read of the input stream must be done on the BEGIN event, otherwise, it seems that most incomming requests are lost... I didn't try to figure out what's going on but, as a matter of fact, asynchronous read seems to be broken on heavy load (just informative, I can use full read on the begin event). Regards, thanks in advance for any reply, Franck. - 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: CometProcessor questions
hi Franck, are you using this Bayeux impl? http://svn.apache.org/viewvc/tomcat/trunk/modules/bayeux/ or do you have your own? Filip Franck Wolff wrote: Hi, I'm developing Tomcat/Comet support for Granite Data Service http://www.graniteds.org (Flex clients) and I've got few questions about CometEvents processing. Basically, my implementation is based on the Bayeux protocol (long-polling only) and two connections (command/tunnel) are opened for each clients (producer/consumer). I use a thread pool in order to dispatch received messages to each consumer subscribed to the relevant topic. Here are my questions: 1. What should happen exactly if Tomcat send a timeout event when the current event (ie: a previous BEGIN event whose request input stream was fully read when it was received) is used for writing a response? Is this previous BEGIN still valid and may be used to write the response? If not, should it be close right away and may I use the timeout event instead or should I wait for a next BEGIN event? Is it the same event instance whose type/subtype has changed? 2. Tomcat send me sometime (rather rare but it happens) invalid END events (getHttpServletRequest() issues a NullPointerException). I'm just trying by now to close them and it don't affect my application behavior but I'm wondering why those invalid event aren't thrown away by Tomcat from the beginning and what should be done exactly with them? 3. I'm never receiving any ERROR event except for TIMEOUTs. I would be of course very interested in CLIENT_DISCONNECT events but I couldn't find any case where Tomcat would send me this handful event... I was expecting this event to be raised when the client app is closed or the net connection broken but Tomcat just stops sending me TIMEOUT events. It may be useful to say that I'm using APR and not NIO... 3. Would it be possible to use the Tomcat pool thread for sending the responses instead of creating and managing my own thread pool (I'm using standard Runnable objects submitted to my own pool but I could submit them to any other thread pool as well)? 4. Under stress tests (12 clients sending 10 messages/sec. while listening for the same topic, ie: they may get 12*10 messages/sec., but some of them (~5-10) are generally packaged in the same response), asynchronous read doesn't work anymore: a full read of the input stream must be done on the BEGIN event, otherwise, it seems that most incomming requests are lost... I didn't try to figure out what's going on but, as a matter of fact, asynchronous read seems to be broken on heavy load (just informative, I can use full read on the begin event). Regards, thanks in advance for any reply, Franck. - 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 cluster with Session Persistence not working :(
inline: Manu_SF wrote: Hi, After some digging through and still not able to get it work, I thought of posting it here... Here's what I am trying to accomplish: * Have Apache as a Loadbalancer for 2 Tomcat 6 instances - All running on the same Linux box * Implement the session persistence using Tomcat6 so that live sessions could be handled by other Tomcat nodes, if one of them crashes in between. What I am able to accomplish till now: * Setup the load balanced servers so that *new* sessions are handled by whichever server is active/lightly loaded. Where I am stuck: * Not able to have session persistent cluster. * This scenario is not working: - Tomcat1 and Tomcat2 are up. - A new request comes in and Tomcat1 serves it. - Tomcat1 crashes and the session is lost (Instead I want it to be served by Tomcat2 as if nothing happened). I went through the steps mentioned here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html (which is exactly did you put distributable/ in your XML? what I am trying to achieve). But when I kill the active server, the session is lost.. what do your tomcat logs say? In index.jsp, I am extending the Session so that it can be serialized... And, I am creating an instance so that I can use a serializable session for session-persistence. why are you doing this, it wont change the behavior of your system. It's the session attributes that have to be serializable Filip class PersistentSession implements javax.servlet.http.HttpSession, java.io.Serializable { private javax.servlet.http.HttpSession httpSession; protected PersistentSession() { httpSession = null; } // All necessary methods overridden ... } // Check perSession served from both tomcat instances... PersistentSession perSession = new PersistentSession(request.getSession()); Here's the server.xml files from both the tomcat instances... Can anyone tell me what am I missing in order to run persistent sessions? server.xml from Tomcat1: ?xml version='1.0' encoding='utf-8'? Server port=11005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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=11009 protocol=AJP/1.3 redirectPort=8443 / Engine jvmRoute=tomcat1 name=Catalina defaultHost=localhost debug=0 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=4001 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ /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.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps
Re: Tomcat 6 cluster with Session Persistence not working :(
Manu_SF wrote: Thanks a ton, Filip. Here are the details about the 3 questions you asked. Please tell me what am I missing here? 1. distributable tag: There's no Context attribute in either web.xml or server.xml, but however context.xml in the same conf directory had Context tag, for which I added the distributable=true attribute. Context distributable=true that would be wrong, this means you would configure every single application for replication. 2. why are you doing this, it wont change the behavior of your system. It's the session attributes that have to be serializable I think I might be missing something terribly here... If session is not serializable, then how will it persist the session? Do you have an example which shows this? just google for articles on tomcat clustering/session replication, one gentlemen Srini wrote several of them 3. Tomcat logs while starting up - Here's the tomcat logs from starting each server: INFO: Manager [localhost#/manager]: skipping state transfer. No members active in cluster group. this means that the two tomcat instances didn't discover each other. so what you would need to do, is to ensure that multicasting is working, and that the members discover each other Filip Tomcat server 1 log == /usr/local/tomcat1/logs/catalina.2008-11-17.log == Nov 17, 2008 9:48:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property. Nov 17, 2008 9:48:05 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jre/lib/i386/server:/usr/java/jre/lib/i386:/usr/java/jre/../lib/i386 Nov 17, 2008 9:48:05 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 394 ms Nov 17, 2008 9:48:05 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 17, 2008 9:48:05 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Nov 17, 2008 9:48:05 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/127.0.0.1:4001 Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 == /usr/local/tomcat1/logs/catalina.out == Nov 17, 2008 9:48:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property. Nov 17, 2008 9:48:05 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jre/lib/i386/server:/usr/java/jre/lib/i386:/usr/java/jre/../lib/i386 Nov 17, 2008 9:48:05 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 394 ms Nov 17, 2008 9:48:05 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 17, 2008 9:48:05 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Nov 17, 2008 9:48:05 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/127.0.0.1:4001 Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Nov 17, 2008 9:48:05 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 == /usr/local/tomcat1/logs/catalina.2008-11-17.log == Nov 17, 2008 9:48:06 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Nov 17, 2008 9:48:06 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 == /usr/local/tomcat1/logs/catalina.out == Nov 17, 2008 9:48:06 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Nov 17, 2008 9:48:06 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 == /usr/local/tomcat1/logs/catalina.2008-11-17.log == Nov 17, 2008 9:48:07 PM
Re: Problem with Beta candidate for Tomcat connection pool
Thanks Mark for the report, no not at all. I will push out a fix today. Filip Mark Shifman wrote: I installed the new Tomcat connection pool and it worked ok yesterday. First thing this morning it threw this exception below. (I snipped out a bunch of stuff but can send the whole thing if it would help) My resource definition from context.xml is Resource name=jdbc/prot auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDriver factory=org.apache.tomcat.jdbc.pool.DataSourceFactory url=jdbc:oracle:thin:@xxx.xxx.med.yale.edu:1521:xxx username=xxx password=xxx initialSize=3 maxActive=10 maxIdle=10 maxWait=1 removeAbandoned=false removeAbandonedTimeout=180 logAbandoned=false timeBetweenEvictionRunsMillis=1 validationQuery=SELECT 1 from dual testOnBorrow=true/ Have I done something stupid that lets stale connections hang around? I old dbcp pool worked fine. Thanks in advance. Mark Shifman java.lang.reflect.UndeclaredThrowableException at $Proxy0.getConnection(Unknown Source) at org.apache.commons.dbutils.QueryRunner.prepareConnection(QueryRunner.java:189) ... Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor206.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... Caused by: java.sql.SQLException: java.lang.NegativeArraySizeException at oracle.net.ano.CryptoDataPacket.decryptAndChecksum(CryptoDataPacket) at oracle.net.ano.CryptoDataPacket.receive(CryptoDataPacket) at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:931) at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893) at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:101) at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.java:684) at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:700) at oracle.jdbc.driver.OraclePreparedStatement.privateClose(OraclePreparedStatement.java:489) at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:396) at oracle.jdbc.driver.OracleCallableStatement.close(OracleCallableStatement.java:982) at oracle.jdbc.driver.OracleConnection.close_statements(OracleConnection.java:2369) at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1448) at org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:103) at org.apache.tomcat.jdbc.pool.PooledConnection.reconnect(PooledConnection.java:93) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:473) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:380) - 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 Beta candidate for Tomcat connection pool
Mark, this was fixed in 1.0.3-beta, thanks for helping us out! http://tomcat.apache.org/dev/dist/jdbc-pool/1.0-beta/ Filip Mark Shifman wrote: I installed the new Tomcat connection pool and it worked ok yesterday. First thing this morning it threw this exception below. (I snipped out a bunch of stuff but can send the whole thing if it would help) My resource definition from context.xml is Resource name=jdbc/prot auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDriver factory=org.apache.tomcat.jdbc.pool.DataSourceFactory url=jdbc:oracle:thin:@xxx.xxx.med.yale.edu:1521:xxx username=xxx password=xxx initialSize=3 maxActive=10 maxIdle=10 maxWait=1 removeAbandoned=false removeAbandonedTimeout=180 logAbandoned=false timeBetweenEvictionRunsMillis=1 validationQuery=SELECT 1 from dual testOnBorrow=true/ Have I done something stupid that lets stale connections hang around? I old dbcp pool worked fine. Thanks in advance. Mark Shifman java.lang.reflect.UndeclaredThrowableException at $Proxy0.getConnection(Unknown Source) at org.apache.commons.dbutils.QueryRunner.prepareConnection(QueryRunner.java:189) ... Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor206.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... Caused by: java.sql.SQLException: java.lang.NegativeArraySizeException at oracle.net.ano.CryptoDataPacket.decryptAndChecksum(CryptoDataPacket) at oracle.net.ano.CryptoDataPacket.receive(CryptoDataPacket) at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.net.ns.NetInputStream.read(Unknown Source) at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:931) at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893) at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:101) at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.java:684) at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:700) at oracle.jdbc.driver.OraclePreparedStatement.privateClose(OraclePreparedStatement.java:489) at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:396) at oracle.jdbc.driver.OracleCallableStatement.close(OracleCallableStatement.java:982) at oracle.jdbc.driver.OracleConnection.close_statements(OracleConnection.java:2369) at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1448) at org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:103) at org.apache.tomcat.jdbc.pool.PooledConnection.reconnect(PooledConnection.java:93) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:473) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:380) - 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: [ANNOUNCE] Beta candidate for Tomcat connection pool
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, Filip Hanik - Dev Lists wrote: The Apache Tomcat team announces the immediate availability of Apache Tomcat JDBC Connection Pool The download page for this component says Tomcat 6. Is this component compatible with Tomcat 5.5 as well? If so, I'd be happy to help test it on my dev boxes. yes, should be compatible, compiled with JDK 1.5 - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkdqmYACgkQ9CaO5/Lv0PAGhQCeOP7bi++6f/oTwribzm1TqcMX T3kAniDy/EhTIiC/qOevXg1VOovCtTEh =6xjQ -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: Tomcat 6 clustering problem...rltd to context path
you need to deploy the app on node 2 as well, it says the app is not installed there Filip rohit aman wrote: *I have two tomcats (tomcat 6)** setup on two separate machines. I have a hardware load balancer with scheduling method configured to round robin.* ** *each tomcat recognizes the other one by saying replication member added * ** *I also made the examples web application (that comes with tomcat) a cluster aware application. For this examples application, session replication and everything works fine. This is how the log shows for this application.* 2008-11-14 16:15:41.582 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Register manager /examples to cluster element Engine with name Catalina 2008-11-14 16:15:41.582 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Register manager /examples to cluster element Engine with name Catalina 2008-11-14 16:15:41.582 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Starting clustering manager at /examples 2008-11-14 16:15:41.582 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Starting clustering manager at /examples 2008-11-14 16:15:41.582 [main] [WARN] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/examples], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-64, -88, -46, 11}:4000,{-64, -88, -46, 11},4000, alive=159203,id={-68 -112 77 -71 -86 -30 77 94 -65 -9 108 56 48 -127 -101 -125 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 2008-11-14 16:15:41.582 [main] [WARN] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/examples], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-64, -88, -46, 11}:4000,{-64, -88, -46, 11},4000, alive=159203,id={-68 -112 77 -71 -86 -30 77 94 -65 -9 108 56 48 -127 -101 -125 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 2008-11-14 16:15:41.691 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/examples]; session state send at 11/14/08 4:15 PM received in 109 ms. 2008-11-14 16:15:41.691 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/examples]; session state send at 11/14/08 4:15 PM received in 109 ms. 2008-11-14 16:15:41.691 [main] [INFO] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/examples] - ContextListener: contextInitialized() 2008-11-14 16:15:41.691 [main] [INFO] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/examples] - SessionListener: contextInitialized() *Now, I wanted to try my own application. For my own application... I want it to be a default application for the server, so I put it in webappps/ea directory and configured the context path as below in server.xml* Context path= docBase=ea className=org.apache.catalina.core.StandardContext cachingAllowed=true ... *Session replication is not working for this application and the log says* 2008-11-14 16:15:43.581 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Register manager /ea to cluster element Engine with name Catalina 2008-11-14 16:15:43.581 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Register manager /ea to cluster element Engine with name Catalina 2008-11-14 16:15:43.581 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Starting clustering manager at /ea 2008-11-14 16:15:43.581 [main] [INFO] org.apache.catalina.ha.session.DeltaManager - Starting clustering manager at /ea 2008-11-14 16:15:43.581 [main] [WARN] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/wa], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-64, -88, -46, 11}:4000,{-64, -88, -46, 11},4000, alive=161203,id={-68 -112 77 -71 -86 -30 77 94 -65 -9 108 56 48 -127 -101 -125 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 2008-11-14 16:15:43.581 [main] [WARN] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/ea], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-64, -88, -46, 11}:4000,{-64, -88, -46, 11},4000, alive=161203,id={-68 -112 77 -71 -86 -30 77 94 -65 -9 108 56 48 -127 -101 -125 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 2008-11-14 16:16:43.622 [main] [ERROR] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/ea]: No session state send at 11/14/08 4:15 PM received, timing out after 60,041 ms. 2008-11-14 16:16:43.622 [main] [ERROR] org.apache.catalina.ha.session.DeltaManager - Manager [localhost#/ea]: No session state send at 11/14/08 4:15 PM received, timing out after 60,041 ms. *in the other cluster member it says*
Re: Tomcat 5.5.23 Cluster Problem - (memberDisappeared)
tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 waitForAck=true Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender timeout=6 keepAliveTime=12/ /Sender 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 /Host /Engine /Service /Server Node2: Server port=8005 shutdown=SHUTDOWN 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.StoreConfigLifecycleListener/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ 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=node2 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=node2 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false 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=50 mcastDropTime=3/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=172.16.12.21 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000 waitForAck=true Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender timeout=6 keepAliveTime=12/ /Sender 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 /Host /Engine /Service /Server 2008/11/13 Filip Hanik - Dev Lists [EMAIL PROTECTED] increase mcastDropTime=3000 to mcastDropTime=3 Gustavo Araujo wrote: Hello! I'm trying to finish my configuration of the cluster. But i get the message of 'memberDisappeared' in both nodes: Node1: users@tomcat.apache.org12-Nov-08 5:30:36 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp:// 172.16.12.21:4001 ,catalina,172.16.12.21,4001, alive=218675] 12-Nov-08 5:30:39 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberDisappeared INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp:// 172.16.12.21:4001,catalina,172.16.12.21,4001, alive=218675] 12-Nov-08 5:40:36 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp
Re: Encrypting database resouce password
if you digest the password to the database, how is tomcat supposed to pass it to the database? Filip Kevin Nash wrote: Hello, I'm using apache-tomcat-5.5.26, Oracle 10.2.0.3, java version 1.5.0_14 I have a data resource defined in the server.xml and I wish to create a digest of the database password. Resource name=jdbc/oracle auth=Container type=javax.sql.DataSource username=username password=plaintxt driverClassName=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@hostname:1522:databasename maxActive=20 maxIdle=10 /Resource I was wondering is it possible to do this in a similar fashion to creating a digest of the passwords in the tomcat-users.xml file 1. Create password digest using SHA $ ./digest.sh -a SHA password password:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 2. Update the password in tomcat-users.xml user username=tomcat password=5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 roles=tomcat,manager/ 3. Update the server.xml Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase digest=SHA / I've searched for a solution for encrypting the data resource password and I've come across the following solutions. 1. Manage the connection pool in the application not the application server. 2. Authenticate using the application, i.e. set auth=Application 3. Or extends BasicDataSourceFactory to accept an encrypted password. These solutions are described in this interesting article http://java.sys-con.com/node/393364/print I was wondering is there a fourth solution as simple as creating digests of passwords for users in the tomcat-users.xml file? Thanks for your help, Kevin Nash - 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.18 - cluster problems!
this is your problem SEVERE: Parse Fatal Error at line 19 column 2: The markup in the document following the root element must be well-formed. org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Filip Gustavo Araujo wrote: Dear of the list, Having problems with tomcat 5.5.X, i decided to migrate to 6.0.18. I still have problems with the cluster connection, and now i got some problems in JAVA as well. Follow down the conf and log files, Any advices would be helpful! Thanks Node1: Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=node1 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=node1 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false 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=127.0.0.1 port=4001 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ /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.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster /Host /Engine /Service /Server Node2: Server port=9005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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=9080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=9009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=node2 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=node2 appBase=webapps
Re: Tomcat 6.0.18 - cluster problems!
INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000,{127, 0, 0, 1},4000, alive=254031,id={-124 91 90 61 94 4 69 -97 -94 -123 63 -126 25 91 -101 -4 }, payload={}, command={}, domain={}, ] Nov 13, 2008 8:01:42 PM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Nov 13, 2008 8:02:12 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000,{127, 0, 0, 1},4000, alive=254031,id={-124 91 90 61 94 4 69 -97 -94 -123 63 -126 25 91 -101 -4 }, payload={}, command={}, domain={}, ]] message. Will verify. Nov 13, 2008 8:02:12 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000,{127, 0, 0, 1},4000, alive=254031,id={-124 91 90 61 94 4 69 -97 -94 -123 63 -126 25 91 -101 -4 }, payload={}, command={}, domain={}, ]] Node1 log: Nov 13, 2008 7:57:22 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 13, 2008 7:57:22 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 419 ms Nov 13, 2008 7:57:22 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 13, 2008 7:57:22 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Nov 13, 2008 7:57:22 PM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Nov 13, 2008 7:57:22 PM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/127.0.0.1:4000 Nov 13, 2008 7:57:22 PM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Nov 13, 2008 7:57:22 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Nov 13, 2008 7:57:23 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Nov 13, 2008 7:57:23 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Nov 13, 2008 7:57:24 PM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Nov 13, 2008 7:57:24 PM org.apache.catalina.ha.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Nov 13, 2008 7:57:24 PM org.apache.catalina.ha.session.JvmRouteBinderValve start INFO: JvmRouteBinderValve started Nov 13, 2008 7:57:25 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Nov 13, 2008 7:57:25 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Nov 13, 2008 7:57:25 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 13, 2008 7:57:25 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Nov 13, 2008 7:57:25 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/15 config=null Nov 13, 2008 7:57:25 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 2588 ms Thanks again! 2008/11/13 Filip Hanik - Dev Lists [EMAIL PROTECTED] this is your problem SEVERE: Parse Fatal Error at line 19 column 2: The markup in the document following the root element must be well-formed. org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Filip Gustavo Araujo wrote: Dear of the list, Having problems with tomcat 5.5.X, i decided to migrate to 6.0.18. I still have problems with the cluster connection, and now i got some problems in JAVA as well. Follow down the conf and log files, Any advices would be helpful! Thanks Node1: Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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
Re: Tomcat 6.0.18 - cluster problems!
I also see you have the Cluster element under Host, put it under Engine instead Filip Filip Hanik - Dev Lists wrote: node one log says INFO: Receiver Server Socket bound to:/127.0.0.1:4000 Nov 13, 2008 7:56:42 PM node two log says INFO: Receiver Server Socket bound to:/127.0.0.1:4000 Nov 13, 2008 7:57:22 PM so this is not in theory possible, since you can't have two processes on the same port. 1. so the question is, are these tomcat instance on the same machines or not? 2. Nov 13, 2008 8:02:12 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000,{127, 0, 0, 1},4000, alive=254031,id={-124 91 90 61 94 4 69 -97 -94 this is tomcat getting a message that a node might be lost, but verified that it still exist using TCP. so all is well here Filip -123 63 -126 25 91 -101 -4 }, payload={}, command={}, domain={}, ]] Gustavo Araujo wrote: Thanks Filip and Charles, I corrected the points that you guys advised me, but the cluster instances still dying! =( Follow down again the logs and the conf files, any other information i cat get. If anyone have similar problems, please get in touch, iḿ working on that for a week, without sucess =( Node1 conf: Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / 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 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=node1 Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=node1 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false 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=3/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=127.0.0.1 port=4000 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ /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.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster /Host /Engine /Service /Server Node2 conf: Server port=9005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase
Re: Session replication for JPetStore application in tomcat 6
looks like its working, what is it that you don't think is working or would like help with? 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions ATTENTION: Manager [localhost#/jpetstore], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 -91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 17:08 received in 112 ms. Filip Anupam Beri wrote: Hello All , I am a newbie to the Tomcat and Tomcat clustering environment .I was just going through some posts on this forum for reference . I wish to deploy the classic JPetStore application which comes with the Spring framework in the clustered environment involving 2 machines for session replication For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of these machines . I configured mod_jk load balancer for sticky session and deployed JPetStore on either of them . But once I start tomcat and apache on either machine and try to do some transactions , I cannot see any sessions being exchanged between the two members of the cluster. The JPetStore application also uses a database (hsqldb) and its necessary to start one on either machine (it is not a shared one). I was reading some documentation regarding if the session attributes are to be implemented from serializable interface...but I see they already have been in the source code . I will be greateful if anyone could help me out and give a good insight on where I am going wrong ? I have attached the server.xml , workers.properties and catalina.out for the two nodes in the attached file. Any help is deeply appreciated ! Best Regards !! Anupam http://www.nabble.com/file/p20456399/clustering_files.rar clustering_files.rar - 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 for JPetStore application in tomcat 6
you could enable tracing for the two following categories org.apache.catalina.ha org.apache.catalina.tribes.MESSAGES Filip Anupam Beri wrote: Hello Filip, Thanks a lot for your reply. From the logs , the session state send is evident .The scenario i tried is as follows I opened the application web page on the first node via my browser , logged in , did some operations like some additions and modifications. I displayed the items in the cart . Then I opened the same application web page on the second node via browser and tried to display the items in the cart and it said that the Cart is empty . I had a few questions ... 1) how can I know if session replication is happening i.e any special debugging can be enabled in log4j ? (from above scenario , the items in the cart should be the same ? can this be the criteria ?) 2) Is it necessary to make the petstore database on each of nodes clustered for session replication to happen ? I wish to do some load testing too with jmeter to see how the load is distributed between workers. Any help will be greatefully appreciated ! Best Regards, Anupam Filip Hanik - Dev Lists wrote: looks like its working, what is it that you don't think is working or would like help with? 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions ATTENTION: Manager [localhost#/jpetstore], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{-84, 17, 4, 14}:4000,{-84, 17, 4, 14},4000, alive=276200,id={44 8 -106 78 -12 88 70 -91 -126 47 21 -83 -67 102 67 -94 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 6 nov. 2008 17:08:30 org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [localhost#/jpetstore]; session state send at 06/11/08 17:08 received in 112 ms. Filip Anupam Beri wrote: Hello All , I am a newbie to the Tomcat and Tomcat clustering environment .I was just going through some posts on this forum for reference . I wish to deploy the classic JPetStore application which comes with the Spring framework in the clustered environment involving 2 machines for session replication For this, I installed Apache 2.2 , Tomcat 6.0.18 and mod_jk on each of these machines . I configured mod_jk load balancer for sticky session and deployed JPetStore on either of them . But once I start tomcat and apache on either machine and try to do some transactions , I cannot see any sessions being exchanged between the two members of the cluster. The JPetStore application also uses a database (hsqldb) and its necessary to start one on either machine (it is not a shared one). I was reading some documentation regarding if the session attributes are to be implemented from serializable interface...but I see they already have been in the source code . I will be greateful if anyone could help me out and give a good insight on where I am going wrong ? I have attached the server.xml , workers.properties and catalina.out for the two nodes in the attached file. Any help is deeply appreciated ! Best Regards !! Anupam http://www.nabble.com/file/p20456399/clustering_files.rar clustering_files.rar - 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]
[ANNOUNCE] Beta candidate for Tomcat connection pool
The Apache Tomcat team announces the immediate availability of Apache Tomcat JDBC Connection Pool Apache Tomcat Connectors version 1.0.1-beta is a new module within the Tomcat development realm, aimed to provide a high performance, concurrent and extensible connection pool to the Tomcat community. The pool, can of course also be used independently. Assorted set of binaries are available for testing at: http://tomcat.apache.org/dev/dist/jdbc-pool/v1.0.1-beta/ If you find any bugs while using this test release, please fill in the Bugzilla Bug Report or send an e-mail to Tomcat Developers List. When entering bug use the following link: https://issues.apache.org/bugzilla/query.cgi?product=Tomcat%206 The contribution was started with https://issues.apache.org/bugzilla/show_bug.cgi?id=46038 Thank you, -- The Apache Tomcat Team - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]