Re: [Tomcat JDBC Pool] Close pooled connections via JMX
On 3/3/2012 10:50 AM, Brooke Hedrick wrote: On Mar 3, 2012 11:48 AM, Brooke Hedrickbrooke.t.hedr...@gmail.com wrote: On Mar 3, 2012 11:35 AM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Brooke Hedrick [mailto:brooke.t.hedr...@gmail.com] Subject: Re: [Tomcat JDBC Pool] Close pooled connections via JMX Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM DUAL configured? This should suffice to ensure each connection is valid before use. That approach doesn't work when the application uses symlinks to get to data on other Oracle servers. That makes no sense to me; please explain how links in the file system affect DB connections over the network. Chuck, I used the wrong word. I should have said 'database links'. You will see things like: select * emp@otherdb. Where @otherdb is typically an entry that you would find in a tnsnames.ora. Before you correct me, yes, I left out the FROM between the * and emp. still doesn't make sense. if you need another DB validated, use another validation query. sounds like one is creating a problem here rather than detecting one - 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: What is the best way to view Tomcat JDBC pool properties in Tomcat 6?
cast it to java.sql.Connection On 3/8/2012 4:29 AM, hodgesz wrote: Yes you are correct we are creating the pool in Spring configuration as it is more natural for our application, but the only problem we see now is once we upgraded to 7.0.26 we see the following exception in the logs when viewing through JMXProxy. The data is retrieved correctly so the exception is a little baffling. http://localhost:8080/manager/jmxproxy/?qry=bean:name=eventingDataSource OK - Number of results: 1 Name: bean:name=eventingDataSource modelerType: org.apache.tomcat.jdbc.pool.DataSource MaxIdle: 100 JdbcInterceptors: org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer DefaultTransactionIsolation: -1 ValidationQuery: SELECT 1 FROM dual TestOnConnect: false Password: Password not available as DataSource/JMX operation. AbandonWhenPercentageFull: 0 TestOnReturn: false Username: NumActive: 0 MinIdle: 10 PoolSize: 4 ValidationInterval: 180 Connection: ProxyConnection[PooledConnection[oracle.jdbc.driver.T4CConnection@17f8b39]] NumIdle: 2 AccessToUnderlyingConnectionAllowed: true Url: jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1580))(CONNECT_DATA =(SERVER = DEDICATED)( SERVICE_NAME = anywhere.com )(INSTANCE_NAME = xxx)(SID = xxx))) Size: 4 Active: 2 AlternateUsernameAllowed: false TestOnBorrow: true LoginTimeout: 6 MaxActive: 100 MaxAge: 0 SuspectTimeout: 0 Pool: org.apache.tomcat.jdbc.pool.ConnectionPool@9283bf NumTestsPerEvictionRun: 0 Name: Tomcat Connection Pool[1-6300663] MaxWait: 6000 PoolProperties: ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=oracle.jdbc.driver.OracleDriver; maxActive=100; maxIdle=100; minIdle=10; initialSize=10; maxWait=6000; testOnBorrow=true; testOnReturn=false; timeBetweenEvictionRunsMillis=3; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=3; testWhileIdle=false; testOnConnect=false; password=x; url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1580))(CONNECT_DATA =(SERVER = DEDICATED)( SERVICE_NAME = anywhere.com )(INSTANCE_NAME = xxx)(SID = xxx))); username=xxx; validationQuery=SELECT 1 FROM dual; validationInterval=180; accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; removeAbandonedTimeout=60; logAbandoned=true; connectionProperties=null; initSQL=null; jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer; jmxEnabled=true; fairQueue=false; useEquals=false; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; alternateUsernameAllowed=false; PoolName: Tomcat Connection Pool[1-6300663] WaitCount: 0 JmxEnabled: true TestWhileIdle: false UseEquals: false UseLock: false DriverClassName: oracle.jdbc.driver.OracleDriver RemoveAbandonedTimeout: 60 DbProperties: {user=, password=} Idle: 2 LogAbandoned: true FairQueue: false PoolSweeperEnabled: true ConnectionAsync: org.apache.tomcat.jdbc.pool.ConnectionPool$ConnectionFuture@e9c2d3 JdbcInterceptorsAsArray: Array[org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition] of length 2 org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition@125f027 org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorDefinition@1b99628 RemoveAbandoned: true TimeBetweenEvictionRunsMillis: 3 MinEvictableIdleTimeMillis: 3 InitialSize: 10 Mar 6, 2012 9:18:20 AM org.apache.catalina.mbeans.MBeanDumper dumpBeans SEVERE: Error getting attribute bean:name=eventingDataSource PooledConnection javax.management.MBeanException: RuntimeException thrown in RequiredModelMBean while trying to invoke operation getPooledConnection at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1091) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955) at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90) at javax.management.modelmbean.RequiredModelMBean.getAttribute(RequiredModelMBean.java:1358) at org.springframework.jmx.export.SpringModelMBean.getAttribute(SpringModelMBean.java:109) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:666) at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:638) at org.apache.catalina.mbeans.MBeanDumper.dumpBeans(MBeanDumper.java:82) at org.apache.catalina.manager.JMXProxyServlet.listBeans(JMXProxyServlet.java:172) at org.apache.catalina.manager.JMXProxyServlet.doGet(JMXProxyServlet.java:121) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at
Re: Using Tomcat7 JDBC Connection Pool
Here is an example String query = BEGIN DBMS_LOCK.sleep(seconds = 5.01); END; It is pretty obvious that you can't do SELECT 1; SELECT 1; is this would result in TWO result sets. But you can create a block and execute any number of instructions The above example executes a stored procedure. Filip On 2/9/2012 9:48 AM, Pid wrote: On 09/02/2012 16:21, Amit wrote: Any thoughts on the first point about executing multiple SQL queries on physical connection creation? I have no idea if it'll work, but I'd try: SELECT 1; SELECT 1; If you are controlling the pool (and you are) by passing in username/password parameters each time, then you could do it as an extra transaction thereafter. p On 09-Feb-2012, at 7:05 PM, Pidp...@pidster.com wrote: On 09/02/2012 12:56, amit shah wrote: One more comment below about oracle UCP. snip The pool returns members at random, so how would you know which cached credentials you were getting? The credentials which are passed to the getConnection(String username, String password) method. When we configure the same pool to be used for multiple schema's the pool will *not *be configured with default username password. OK, so you create a bunch of connections with various credentials, you want to cache those connections and only return them if the creds match for the new request? So you're basically creating an uncontrolled pool per cred pair, inside the outer pool which is controlled? Yes right. So why not create multiple controlled pools not run into availability problems? snip What overhead? The application server and database server resources (memory, cpu etc) for keeping the connections open? That's a total connection count dependent metric. So the overhead is virtually the same regardless of whether you have 5 pools or 1, if you have the same total number of connections. For e.g. If we have 5 tenants with 5 pools configured with 10 min pool size, we would have min 50 connections always open to the database server. This count would be for each application server. If we had the same pool for all 5 tenants, there would be just 10 connections open per application server. There's a flaw in your logic. In your example there may be zero connections open for a given tenant because they use a shared pool. So you might has well have separate pools with the minimum set to 2 and still have more connections guaranteed per tenant, and the 10 you were aiming for. Worse, if you hit your max with other tenants, a remaining tenant might not be able to get a connection at all, thus failing to address one of the key requirements in a multi-tenant system - guaranteed availability. Probably true when all the tenants are actively used. As I said, there is always a flexibility in the configuration to use a separate pool for a particular tenant. That should be the default IMO. You're asking for trouble otherwise. Also the application can always provide a configuration flexibility to allow a tenant to use a separate pool instead of sharing it with other tenants (like I said above). This flexibility is provided by the Oracle Universal Connection Poolhttp://docs.oracle.com/cd/E11882_01/java.112/e12265/toc.htm So if that's a better fit for your requirement, why not use it? It provides the feature I mentioned about by has lock contention issues. Tomcat 7 jdbc pool seems to be better and hence I was trying it out. ! snip If you are programmatically registering the pool, can you not just register it with the MBean server yourself? Ok I will try this and provide an update. Cool. p -- [key:62590808] - 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: Apache tribes deserialization issues
your workaround is valid I would not expect thread context class loader to work, as the thread for deserializing is the thread from the tribes TCP thread pool On 12/29/2011 5:06 AM, Madhav Bhargava wrote: Hi All, We are using Apache tribes library for presence and inter node communication within an OSGi runtime environment. We have a central node (say node A) receiving messages from other nodes ( say node B, C). The message passed is a custom class which is present as part of the API defined in a separate OSGi bundle. This custom class is Serializable. When a send method is invoked on the GroupChannel to send the custom class message to node A then it throws an exception with the following stack trace: java.lang.ClassNotFoundException: com.sap.nm.NodeSnapshot at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at java.io.ObjectInputStream.resolveClass(Unknown Source) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.apache.catalina.tribes.io.XByteBuffer.deserialize(XByteBuffer.java:568) at org.apache.catalina.tribes.io.XByteBuffer.deserialize(XByteBuffer.java:554) at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:261) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:84) at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:84) at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:253) at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:287) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:212) at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) The problem is that OSGi has a totally different class loading mechanism that what is followed in java/j2ee applications. We looked at the tribes source code and found out that following piece of code is the culprit: Class: XByteBuffer.java public static Serializable deserialize(byte[] data, int offset, int length) throws IOException, ClassNotFoundException, ClassCastException { return deserialize(data,offset,length,null); } Instead of passing null to the ClassLoader[] (last argument), Thread context classloader should have been passed. What is happening is that the tribes is trying to load the class with the tribes class loader and not using the current thread classloader and is therefore not able to find the custom class. A workaround that we have adopted now is to use byte[] and set Channel.SEND_OPTIONS_BYTE_MESSAGE option while sending the message. We then explicitly recreate the object in the ChannelListener in bundle A from the bytes message. This is possible because in GroupChannel byte messages are not deserialized using XByteBuffer. It will great if anyone can investigate this issue. Best Regards, Madhav - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session replication fails with Member send is failing
On 12/7/2011 9:04 AM, Jürgen Link wrote: Caused by: org.apache.catalina.tribes.RemoteProcessException: Received a failedack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA sure thing, this is actually telling the sender that an exception happened on the receiver end. Take a look at the logs for tcp://{10, 1, 3, 181}:5000 and it should contain the information in there Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Antw.: how to properly configure tomcat 7 cluster with BackupManager
http://www.datadisk.co.uk/html_docs/java_app/tomcat6/tomcat6_clustering.htm http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html http://tomcat.apache.org/tomcat-6.0-doc/tribes/introduction.html On 10/27/2011 9:29 AM, juergen.l...@gmail.com wrote: Hi Mark, thanks a lot for this clarification! Is there any reference you recommend for learning about tomcat clustering (apart from the source code)? Cheers Jürgen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Securing Tomcat cluster communication
On 10/6/2011 8:31 AM, Afkham Azeez wrote: I had a look at the Tribes code. Can somebody please explain how Channel.SEND_OPTIONS_SECURE works? not yet implemented :( From the JavaDoc: SEND_OPTIONS_SECURE - Message is sent over an encrypted channel How is this encrypted channel setup? How do we define the keys/keystores etc? On Thu, Oct 6, 2011 at 7:47 PM, Afkham Azeezafk...@gmail.com wrote: Hi folks, Is there a way to do authentication in Tribes when new members try to join a cluster so that unauthorized nodes cannot join in? Also, when clustering messages are sent back forth, how do we ensure security? Thanks Azeez - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Securing Tomcat cluster communication
Yes, that way you could encrypt your data packets and not worry about the wire protocol. the placement of the interceptor will be important, so that you don't encrypt packets you don't need to (like ping and failure detection) Filip On 11/23/2011 10:53 AM, Afkham Azeez wrote: On Wed, Nov 23, 2011 at 8:48 PM, Filip Hanik - Dev Listsdevli...@hanik.com wrote: On 10/6/2011 8:31 AM, Afkham Azeez wrote: I had a look at the Tribes code. Can somebody please explain how Channel.SEND_OPTIONS_SECURE works? not yet implemented :( What is the proper way of implementing this if I was to do it? Implement an interceptor which will handle encryption/decryption? This is for Axis2 clustering which uses Tribes, so we could use the Tribes API. From the JavaDoc: SEND_OPTIONS_SECURE - Message is sent over an encrypted channel How is this encrypted channel setup? How do we define the keys/keystores etc? On Thu, Oct 6, 2011 at 7:47 PM, Afkham Azeezafk...@gmail.com wrote: Hi folks, Is there a way to do authentication in Tribes when new members try to join a cluster so that unauthorized nodes cannot join in? Also, when clustering messages are sent back forth, how do we ensure security? Thanks Azeez --**--**- To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.orgusers-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cluster - No faulty members identified
remove bind=172.30.5.77 Filip On 11/4/2011 6:41 AM, Alexander Diedler wrote: Hello @ll, I have two Tomcat instances (6.0.32 x64 on Windows) on the same server. Both servers make their own clustering with the other physical node independent from each other on the same machine. I get during start of the 2^nd Tomcat on the same node the following error: INFO: Receiver Server Socket bound to:/172.30.5.77:4001 04.11.2011 13:32:37 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Attempting to bind the multicast socket to /228.0.0.4:45574 04.11.2011 13:32:37 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Binding to multicast address, failed. Binding to port only. 04.11.2011 13:32:37 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting multihome multicast interface to:/178.30.5.77 04.11.2011 13:32:37 org.apache.catalina.ha.tcp.SimpleTcpCluster start SCHWERWIEGEND: Unable to start cluster. org.apache.catalina.tribes.ChannelException: java.net.SocketException: The requested address is not valid in its context; No faulty members identified. What could it be?? Here server.xml from the first tomcat: […] Engine name=Catalina defaultHost=extranet jvmRoute=worker2 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 bind=172.30.5.77 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=4000 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.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/ ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster […] And here the second tomcat: […] Engine name=Catalina defaultHost=localhost jvmRoute=worker7 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 bind=178.30.5.77 port=45574 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=4000 autoBind=100 selectorTimeout=5000 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.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/ ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster […] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with threads in stage Service (Tomcat 7.0.14)
most likely you have GC running all the time http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 runnable [0x436ab000] java.lang.Thread.State: RUNNABLE at java.util.HashMap.get(HashMap.java:303) at sae.HTMLEncoder.encode(HTMLEncoder.java:46) this should not be a stage where you're stuck, unless you have a loop problem. On 7/28/2011 9:09 AM, Alejandro Henao González wrote: Good day. I have the following problem with my tomcat. Sometimes, some threads are keep in service stage for a long time (really never exit from this stage), this causes that tomcat uses a hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes very slow. I have a Tomcat 7.0.14 in a Redhat RHLE 5.5. The partial solution is restart the service, but this is not a practical solution(because is a 24/7 server). is posible config a timeout for threads in service stage, or any solution?? Thanks. Sorry for the redaction. Attached an image with the tomcat manager status and the CPU consuming. Cordial saludo. Tengo el siguiente problema con mi tomcat. En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por demasiado tiempo (de hecho nunca salen de esta etapa), esto causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos incluso hasta los 8 a veces), y en consecuencia mi aplicación web trabaja demasiado lento. Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5 La solución temporal que tengo es reiniciar el servicio, sin embargo esta no es una solución práctica (pues debe ser un servidor 24/7). Es posible configurar algún timeout para hilos en la etapa de servicio, o alguna solución alternativa para este problema? Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat Manager, y el uso de la CPU - 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: Problem with threads in stage Service (Tomcat 7.0.14)
that's an academic exercise for you, in the meantime, add in this option to your startup options -XX:-DisableExplicitGC Filip On 7/28/2011 1:07 PM, Alejandro Henao González wrote: I dont believe that have GC running all the time, but the GC is called in the above line to HTMLEncoder.encode. as follows. System.gc(); resultado = htmlEncoder.encode(resultado); response.reset(); may be this the problem? why? Thanks. - Mensaje original - De: Filip Hanik - Dev Listsdevli...@hanik.com Para: Tomcat Users Listusers@tomcat.apache.org Enviados: Jueves, 28 de Julio 2011 12:35:56 Asunto: Re: Problem with threads in stage Service (Tomcat 7.0.14) most likely you have GC running all the time http-bio-80-exec-107 daemon prio=10 tid=0x2aaab31ea000 nid=0x47b2 runnable [0x436ab000] java.lang.Thread.State: RUNNABLE at java.util.HashMap.get(HashMap.java:303) at sae.HTMLEncoder.encode(HTMLEncoder.java:46) this should not be a stage where you're stuck, unless you have a loop problem. On 7/28/2011 9:09 AM, Alejandro Henao González wrote: Good day. I have the following problem with my tomcat. Sometimes, some threads are keep in service stage for a long time (really never exit from this stage), this causes that tomcat uses a hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp executes very slow. I have a Tomcat 7.0.14 in a Redhat RHLE 5.5. The partial solution is restart the service, but this is not a practical solution(because is a 24/7 server). is posible config a timeout for threads in service stage, or any solution?? Thanks. Sorry for the redaction. Attached an image with the tomcat manager status and the CPU consuming. Cordial saludo. Tengo el siguiente problema con mi tomcat. En algunas ocasiones, algunos hilos se quedan en la etapa de servicio por demasiado tiempo (de hecho nunca salen de esta etapa), esto causa que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos incluso hasta los 8 a veces), y en consecuencia mi aplicación web trabaja demasiado lento. Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5 La solución temporal que tengo es reiniciar el servicio, sin embargo esta no es una solución práctica (pues debe ser un servidor 24/7). Es posible configurar algún timeout para hilos en la etapa de servicio, o alguna solución alternativa para este problema? Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat Manager, y el uso de la CPU - 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: Comet over HTTPS: END event recieved immeidately for the first few times
why dont you 1. package up a sample application and configuration 2. open a bugzilla issue 3. https://issues.apache.org/bugzilla/enter_bug.cgi that way we can take a look ait it. Filip On 7/13/2011 2:54 PM, Sudeep Pradhan wrote: Hi Filip, Thanks for the reply. I don't think that I am using BIO connector for SSL. I don't see any such option in the server.xml. The connector is as follows: Connector protocol=org.apache.coyote.http11.Http11NioProtocol port=8443 minSpareThreads=5 maxSpareThreads=75 enableLookups=true disableUploadTimeout=true acceptCount=100 maxThreads=200 scheme=https secure=true SSLEnabled=true keystoreFile=/path/to/file/keystore keystorePass=** clientAuth=false sslProtocol=TLS/ Also, It does *work sometimes*. I get a proper streaming output of the weather feeds when it works. Hope this helps you understand the scenario better. Thanks, Sudeep -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: Wednesday, July 13, 2011 1:43 PM To: Tomcat Users List Subject: Re: Comet over HTTPS: END event recieved immeidately for the first few times is it possible that when you turn on SSL, you are using the regular BIO connector when you use SSL and Comet is not supported by that connector. best Filip On 7/11/2011 11:05 AM, Sudeep Pradhan wrote: Hi Filip, I have tried the app with tomcat 6.0.32 and 7.0.16, and the result is the same. I am not able to get it working with https. Http works just fine. The use case I am trying to address is that, I want to send notifications/events from a webapp to another webapp asynchronously. The 2 webapps communicate using REST call for other things. I want to have the same model for notifications. The client webapp will send a Https GET request and the server webapp will push the notifications asynchronously as a response. The client can be anything not just a webapp, I will be using curl as the client for testing. Please let me know if you want to know more. Thanks, Sudeep -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: Sunday, July 10, 2011 8:12 PM To: Tomcat Users List Subject: Re: Comet over HTTPS: END event recieved immeidately for the first few times try the latest version of Tomcat 6, if that doesn't work, provide a test case so we can take a look at it On 7/8/2011 4:07 PM, Sudeep Pradhan wrote: Any insights on this? -Original Message- From: Sudeep Pradhan [mailto:pradh...@vmware.com] Sent: Wednesday, June 29, 2011 4:54 PM To: users@tomcat.apache.org Subject: Comet over HTTPS: END event recieved immeidately for the first few times Hello, I am using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple TomcatWeatherServlet as presented in http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the servlet to stream weather feed to multiple curl clients. I am using curl 7.21.6 as my client. When I run curl -i -k -v -trace https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weatherfrom the command-line I get the following response for the first few times: code $ curl -i -k -v -trace https://IP_Addr:8443/Weather * About to connect() toIP_Addrport 8443 (#0) * TryingIP_Addr... connected * Connected toIP_Addr(IP_Addr) port 8443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: * start date: 2009-02-23 23:07:18 GMT * expire date: 2019-02-21 23:07:18 GMT * common name: XX (does not match 'IP_Addr') * issuer: XX * SSL certificate verify result: self signed certificate (18), continuing anyway. GET /Weather HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host:IP_Addr:8443 Accept: */* HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 Content-Length: 0 Content-Length: 0 Date: Wed, 29 Jun 2011 23:40:17 GMT Date: Wed, 29 Jun 2011 23:40:17 GMT * Connection #0 to hostIP_Addrleft intact * Closing connection #0 * SSLv3, TLS alert, Client hello (1): /code Observe that Content-Length is 0 in the response. Also when I do get the expected response which is, code GET /Weather HTTP/1.1 User-Agent: curl/7.21.6
Re: Comet over HTTPS: END event recieved immeidately for the first few times
is it possible that when you turn on SSL, you are using the regular BIO connector when you use SSL and Comet is not supported by that connector. best Filip On 7/11/2011 11:05 AM, Sudeep Pradhan wrote: Hi Filip, I have tried the app with tomcat 6.0.32 and 7.0.16, and the result is the same. I am not able to get it working with https. Http works just fine. The use case I am trying to address is that, I want to send notifications/events from a webapp to another webapp asynchronously. The 2 webapps communicate using REST call for other things. I want to have the same model for notifications. The client webapp will send a Https GET request and the server webapp will push the notifications asynchronously as a response. The client can be anything not just a webapp, I will be using curl as the client for testing. Please let me know if you want to know more. Thanks, Sudeep -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: Sunday, July 10, 2011 8:12 PM To: Tomcat Users List Subject: Re: Comet over HTTPS: END event recieved immeidately for the first few times try the latest version of Tomcat 6, if that doesn't work, provide a test case so we can take a look at it On 7/8/2011 4:07 PM, Sudeep Pradhan wrote: Any insights on this? -Original Message- From: Sudeep Pradhan [mailto:pradh...@vmware.com] Sent: Wednesday, June 29, 2011 4:54 PM To: users@tomcat.apache.org Subject: Comet over HTTPS: END event recieved immeidately for the first few times Hello, I am using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple TomcatWeatherServlet as presented in http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the servlet to stream weather feed to multiple curl clients. I am using curl 7.21.6 as my client. When I run curl -i -k -v -trace https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather from the command-line I get the following response for the first few times: code $ curl -i -k -v -trace https://IP_Addr:8443/Weather * About to connect() toIP_Addr port 8443 (#0) * TryingIP_Addr... connected * Connected toIP_Addr (IP_Addr) port 8443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: * start date: 2009-02-23 23:07:18 GMT * expire date: 2019-02-21 23:07:18 GMT * common name: XX (does not match 'IP_Addr') * issuer: XX * SSL certificate verify result: self signed certificate (18), continuing anyway. GET /Weather HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host:IP_Addr:8443 Accept: */* HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 Content-Length: 0 Content-Length: 0 Date: Wed, 29 Jun 2011 23:40:17 GMT Date: Wed, 29 Jun 2011 23:40:17 GMT * Connection #0 to hostIP_Addr left intact * Closing connection #0 * SSLv3, TLS alert, Client hello (1): /code Observe that Content-Length is 0 in the response. Also when I do get the expected response which is, code GET /Weather HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host:IP_Addr:8443 Accept: */* HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 Transfer-Encoding: chunked Transfer-Encoding: chunked Date: Wed, 29 Jun 2011 23:46:18 GMT Date: Wed, 29 Jun 2011 23:46:18 GMT h2Conditions for San Jose, CA at 3:52 pm PDT/h2 img src=http://l.yimg.com/a/i/us/we/52/30.gif/br / bCurrent Conditions:/bbr / Partly Cloudy, 68 FBR / BR /bForecast:/bBR / Wed - Mostly Clear. High: 70 Low: 55br / Thu - Partly Cloudy. High: 77 Low: 57br / br / a href=http://us.rd.yahoo.com/dailynews/rss/weather/San_Jose__CA/*http://weather.yahoo.com/forecast/USCA0993_f.html;Full Forecast at Yahoo! Weather/aBR/BR/ (provided bya href=http://www.weather.com;The Weather Channel/a)br/ br /code I get Transfer-Encoding as chunked and no Content-Length. On Server logs I get for the error are: 16:40:16.916 INFO http-8443-exec-3 TomcatWeatherServlet:41 - Begin for session: BDD6B1808161F1DA99D5D3207F1A719B 16:40:16.959 INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: BDD6B1808161F1DA99D5D3207F1A719B 16:40:17.033 INFO http-8443-exec-4
Re: Tomcat Pool and XA datasource
you've misconfigured it. the driverClassName would have to be a driver. Using XA data sources needs to create the datasource for those connections first. There is an example towards the bottom of http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency Filip On 7/12/2011 6:27 AM, Siemback, Chris wrote: Hello all, Has anyone ever been able to successfully setup an Oracle XA datasource using the newer Tomcat Pool and running Tomcat 7? It appears the Tomcat Pool is attempting to cast the oracle XA data source to a java.sql.Driver - which it isn't. This needs to be an XA datasource. Anyone have luck with this - no working examples that I can find? Here's the versions/info/error: Software: Tomcat 7.0.16 Tomcat Pool 1.1.0.1 http://people.apache.org/~fhanik/jdbc-pool/v1.1.0.1/apache-tomcat-jdbc-1.1.0.1-bin.zip Oracle 11 (ojdbc6.jar) Context.xml contents: Resource auth=Container type=javax.sql.XADataSource factory=org.apache.tomcat.jdbc.pool.DataSourceFactory driverClassName=oracle.jdbc.xa.client.OracleXADataSource name=jdbc/mydatabase username=username password=password url=jdbc:oracle:thin:@localhost:1521:XE / Exception: SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [javax.servlet.ServletException: javax.naming.NamingException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver] with root cause javax.naming.NamingException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver at org.apache.naming.NamingContext.lookup(NamingContext.java:843) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.apache.jsp.jdbc_jsp._jspService(jdbc_jsp.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:286) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:272) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1730) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended
Re: Comet over HTTPS: END event recieved immeidately for the first few times
try the latest version of Tomcat 6, if that doesn't work, provide a test case so we can take a look at it On 7/8/2011 4:07 PM, Sudeep Pradhan wrote: Any insights on this? -Original Message- From: Sudeep Pradhan [mailto:pradh...@vmware.com] Sent: Wednesday, June 29, 2011 4:54 PM To: users@tomcat.apache.org Subject: Comet over HTTPS: END event recieved immeidately for the first few times Hello, I am using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple TomcatWeatherServlet as presented in http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the servlet to stream weather feed to multiple curl clients. I am using curl 7.21.6 as my client. When I run curl -i -k -v -trace https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather from the command-line I get the following response for the first few times: code $ curl -i -k -v -trace https://IP_Addr:8443/Weather * About to connect() toIP_Addr port 8443 (#0) * TryingIP_Addr... connected * Connected toIP_Addr (IP_Addr) port 8443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: * start date: 2009-02-23 23:07:18 GMT * expire date: 2019-02-21 23:07:18 GMT * common name: XX (does not match 'IP_Addr') * issuer: XX * SSL certificate verify result: self signed certificate (18), continuing anyway. GET /Weather HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host:IP_Addr:8443 Accept: */* HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 Content-Length: 0 Content-Length: 0 Date: Wed, 29 Jun 2011 23:40:17 GMT Date: Wed, 29 Jun 2011 23:40:17 GMT * Connection #0 to hostIP_Addr left intact * Closing connection #0 * SSLv3, TLS alert, Client hello (1): /code Observe that Content-Length is 0 in the response. Also when I do get the expected response which is, code GET /Weather HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host:IP_Addr:8443 Accept: */* HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1 Transfer-Encoding: chunked Transfer-Encoding: chunked Date: Wed, 29 Jun 2011 23:46:18 GMT Date: Wed, 29 Jun 2011 23:46:18 GMT h2Conditions for San Jose, CA at 3:52 pm PDT/h2 img src=http://l.yimg.com/a/i/us/we/52/30.gif/br / bCurrent Conditions:/bbr / Partly Cloudy, 68 FBR / BR /bForecast:/bBR / Wed - Mostly Clear. High: 70 Low: 55br / Thu - Partly Cloudy. High: 77 Low: 57br / br / a href=http://us.rd.yahoo.com/dailynews/rss/weather/San_Jose__CA/*http://weather.yahoo.com/forecast/USCA0993_f.html;Full Forecast at Yahoo! Weather/aBR/BR/ (provided bya href=http://www.weather.com;The Weather Channel/a)br/ br /code I get Transfer-Encoding as chunked and no Content-Length. On Server logs I get for the error are: 16:40:16.916 INFO http-8443-exec-3 TomcatWeatherServlet:41 - Begin for session: BDD6B1808161F1DA99D5D3207F1A719B 16:40:16.959 INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: BDD6B1808161F1DA99D5D3207F1A719B 16:40:17.033 INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: BDD6B1808161F1DA99D5D3207F1A719B This was working when I was on HTTP. I have tried to debug this for a lot of time w/o success. Also I get two END events instead of one as seen in the Logs. Any insights will be helpful. Thanks, Sudeep - 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: getAllClusterSessions gives OptionalDataException
On 6/28/2011 2:31 AM, Konstantin Kolinko wrote: 2011/6/23 Ronald Klopronald-mailingl...@base.nl: Hi, I have an exception when one on my Tomcat nodes restarts. The session are not synced and user complain about being logged out. I was running 6.0.32 and had the problem. Now I'm running a custom build of 6.0.33 from yesterday. I added a little code which prints ' SEVERE: name=user'. The key on which the sync fails while reading the value. I looked into the java code in ObjectInputStream and it looks like some inconsistency in the ObjectStream. I have 4 nodes on Debian 5, sun-java6-jdk 6-22-0lenny1, seen the problem on Tomcat 6.0.29, 6.0.32 and a custom build 6.0.33. I can't reproduce this (yet) on my test environment, so debugging it is difficult without upset customers. Engine name=Catalina defaultHost=xxx.xxx.xxx Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService port=47727 / /Channel /Cluster Host name=xxx.xxx.xxx appBase=/data/webapps/crm-LIVE/deployed unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=true /Host /Engine Can I provide more information? Where should I look. NB: In some previous mails about another problem I thought that might be the reason for my logout problem, that is why I tried 6.0.33-dev. Ronald. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [crm.realworks.nl#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 10, 110}:4000,{10, 0, 10, 110},4000, alive=45370885,id={-34 112 102 -93 -87 -88 77 18 -113 -30 62 8 62 -65 -112 -13 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [crm.realworks.nl#]; session state send at 6/23/11 5:49 PM received in 304 ms. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [crm.realworks.nl#]: Drop message SESSION-ACCESSED inside GET_ALL_SESSIONS sync phase start date 6/23/11 5:49 PM message date 6/23/11 5:49 PM Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaSession readObject SEVERE: name=user. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager deserializeSessions SEVERE: IOException while loading persisted sessions: java.io.OptionalDataException java.io.OptionalDataException at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at java.util.HashMap.readObject(HashMap.java:1029) (...) Looking at ObjectInputStream sourced, the OptionalDataException is thrown when the source stream is truncated. It might be related to the following issue, fixed in Tomcat 7, but never proposed for backport yet: https://issues.apache.org/bugzilla/show_bug.cgi?id=50646 Tribes ByteMessage will get corrupted if message size exceeds the underlying buffer size that's what I thought, but the SessionMessage doesn't use ByteMessage Best regards, Konstantin Kolinko - 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: getAllClusterSessions gives OptionalDataException
are there other versions of Apache Tomcat running in the same cluster? Check the logs for what members are joining the cluster, then check what version they are best Filip On 6/23/2011 10:14 AM, Ronald Klop wrote: Hi, I have an exception when one on my Tomcat nodes restarts. The session are not synced and user complain about being logged out. I was running 6.0.32 and had the problem. Now I'm running a custom build of 6.0.33 from yesterday. I added a little code which prints ' SEVERE: name=user'. The key on which the sync fails while reading the value. I looked into the java code in ObjectInputStream and it looks like some inconsistency in the ObjectStream. I have 4 nodes on Debian 5, sun-java6-jdk 6-22-0lenny1, seen the problem on Tomcat 6.0.29, 6.0.32 and a custom build 6.0.33. I can't reproduce this (yet) on my test environment, so debugging it is difficult without upset customers. Engine name=Catalina defaultHost=xxx.xxx.xxx Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService port=47727 / /Channel /Cluster Host name=xxx.xxx.xxx appBase=/data/webapps/crm-LIVE/deployed unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=true /Host /Engine Can I provide more information? Where should I look. NB: In some previous mails about another problem I thought that might be the reason for my logout problem, that is why I tried 6.0.33-dev. Ronald. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [crm.realworks.nl#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 0, 10, 110}:4000,{10, 0, 10, 110},4000, alive=45370885,id={-34 112 102 -93 -87 -88 77 18 -113 -30 62 8 62 -65 -112 -13 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [crm.realworks.nl#]; session state send at 6/23/11 5:49 PM received in 304 ms. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [crm.realworks.nl#]: Drop message SESSION-ACCESSED inside GET_ALL_SESSIONS sync phase start date 6/23/11 5:49 PM message date 6/23/11 5:49 PM Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaSession readObject SEVERE: name=user. Jun 23, 2011 5:49:47 PM org.apache.catalina.ha.session.DeltaManager deserializeSessions SEVERE: IOException while loading persisted sessions: java.io.OptionalDataException java.io.OptionalDataException at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at java.util.HashMap.readObject(HashMap.java:1029) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at org.apache.catalina.ha.session.DeltaSession.readObject(DeltaSession.java:655) at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:481) at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:745) at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1583) at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1440) at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1173) at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:92) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:901) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:882) at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269) at
Re: async requests on cluster
On 6/7/2011 3:34 PM, Mark Thomas wrote: On 07/06/2011 21:46, Seth Lenzi wrote: The isAsyncSupported() method of the SerlvletRequest object returns false when you uncomment theCluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ element in the server.xml file (Tomcat 7.0.14). Basically, enabling clustering seems to break support for asynchronous servlets... Is there something else that needs to be done to enable async requests to work on a cluster? That would be a bug. Looking at it now, the fix should make it into the next 7.0.x release (7.0.16). I'll be starting on that release once this issue is fixed. not a bug,just not a feature yet implemented. replication is triggered when a request ends. when async is in play, replication must be replicated based on an interval, or when the request is finally complete. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1382 / Virus Database: 1511/3688 - Release Date: 06/08/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 Clustering vs. Tomcat 5.5 clustering
On 5/23/2011 6:50 AM, Martin Knoblauch wrote: Hi, while moving an application from Tomcat 5.5 to Tomcat 6 I found some differences in clustering, that I could not resolve myself: e. G. What happened to replicationMode, ackTimeout waitForAck? In TC 5.5 I had: Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=fastasyncqueue ackTimeout=15000 waitForAck=true/ channelSendOptions http://tomcat.apache.org/tomcat-6.0-doc/config/cluster.html Are they still available with org.apache.catalina.tribes.transport.ReplicationTransmitter? Also, can I assume the bindAddress from org.apache.catalina.cluster.mcast.McastService is the same as bind from org.apache.catalina.tribes.membership.McastService? yes http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-membership.html Thanks Martin -- Martin Knoblauch email: k n o b i AT knobisoft DOT de www: http://www.knobisoft.de - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1375 / Virus Database: 1511/3673 - Release Date: 06/01/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat download stream gets broken
Looks like the client disconnected, that is a fairly normal scenario. You have to be able to handle the error if a client disconnects prior to having downloaded all the content Filip On 5/19/2011 8:46 AM, Gerardo Corro wrote: Trying gmail Hi all, I have a file download servlet running on Tomcat, the code is public void service(HttpServletRequest request, HttpServletResponse response) throws IOException { byte buf[] = new byte[1024 * 4]; try { File file = new File(realFilename); int size = (int) file.length(); BufferedInputStream realFile = new BufferedInputStream(new FileInputStream(file)); OutputStream out = response.getOutputStream(); response.setContentLength(size); while (true) { int count = realFile.read(buf); if (count == -1) { break; } out.write(buf, 0, count); } out.flush(); } catch (FileNotFoundException e) { logger.error(Stream download failed, file not found: + realFilename, e); response.sendError(404); } catch (Exception e) { logger.error(DownloadException:, e); } } However once in a while I get an error that prevents files from being downloaded: DownloadException: java.net.SocketException: Broken pipe at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:113) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:750) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:773) at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:583) at org.apache.coyote.Response.doWrite(Response.java:560) at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361) ... 23 more How can I prevent such an error? Thanks!!! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1321 / Virus Database: 1500/3646 - Release Date: 05/18/11 - To unsubscribe,
Re: How to close all connections in a Tomcat container db connection pool?
in Tomcat 7 (not sure if backported to 6), you configure a Resource closeMethod=close / Filip On 5/11/2011 7:55 AM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dale, On 5/10/2011 7:24 PM, Dale Ogilvie wrote: The cause of the error was the db admin patching a db package underlying one used by our web-app. Post patch all the packages appeared valid to the admin, but not to our app using db connections established prior to the db patching. Looks like the Oracle connection caches some of that metadata. Maybe your dba shouldn't mess with that kind of stuff while the application is running :) Is there any way to tell the running Tomcat to clean out the connection pool, so that it throws away all the established connections, and establishes new ones for the applications. I don't really want to have to stop all the applications on our server to deal with this sort of issue. You'll have to basically reach-into the JNDI context, pull-out the DataSource object, cross your fingers and cast it to some known object type (like org.apache.tomcat.dbcp.dbcp.BasicDataSource) and then call methods on that Tomcat-specific class. You could call the close method on that class, but I suspect you'll end up with an empty, useless pool at that point. It's possible that the pool will re-initialize itself when you call getConnection but you'll have to check that out for yourself. You could also look into using JMX, but you'll have to poke around looking for the key for your DataSource and then I don't have any idea what actions are available... YMMV. Maybe there's a method on the Oracle-specific connection object(s) that you can use to flush all the metadata. You might want to look into that, too. Finally, if you use a webapp-specific DataSource (that is, not a global one) and you properly close the DataSource when the webapp shuts down, a new one should be created for your when the new instance of the webapp launches. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3KlV8ACgkQ9CaO5/Lv0PCLcQCgt5X+2GBrQpIaHSY+nYwFZZrp QsYAnjQTGHKiwGNTrdkBkRkHbwPebosE =Z1eH -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1321 / Virus Database: 1500/3629 - Release Date: 05/10/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connection pool race condition
this is the way to go, just setup a service dependency On 4/28/2011 7:36 AM, Peter Crowther wrote: You could use Windows' service dependency management ( http://support.microsoft.com/kb/193888) to start Tomcat only after Oracle reports that it's running. This might still cause problems if Oracle does the same as SQL Server and continues recovering after its official startup has finished. In that case, I'd try to write a small service that polled Oracle every few seconds till it started, then reported itself as started, and make Tomcat dependent on that. Service creation in Windows isn't too hard, but it's another moving part to support! - Peter On 27 April 2011 21:18, chris derhamch...@derham.me.uk wrote: All, So we have various tomcat services setup on windows. When windows updates are auto installed, sometimes they force a reboot of the server. When this happens, the tomcats win the race with the database (Oracle) to startup. Then the connection pool can't start, and then the war file is flagged as shutdown. We have tried to make the tomcat services dependent on the oracle service (both db service and tns listener), but same happens. Just tried to turn the connection pool initial size down to zero, but the app fetches some config at startup. I guess we could recode to lazily fetch this upon first access. Just curious if anyone has hit this, and if there is a way to delay the tomcat service startup. Tomcat 7.0.12 Windows server 2008 r2 64 bit java -version java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) We have connection pool setup in catalina_base\conf\context.xml Resource name=jdbc/xts auth=Container type=javax.sql.DataSource username=username password=password driverClassName=oracle.jdbc.OracleDriver url=jdbc:oracle:thin:@localhost:1521:xe maxActive=20 maxIdle=2 minIdle=1 initialSize=2 / 27-Apr-2011 19:48:22 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext 27-Apr-2011 19:48:31 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'dispatcher' 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Destroying Spring FrameworkServlet 'dispatcher' 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Shutting down log4j 27-Apr-2011 20:25:36 org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class liquibase.integration.servlet.LiquibaseServletListener java.lang.RuntimeException: javax.naming.NamingException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress ) at liquibase.integration.servlet.LiquibaseServletListener.contextInitialized(LiquibaseServletListener.java:159) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: javax.naming.NamingException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress ) at org.apache.naming.NamingContext.lookup(NamingContext.java:843) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158) at javax.naming.InitialContext.lookup(InitialContext.java:392) Thanks Chris - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3601 - Release Date: 04/27/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connection pool race condition
There is another solution that should work, and that is to define initialSize=0 so that no attempt is made to contact the DB when it is created. Then set testOnBorrow=true The jdbc-pool project should work like this http://people.apache.org/~fhanik/jdbc-pool/ Filip On 4/28/2011 1:58 PM, Filip Hanik - Dev Lists wrote: this is the way to go, just setup a service dependency On 4/28/2011 7:36 AM, Peter Crowther wrote: You could use Windows' service dependency management ( http://support.microsoft.com/kb/193888) to start Tomcat only after Oracle reports that it's running. This might still cause problems if Oracle does the same as SQL Server and continues recovering after its official startup has finished. In that case, I'd try to write a small service that polled Oracle every few seconds till it started, then reported itself as started, and make Tomcat dependent on that. Service creation in Windows isn't too hard, but it's another moving part to support! - Peter On 27 April 2011 21:18, chris derhamch...@derham.me.uk wrote: All, So we have various tomcat services setup on windows. When windows updates are auto installed, sometimes they force a reboot of the server. When this happens, the tomcats win the race with the database (Oracle) to startup. Then the connection pool can't start, and then the war file is flagged as shutdown. We have tried to make the tomcat services dependent on the oracle service (both db service and tns listener), but same happens. Just tried to turn the connection pool initial size down to zero, but the app fetches some config at startup. I guess we could recode to lazily fetch this upon first access. Just curious if anyone has hit this, and if there is a way to delay the tomcat service startup. Tomcat 7.0.12 Windows server 2008 r2 64 bit java -version java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) We have connection pool setup in catalina_base\conf\context.xml Resource name=jdbc/xts auth=Container type=javax.sql.DataSource username=username password=password driverClassName=oracle.jdbc.OracleDriver url=jdbc:oracle:thin:@localhost:1521:xe maxActive=20 maxIdle=2 minIdle=1 initialSize=2 / 27-Apr-2011 19:48:22 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext 27-Apr-2011 19:48:31 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'dispatcher' 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Destroying Spring FrameworkServlet 'dispatcher' 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log INFO: Shutting down log4j 27-Apr-2011 20:25:36 org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class liquibase.integration.servlet.LiquibaseServletListener java.lang.RuntimeException: javax.naming.NamingException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress ) at liquibase.integration.servlet.LiquibaseServletListener.contextInitialized(LiquibaseServletListener.java:159) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: javax.naming.NamingException: Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in progress ) at org.apache.naming.NamingContext.lookup(NamingContext.java:843) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:145) at org.apache.naming.NamingContext.lookup(NamingContext.java:814) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158) at javax.naming.InitialContext.lookup(InitialContext.java:392) Thanks Chris - No virus found in this message. Checked by AVG
Re: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?
download tomcat-jdbc.jar from http://people.apache.org/~fhanik/jdbc-pool/ and put it in your lib directory Filip On 4/20/2011 7:38 AM, dunnlow wrote: So, I'm investigating moving away from an oracleconnectionpool and using the tomcat connection pool. I followed the myriad of examples for configuring the Resource in the server.xml. Found great info here (http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I start tomcat, I get the following error: javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory] I'm using Tomcat 6.0 My config in server.xml is Resource auth=Container driverClassName=oracle.jdbc.OracleDriver factory=org.apache.tomcat.jdbc.pool.DataSourceFactory name=jdbc/myds password=mypasswd type=javax.sql.DataSource url=jdbc:oracle:thin:@10.10.10.33:1234:myds user=myuname / I get it, tomcat can't find the class. But WHY? I don't see anything in the documentation about adding extra .jar files. I've looked in the distrib and can find the golden .jar anyway. Can anyone tell me what I am doing wrong? Thanks! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HttpSessionActivationListener sessionDidActivate not getting called
did any data actually get written to /shared/httpd/tomcat_sessions It could be that there is a permission problem best Filip On 4/8/2011 1:20 PM, Aggarwal, Ajay wrote: I enabled logging, created 1 session and restarted tomcat. This is what I see in the logs. Is there anything suspicious here? Why are there multiple attempts to persist sessions? Is it one per application? One thing that has changed is now I have multiple applications. And the path /shared/httpd/tomcat_sessions for persistence is configured in {TOMCAT_BASE}/conf/context.xml, which means it applies to all apps. So perhaps my 1st app is persisting the session ok. But 2nd app that has no sessions is overriding the session persistence file. I will try by moving this configuration to the application where I really need this functionality. Meanwhile can anybody, familiar with this code, validate my theory? --- while stopping DEBUG [main] 2011-04-08 15:05:37,352 org.apache.catalina.session.ManagerBase - Stopping DEBUG [main] 2011-04-08 15:05:37,352 org.apache.catalina.session.ManagerBase - Unloading persisted sessions DEBUG [main] 2011-04-08 15:05:37,352 org.apache.catalina.session.ManagerBase - Saving persisted sessions to /shared/httpd/tomcat_sessions DEBUG [main] 2011-04-08 15:05:37,353 org.apache.catalina.session.ManagerBase - Unloading 1 sessions DEBUG [main] 2011-04-08 15:05:37,359 org.apache.catalina.session.ManagerBase - Expiring 1 persisted sessions DEBUG [main] 2011-04-08 15:05:37,359 org.apache.catalina.session.ManagerBase - Unloading complete DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Stopping DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Unloading persisted sessions DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Saving persisted sessions to /shared/httpd/tomcat_sessions DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Unloading 0 sessions DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Expiring 0 persisted sessions DEBUG [main] 2011-04-08 15:05:37,590 org.apache.catalina.session.ManagerBase - Unloading complete DEBUG [main] 2011-04-08 15:05:37,597 org.apache.catalina.session.ManagerBase - Stopping --- restarting DEBUG [main] 2011-04-08 15:05:40,463 org.apache.catalina.session.ManagerBase - Start: Loading persisted sessions DEBUG [main] 2011-04-08 15:05:40,464 org.apache.catalina.session.ManagerBase - Loading persisted sessions from /shared/httpd/tomcat_sessions DEBUG [main] 2011-04-08 15:05:40,464 org.apache.catalina.session.ManagerBase - Creating custom object input stream for class loader DEBUG [main] 2011-04-08 15:05:40,470 org.apache.catalina.session.ManagerBase - Loading 0 persisted sessions -Original Message- From: Aggarwal, Ajay [mailto:ajay.aggar...@stratus.com] That's the first thing I thought too. However I don't see anything in the logs to indicate this. Also when sessionWillPassivate() is called I am logging all session attributes to make sure there is nothing non serializable there. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] From: Aggarwal, Ajay [mailto:ajay.aggar...@stratus.com] Subject: HttpSessionActivationListener sessionDidActivate not getting called Lately I am seeing that sessionDidActivate() does not get called upon tomcat restart, even though sessionWillPassivate() is called. Also even though sessionWillPassivate() is called, I don't see the session persistence file being created (the one that I specified in conf/context.xmlcontextManager pathname=xxx ). Perhaps you are now storing something in the session that is not serializable. I would expect some log entries indicating such if that's the case. - Chuck - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3559 - Release Date: 04/08/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trouble with jdbc drivers in TC 7
The config has changed from Resource ... param to Resource driverClassName= that could be your culprit On 4/7/2011 12:08 PM, David kerber wrote: System: Windows Server 2008 R2 Standard (64-bit) JRE: 1.6.0_24 x64 TC: 7.0.11, installed in c:\Program Files\..., so it detected an x64 installation DB: Sybase ASA 9.0.2.3951, x64 version DB server and TC are both installed on this same machine. I'm trying to port my app from tc 5.5.something late, to 7.0, and can't get my app to find the driver class. It all works fine under TC 5.5. All my database pooling is done in the application, so I thought putting the jodbc.jar in the WEB-INF/lib of the app would work with no need to edit my configuration files, but I'm still getting the class not found error below. I have also tried moving jodbc.jar to %catalina_home%/lib, but that didn't help either. RtData64 is the 64-bit ODBC DSN, which test ok in ODBC admin. I have opened jodbc.jar to be sure it has ianywhere.ml.jdbcodbc.IDriver inside it. Am I missing some configuration requirements? I can't find anything in the online docs that would indicate I need to do anything, since I'm not having TC handle the connection pooling. Dave Thu Apr 07 12:09:56 EDT 2011: Exception in class: com.wra.websira.WraAdmin, Msg: 'Initialization', Exception: java.lang.ClassNotFoundException: ianywhere.ml.jdbcodbc.IDriver Thu Apr 07 12:09:56 EDT 2011: Exception in class: com.wra.websira.WraJdbc, Msg: 'Creating database: RtData64', Exception: java.lang.ClassNotFoundException: ianywhere.ml.jdbcodbc.IDriver java.lang.ClassNotFoundException: ianywhere.ml.jdbcodbc.IDriver at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.wra.websira.WraDatabase.open(WraDatabase.java:64) at com.wra.websira.WraJdbc.init(WraJdbc.java:46) at com.wra.websira.WraAdmin.init(WraAdmin.java:257) at com.wra.websira.WraAdmin.validateUser(WraAdmin.java:594) at com.wra.websira.WraAdmin.validateUser(WraAdmin.java:451) at eddsrv.LoginBean.verifyUser(LoginBean.java:41) at org.apache.jsp.Login_jsp._jspService(Login_jsp.java:144) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3557 - Release Date: 04/07/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JDBC Pool Disconnections
On 4/5/2011 7:31 AM, הילה wrote: name=jdbc/com/vstechnology/appname scope=Shareable type=javax.sql.Datasource url=jdbc:jtds:sqlserver://SQLServerName:1433/DBname;useCursors=false;sendStringParametersAsUnicode=false factory=org.apache.tomcat.jdbc.pool.DataSourceFactory maxActive=200 minIdle=0 maxIdle=10 maxWait=1 initialSize=20 driverClassName=net.sourceforge.jtds.jdbc.Driver Add in testOnBorrow=true validationQuery=select 1 this ensures that if the DB closes a connection, the pool validates it best Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TomcatCluster data replication
On 4/6/2011 1:22 PM, Jürgen Jakobitsch wrote: hi, i'm in need of data replication in a tomcat-cluster. i set up a tomcat cluster of three tomcats on a single machine with a apache (mod_jk) front that does the load balacing. everything works absolutely charming for reading requests, my trouble start with data input. what i'm trying to achieve is that if i submit data with a html form, the storage on all cluster members needs to be updated. i'm using an openrdf's sesame triple store which locks it's data directory so i can't simply use a single shared directory in my application. sounds like a limitation of sesame. Use some other noSQL data store and you wont have this issue best Filip what i have in mind, after first readings, is some sort of clustervalve that checks, if a request is a POST request and if yes, sends this request (which updates the repository in the back) to all members of the cluster. so here would be my questions : 1. is there a standard way of doing something like (which a not-clusterable data-backend) 2. is the thing with the clustervalve in fact the correct starting point any help or pointer to the right direction greatly appreciated wkr turnguard.com/turnguard - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JDBC Pool Disconnections
validate == connection is open and working if they are worried about performance, there is a compromise that gets you best of both worlds testOnBorrow=true validationQuery=select 1 validationInterval=3 this ensures that in a high concurrency environment, the number of validations are limited Filip On 4/6/2011 1:36 PM, הילה wrote: I wanted to add it, bu the company that developed the application that runs on the tomcat, says that it affect performance and has issues. what do you mean validates it? what does it do, exactly? Thanks Hila 2011/4/6 Filip Hanik - Dev Listsdevli...@hanik.com On 4/5/2011 7:31 AM, הילה wrote: name=jdbc/com/vstechnology/appname scope=Shareable type=javax.sql.Datasource url=jdbc:jtds:sqlserver://SQLServerName:1433/DBname;useCursors=false;sendStringParametersAsUnicode=false factory=org.apache.tomcat.jdbc.pool.DataSourceFactory maxActive=200 minIdle=0 maxIdle=10 maxWait=1 initialSize=20 driverClassName=net.sourceforge.jtds.jdbc.Driver Add in testOnBorrow=true validationQuery=select 1 this ensures that if the DB closes a connection, the pool validates it best Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JDBC Pool Disconnections
On 4/6/2011 1:54 PM, הילה wrote: I wanted to add the last string as well, but they said to forget about it.. :] and they should know best however, if disconnections will continue (there are some right now) I'll try it anyway as for the connection validation = you said that if the DB closes a connection (why does it happen? can I prevent it?) most common is that the DB times out an idle connection. A pool holds a connection open, the connection is not being used and the DB times it out. there are many examples, same thing if there is a network glitch, or the db is restarted. than the pool is checking if the connection is open and working. and if not? i the DB closed the connection and it's not usable.. then what does the pool do? if the pool doesn't check, then it doesn't do anything. if the pool check (testOnBorrow=true) and the test fails, it closes the old connection and opens a new one. Filip 2011/4/6 Filip Hanik - Dev Listsdevli...@hanik.com validate == connection is open and working if they are worried about performance, there is a compromise that gets you best of both worlds testOnBorrow=true validationQuery=select 1 validationInterval=3 this ensures that in a high concurrency environment, the number of validations are limited Filip On 4/6/2011 1:36 PM, הילה wrote: I wanted to add it, bu the company that developed the application that runs on the tomcat, says that it affect performance and has issues. what do you mean validates it? what does it do, exactly? Thanks Hila 2011/4/6 Filip Hanik - Dev Listsdevli...@hanik.com On 4/5/2011 7:31 AM, הילה wrote: name=jdbc/com/vstechnology/appname scope=Shareable type=javax.sql.Datasource url=jdbc:jtds:sqlserver://SQLServerName:1433/DBname;useCursors=false;sendStringParametersAsUnicode=false factory=org.apache.tomcat.jdbc.pool.DataSourceFactory maxActive=200 minIdle=0 maxIdle=10 maxWait=1 initialSize=20 driverClassName=net.sourceforge.jtds.jdbc.Driver Add in testOnBorrow=true validationQuery=select 1 this ensures that if the DB closes a connection, the pool validates it best Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: No access log for AJP traffic
Tomcat 6 http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java?annotate=1030188 Look at the invoke() method, it logs the data Tomcat 7 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?view=annotate Look at the invoke() method, it does nothing :) It seems to have happened here http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?r1=1059547r2=1059548; Filip On 4/6/2011 1:50 PM, Chris Dumoulin wrote: In looking into this further, it appears that the difference isn't in HTTP vs AJP, the difference is in async vs synchronous. The AJP traffic was carrying requests that were being processed asynchronously in Tomcat. If I switch to using the HTTP connector for this same traffic I still don't see anything in the access log. Other requests that are being processed synchronously are showing up in the access logs. I'm starting to step through the Tomcat code now, but any thoughts on this would be appreciated. - Chris On April 6, 2011 03:31:18 pm Chris Dumoulin wrote: Thanks for your response Andre. I'm using AJP between Tomcat and Nginx using this Nginx module: https://github.com/yaoweibin/nginx_ajp_module There is definitely AJP traffic, it's just not showing up in the access log. - Chris On April 6, 2011 03:24:38 pm André Warnier wrote: Chris Dumoulin wrote: I'm using tomcat 7.0.11 with the following Connector and Host elements in server.xml: Connector connectionTimeout=2 port=8080 protocol=HTTP/1.1 redirectPort=8443/ Connector port=8009 protocol=AJP/1.3 redirectPort=8443/ Host appBase=webapps autoDeploy=true name=localhost unpackWARs=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%h %l %u %tquot;%rquot; %s %b prefix=localhost_access_log. resolveHosts=false suffix=.txt/ Context docBase=app1 path=/app1 reloadable=true source=org.eclipse.jst.jee.server:app1/ Context docBase=app2 path=/app2 reloadable=true source=org.eclipse.jst.j2ee.server:app2/ /Host In the access log I'm seeing the HTTP traffic on port 8080 but not the AJP traffic on port 8009. I've googled around and I don't see any mention of specific Valve settings for AJP. Any ideas? And are you expecting traffic on the AJP Connector ? For traffic to show up there, some client would need to connect to your server on port 8009. Is there anything that connects to that port ? If not, then there is nothing to worry about, and you could even comment-out that Connector, since it will never be used. Like : !-- Connector port=8009 protocol=AJP/1.3 redirectPort=8443/ -- The AJP Connector is used in scenarios where there is another webserver used as a front-end to Tomcat, and this other webserver, to pass requests to Tomcat, uses the AJP protocol. For example, a configuration like this one : browser-- Apache httpd server- Tomcat + mod_jk module OR + mod_proxy_ajp module or browser-- IIS webserver- Tomcat + isapi_redirect module If you do not use such a configuration, or you do not understand what this is all about, then you don't need the AJPConnector in Tomcat. - 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: No access log for AJP traffic
The logging now takes place in the CoyoteAdapter http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?r1=1086351r2=1086352; Filip On 4/6/2011 2:26 PM, Filip Hanik - Dev Lists wrote: Tomcat 6 http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java?annotate=1030188 Look at the invoke() method, it logs the data Tomcat 7 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?view=annotate Look at the invoke() method, it does nothing :) It seems to have happened here http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?r1=1059547r2=1059548; Filip On 4/6/2011 1:50 PM, Chris Dumoulin wrote: In looking into this further, it appears that the difference isn't in HTTP vs AJP, the difference is in async vs synchronous. The AJP traffic was carrying requests that were being processed asynchronously in Tomcat. If I switch to using the HTTP connector for this same traffic I still don't see anything in the access log. Other requests that are being processed synchronously are showing up in the access logs. I'm starting to step through the Tomcat code now, but any thoughts on this would be appreciated. - Chris On April 6, 2011 03:31:18 pm Chris Dumoulin wrote: Thanks for your response Andre. I'm using AJP between Tomcat and Nginx using this Nginx module: https://github.com/yaoweibin/nginx_ajp_module There is definitely AJP traffic, it's just not showing up in the access log. - Chris On April 6, 2011 03:24:38 pm André Warnier wrote: Chris Dumoulin wrote: I'm using tomcat 7.0.11 with the following Connector and Host elements in server.xml: Connector connectionTimeout=2 port=8080 protocol=HTTP/1.1 redirectPort=8443/ Connector port=8009 protocol=AJP/1.3 redirectPort=8443/ Host appBase=webapps autoDeploy=true name=localhost unpackWARs=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%h %l %u %tquot;%rquot; %s %b prefix=localhost_access_log. resolveHosts=false suffix=.txt/ Context docBase=app1 path=/app1 reloadable=true source=org.eclipse.jst.jee.server:app1/ Context docBase=app2 path=/app2 reloadable=true source=org.eclipse.jst.j2ee.server:app2/ /Host In the access log I'm seeing the HTTP traffic on port 8080 but not the AJP traffic on port 8009. I've googled around and I don't see any mention of specific Valve settings for AJP. Any ideas? And are you expecting traffic on the AJP Connector ? For traffic to show up there, some client would need to connect to your server on port 8009. Is there anything that connects to that port ? If not, then there is nothing to worry about, and you could even comment-out that Connector, since it will never be used. Like : !-- Connector port=8009 protocol=AJP/1.3 redirectPort=8443/ -- The AJP Connector is used in scenarios where there is another webserver used as a front-end to Tomcat, and this other webserver, to pass requests to Tomcat, uses the AJP protocol. For example, a configuration like this one : browser-- Apache httpd server- Tomcat + mod_jk module OR + mod_proxy_ajp module or browser-- IIS webserver- Tomcat + isapi_redirect module If you do not use such a configuration, or you do not understand what this is all about, then you don't need the AJPConnector in Tomcat. - 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3555 - Release Date: 04/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat hardware requirments
On 4/5/2011 10:46 AM, bfackrell wrote: What are the hardware requirements for Tomcat 7? I looked (Google and on the Apache website) I’m just finishing a college course that taught Java technologies that interact with Tomcat but I want to know more so I’ve decided to try to build my own Tomcat server from scrap computer parts that I have. The first thing I need to know is: Will my junk even run Tomcat 7? The chance that your junk will run Tomcat 7 is very high. Tomcat has a very small foot print as an application server. Most of the memory and CPU requirements come from the application itself Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.32, Http11NioProtocol and log poll
On 3/21/2011 10:55 AM, ar...@bca-group.com wrote: I don't think I do this but I'm double-checking. Thanks. After writing to the OutputStream, should I just close the OutputStream which seems to generate a CometEvent.CLOSE or explicitly call event.close() after closing the stream? yes, explicitly call event.close Filip Thanks, Adam Caldarale, Charles Rchuck.caldar...@unisys.com 21/03/2011 15:47 Please respond to Tomcat Users Listusers@tomcat.apache.org To Tomcat Users Listusers@tomcat.apache.org cc Subject RE: Tomcat 6.0.32, Http11NioProtocol and log poll From: ar...@bca-group.com [mailto:ar...@bca-group.com] Subject: Tomcat 6.0.32, Http11NioProtocol and log poll Occasionally (like 0.1% of the time), when another web page in a second frame reloads (Independent JSP generated from SpringController in same container) the page loads with what appears to be the byte stream for the applet This is pretty much always caused by an application coding error: keeping request information at the wrong scoping level. For example, if you save anything about a specific request as a session attribute, other requests may accidentally use it or overwrite it, causing this kind of confusing. Keeping request-specific information in static fields is another typical example. Nothing absolutely rules out a Tomcat bug, but the odds are against it. - 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 This email and any attachments to it may contain confidential information intended for the addressee only. If you are not the intended addressee, you are strictly prohibited from disclosing, copying, distributing or using this email in any way. Unauthorised use of the information contained in this email is unlawful. If you have received this email in error please notify us on enquir...@bca-group.com and delete the email from your system. Information contained in this email can not be disclosed, copied, distributed or used in any way without the prior consent of the sender. Any opinions, advice or facts given in this email are given without warranty or the intention to enter into an agreement unless specifically stated and confirmed by agreement, letter or such other documentation signed by an authorised signatory of BCA Holdings Limited or any of its subsidiary companies. Any personal information contained in this email is strictly the view of the sender and is in no way authorised or attributable to BCA Holdings Limited or any of its subsidiary companies in any way. All emails through the company gateway are subject to monitoring. The company cannot be held liable for any errors or viruses contained in this message. BCA (438886) Headway House, Crosby Way, Farnham, Surrey GU9 7XG, England VAT registration number: GB 188 1552 38 # This e-mail message has been scanned for Viruses and Content and cleared by NetIQ MailMarshal # - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1498/3520 - Release Date: 03/21/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the right way to redirect http to https with tomcat 7 ?
On 3/14/2011 3:46 PM, János Löbb wrote: Hi, I set up ssl using the JAVA_HOME/bin/keytool on OSX 10.6.6 - JSSE type configuration with a self-signed certificate. Modified server.xml to include a connector: Connector port=8443 protocol=org.apache.coyote.http11.Http11Protocol SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=/Users/administrator/.keystore keystorePass=* clientAuth=false sslProtocol=TLS / anything else is the default, out of box. Where should I configure and how that when I hit http://localhost:8080 it should redirect to https://localhost:8443 make sure your connector 8080 has redirectPort=8443 in it, then in tomcat.home/conf/web.xml define a constraint, transport/confidential security-constraint web-resource-collection web-resource-nameEverything is https/web-resource-name url-pattern/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint ?? That is I do not want it to be web app specific, I want to have this behavior by default. I am not using httpd or mod_jk at this time and do not want to use if I can avoid them. Should I also add SSLEngine=on ?? Thanks ahead, János P.S. I looked the list from 2008 and see nothing in this regard. - 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: Cleaning up after tomcat jdbc-pool?
On 03/07/2011 06:46 PM, Nicholas Sushkin wrote: I don't think the default pool has any glaring leaks. However, your db may. I have ran into cases when Oracle would run out of PGA memory, which cleared with tomcat restart. It may help to use connection validation feature of tomcat's new pool to close connections that ran out of memory. Look at the maxAge property in http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html it is created just to deal with the database sessions that have memory leaks, and the leak is somewhat predictable timing wise best Filip Don't know if such a scenario has been tested. I am curious to hear. On Mar 7, 2011 10:46 AM, הילהhilavalen...@gmail.com wrote: Thanks :] Let's see if it'll somewhat help with the memory leak, or with memory management at all 2011/3/7 Filip Hanik - Dev Listsdevli...@hanik.com On 3/7/2011 3:48 AM, Mark Thomas wrote: On 07/03/2011 10:39, הילה wrote: I found this... - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSL on Apache 6.0.18 troubles
add SSLEnabled=true to your connector Filip On 3/8/2011 12:20 PM, Jacob Nyhart wrote: I am running Apache version 6.0.18 on a Windows 2003 server. Cannot go to 6.0.29 yet because of vendor/client requirements. I am attempting to setup SSL, but am not having any success and so I seek your help. My connector in my settings.xml file looks like this: Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS keystorePass= keystoreType=PKCS12 keystoreFile=path/to/my/pfx file / The pfx file was generated by exporting my certificate from the IIS on the same server. That cert was generated from our company’s internal CA (lower level environment). Now, here’s the problem… If I call my app like this: http://domain:8080 -- it works If I call my app like this: http://domain:443 – it works, but I don’t suspect this is SSL traffic since the browser doesn’t present any indication the traffic is secure. If I call my app like this: https://domain – it fails – reporting that IE cannot display the page. (the file being called is a *jsp file). The server is inside a firewalled DMZ, and I have confirmed with my network guys that the rule is open. In addition, I have tested this from the server itself, so firewall rules should not be an issue. The STDOut.log file and Windows Event Viewers are giving no indications as to what the problem is, the Tomcat appears to start fine, and APorts shows that Tomcat6 is listening on port 443. Any help would be appreciated. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cleaning up after tomcat jdbc-pool?
On 3/7/2011 3:48 AM, Mark Thomas wrote: On 07/03/2011 10:39, הילה wrote: I found this http://people.apache.org/~fhanik/tomcat/jdbc-pool.html that I see that it suits for tomcat 6 as well but I can't find tomcat-jdbc.jar for download, and I understood I need it to use the new pool. from where can I download it? You can download the iteration builds from http://people.apache.org/~fhanik/jdbc-pool/ That site has the latest doc as well Filip There is no download since that component has never been released. If you want to experiment with it then you'll need to build it from source. Mark Thanks Hila בתאריך 7 במרס 2011 12:28, מאת הילהhilavalen...@gmail.com: So it's only for use on Tomcat 7? I have installed tomcat 6.0.29 2011/3/7 Olivier Lefevrelefev...@yahoo.com On 3/7/2011 8:00 AM, הילה wrote: How do I know if I use the new pool? just by specifying the org.apache.tomcat.jdbc.pool.DataSourceFactory AFAICT yes. what is the advantages of using the new pool? in which cases should I use it? See http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html I guess that will be merged into the Tomcat docs eventually. -- O.L. - 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3486 - Release Date: 03/06/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cleaning up after tomcat jdbc-pool?
On 03/04/2011 02:04 PM, Olivier Lefevre wrote: Thanks! But this: factory=org.apache.tomcat.jdbc.pool.DataSourceFactory is the default, I believe. Didn't you say you were using something else? is not the default. org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory is default Filip -- O.L. - 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: Cleaning up after tomcat jdbc-pool?
hi Nicholas, where is your pool configured? In server.xml or in your application context? If it is configured in server.xml, then this is a bug, the thread should have been created with the class loader from the pool itself. If it is configured in the application context, then this simply means you forgot to call DataSource.close on the connection pool when your web application is stopped. best Filip On 3/2/2011 8:32 PM, Nicholas Sushkin wrote: Hi, Filip, Is there a recommended way to clean up after the pool? I am getting the following error message and I wonder if I need to add some code to prevent memory leak. 2011-03-02 22:20:20,786 ERROR [http-8081-1] org.apache.catalina.loader.WebappClassLoader - The web application [/…] appears to have started a thread named [[Pool-Cleaner]:Tomcat Connection Pool[19-2018147830]] but has failed to stop it. This is very likely to create a memory leak. Thanks. ps. Also, thanks for offering to open a Bugzilla enhancement request for setting password via JMX. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cleaning up after tomcat jdbc-pool?
On 3/3/2011 11:44 AM, Olivier Lefevre wrote: On 3/3/2011 5:17 PM, Filip Hanik - Dev Lists wrote: If it is configured in the application context, then this simply means you forgot to call DataSource.close on the connection pool when your web application is stopped. This is confusing advice because javax.sql.DataSource doesn't have a close() method. In order to call close, one has to cast it to what ever the data source you are using. That is why it's easier to define these types of resources as spring beans, since spring takes care of that for you Also, I have this element in my webapp context.xml Resource name=jdbc/AppDesignerDB auth=Container type=javax.sql.DataSource / and I don't get the error the OP reported. Are you both talking about something else? It will only start a thread if you have configured it to do clean up while running Filip Regards, -- O.L. - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3479 - Release Date: 03/03/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Exception in hibernate3 relating to timeout
Use a different connection pool that can properly handle your timeouts when idle. http://people.apache.org/~fhanik/jdbc-pool/ http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html Filip On 02/24/2011 11:31 PM, abhishek jain wrote: hi, I am not sure if i am ringing the correct list, but i am sure people here must have encountered this problem. I am new to hibernate and when i ran the code on server it was fine , strangely next day it keep on giving this error till i restart tomcat. The last packet successfully received from the server was 54,880,316 milliseconds ago. The last packet sent successfully to the server was 54,880,317 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. I have searched a lot on net and added the following properties on hibernate.cfg.xml, as people there were suggesting this,but of no use. !-- Sessions and transactions -- !-- Use the C3P0 connection pool provider -- property name=hibernate.c3p0.min_size5/property property name=hibernate.c3p0.max_size20/property property name=hibernate.c3p0.timeout300/property property name=hibernate.c3p0.max_statements50/property property name=hibernate.c3p0.idle_test_period3000/property property name=current_session_context_classthread/property Pl. help me. I have used hibernate3 with myeclipse as the development environment, and am using mysql 5.x and centos (Linux) with Tomcat 5.x - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Wildcard SSL import from IIS 6 to Tomcat 7?
Define not working. Do you get an error in the logs? Filip 'On 02/25/2011 10:24 AM, Carlton Whitmore wrote: I setup my SSL wildcard on IIS 6 and exported the cert file to some other IIS servers. Now I'd like to set it up on a Tomcat 7 server. This server already has a standard SSL cert running. I tried these instructions, but couldn't get it working. http://www.lazynetworkadmin.com/knowledgebase-mainmenu-6/2-windows/150-export-ssl-certificate-from-iis-and-import-into-tomcat Here is the SSL section from my server.xml file: Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=c:\certs\disabilityrightstx.pfx keystorePass=pass1 clientAuth=false sslProtocol=PKCS12/ Carlton. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Wildcard SSL import from IIS 6 to Tomcat 7?
I would change sslProtocol=PKCS12 to keystoreType=PKCS12 On 02/25/2011 11:10 AM, Carlton Whitmore wrote: Filip, When I try to access https://www.disabilityrightstx.org:8443 I get the standard Page can't be displayed message. Here is what I found in the Catalina logs: Feb 25, 2011 9:53:00 AM org.apache.catalina.startup.Catalina start SEVERE: Catalina.start: LifecycleException: Protocol handler initialization failed: java.io.IOException: PKCS12 SSLContext not available at org.apache.catalina.connector.Connector.startInternal(Connector.java:868) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:437) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: Friday, February 25, 2011 11:59 AM To: Tomcat Users List Subject: Re: Wildcard SSL import from IIS 6 to Tomcat 7? Define not working. Do you get an error in the logs? Filip 'On 02/25/2011 10:24 AM, Carlton Whitmore wrote: I setup my SSL wildcard on IIS 6 and exported the cert file to some other IIS servers. Now I'd like to set it up on a Tomcat 7 server. This server already has a standard SSL cert running. I tried these instructions, but couldn't get it working. http://www.lazynetworkadmin.com/knowledgebase-mainmenu-6/2-windows/150-export-ssl-certificate-from-iis-and-import-into-tomcat Here is the SSL section from my server.xml file: Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=c:\certs\disabilityrightstx.pfx keystorePass=pass1 clientAuth=false sslProtocol=PKCS12/ Carlton. - 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: Can datasource password be changed in jdbc-pool?
hi Nicholas, yes and no. You can change the password by simply doing DataSource ds = PoolConfiguration pcf = (PoolConfiguration)ds; pcf.setPassword(...); however, this change would only take into effect for newly created connections, and not the ones already in the pool. There is some needed support to refresh the pool with configuration changes. I will open a Bugzilla enhancement request, and we can get this implemented. best Filip On 02/22/2011 10:54 AM, Nicholas Sushkin wrote: Hi, I am checking out the new Tomcat's jdbc-pool. So far it's great. I like JMX monitoring feature. I searched lists and google for how to change database password in the JNDI data source and couldn't find anything. Can it be done? If not, then can JMX MBean be extended with an operation to set the password (write only)? Sometimes database passwords change while the application is deployed and it would've been nice to update the passwords without redeploying. Also, it would eliminate the need to store sensitive passwords in files. I am not sure what the security implications of being able to set the password is, but I think it's safe, since the JMX connection can be authenticated and secured. Thanks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Cluster Issue
It can probably be fixed, there are a few references to this http://www.techienuggets.com/CommentDetail?tx=355312 https://issues.jboss.org/browse/JGRP-777 I'd have to reproduce it, so that I can fix it/work around it. I will open a bugzilla item with this In the meantime, does this still happen if you remove the bind attribute? best Filip On 02/22/2011 04:02 PM, Bruce Pease wrote: Good Afternoon: I am running Windows server 2008 with Oracle/Sun jdk 1.6u24 and Tomcat 7.0.8. Windows server 2008 multicast is defaulted on. I am attempting to set up a cluster (config that currenly works in Windows server 2000 and tomcat 6), and getting the exception listed below. I haven't been able to find a configuration change from Tomcat 6 to 7 that might be causing this error. I have included the cluster configuration as well. Any assistance would be appreciated. Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=11 Manager className=org.apache.catalina.ha.session.DeltaManager expireSessionsOnShutdown=true notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.45 bind=10.103.4.70 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=10.103.4.70 port=4220 autoBind=100 selectorTimeout=100 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.MessageDispatch15Int erceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputIntercepto r/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;/ 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 Feb 22, 2011 5:48:11 PM org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal SEVERE: Unable to start cluster. org.apache.catalina.tribes.ChannelException: java.net.SocketException: An operation was attempted on something that is not a socket; No faulty members identified. at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoor dinator.java:178) at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator. java:99) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelIntercep torBase.java:150) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelIntercep torBase.java:150) at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.star t(MessageDispatchInterceptor.java:153) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelIntercep torBase.java:150) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelIntercep torBase.java:150) at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:416) at org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal(SimpleTcpCluster.ja va:671) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1026) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291 ) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:4 43) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at
Re: proxy:ajp 'client denied by server configuration' when too many simultaneous requests happen
Simplest to try first is the disablereuse flag http://httpd.apache.org/docs/2.2/mod/mod_proxy.html disablereuse On and if that solves the problem, you know that the problem with not enough threads on tomcat. (Could be from stale connections that are still holding a thread) Filip On 02/18/2011 12:24 PM, Fran Boon wrote: httpd error log: client denied by server configuration: proxy:ajp://localhost:8009/geoserver/gwc/service/wms This happens under 'high' load only: 1st few requests of a batch are answered but then they start dying - there are no bad URLs here. httpd snippet: ProxyPreserveHost on RewriteRule ^/geoserver/(.*)$ ajp://localhost:8009/geoserver/$1 [P] ProxyPassReverse /geoserver ajp://localhost:8009/geoserver/ LocationMatch ^(/[\w_]*/geoserver/.*) Order Allow,Deny Allow from all /LocationMatch I have tried these configuration options without any apparent difference: Proxy ajp://localhost:8009 ProxySet keepalive=On timeout=15 ttl=60 /Proxy Happens even with 'Allow from all' in proxy.conf (in fact nothing in that file makes any difference, presumably as it only affects Forward proxies. I have tried with both the default prefork MPM also the worker MPM. Back-end is GeoServer in Tomcat 6 (exactly same thing happened with 5.5) on Debian Squeeze 64-bit current Sun JVM. Nothing in the logs at the back-end, though, seems to be a problem with the Connector. Same thing whether or not using the 'APR based Apache Tomcat Native library 1.1.20' or not. I tried putting in a connectionTimeout into server.xml, but it makes no difference: Connector port=8009 protocol=AJP/1.3 redirectPort=8443 connectionTimeout=6 / Same with setting the minSpareThreads=32 maxThreads=256 to match those in apache.conf IfModule mpm_worker_module StartServers 2 MaxClients 256 MinSpareThreads 32 MaxSpareThreads 128 ThreadsPerChild 32 MaxRequestsPerChild 1024 /IfModule None of these tuning options seem to make much difference. Only web posts I've seen are the on/off conditions rather than erratic ones. Many thanks, for any suggestions :) Fran. - 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: proxy:ajp 'client denied by server configuration' when too many simultaneous requests happen
On 02/18/2011 02:42 PM, Fran Boon wrote: On 18 February 2011 20:19, Filip Hanik - Dev Listsdevli...@hanik.com wrote: Simplest to try first is the disablereuse flag http://httpd.apache.org/docs/2.2/mod/mod_proxy.html disablereuse On and if that solves the problem, you know that the problem with not enough threads on tomcat. (Could be from stale connections that are still holding a thread) Awesome - that makes it at least 10x more reliable! Still not perfect, but a massive improvement. Yes, it is also useful if you have more web servers than you have application servers. Any more suggestions on what I can do to clear the last errors generally how to approach this configuration? What errors? I'm not sure what you are referring too here? Since you've made changes to your environment, you may want to post more detail on what is going on now. (Apache Tomcat on the same physical server. Load isn't terribly high right now, but I'd like it to be able to scale. There is 2Gb RAM available (although this is shared with PostgreSQL which is tuned to think it has 1024 available for it) If they are on the same servers, I would leave the disablereuse On as the cost of a connection establishment is not as high as it would be over a network. Plan to scale out, meaning, as one box gets high in utilization, you should be able to add another box with another httpd/tomcat combo to balance your load. It requires some sort of load balancer in front of your web servers. (for software, I would look into http://haproxy.1wt.eu/) If your database gets saturated, you may want to look into data caching solutions, to lower the number of trips to the database. there are plenty of such solutions out there. In the extreme case, you'd get rid of the database and move to a distributed NoSQL solution. best Filip Many thanks :) Fran. Filip On 02/18/2011 12:24 PM, Fran Boon wrote: httpd error log: client denied by server configuration: proxy:ajp://localhost:8009/geoserver/gwc/service/wms This happens under 'high' load only: 1st few requests of a batch are answered but then they start dying - there are no bad URLs here. httpd snippet: ProxyPreserveHost on RewriteRule ^/geoserver/(.*)$ ajp://localhost:8009/geoserver/$1 [P] ProxyPassReverse /geoserver ajp://localhost:8009/geoserver/ LocationMatch ^(/[\w_]*/geoserver/.*) Order Allow,Deny Allow from all /LocationMatch I have tried these configuration options without any apparent difference: Proxy ajp://localhost:8009 ProxySet keepalive=On timeout=15 ttl=60 /Proxy Happens even with 'Allow from all' in proxy.conf (in fact nothing in that file makes any difference, presumably as it only affects Forward proxies. I have tried with both the default prefork MPMalso the worker MPM. Back-end is GeoServer in Tomcat 6 (exactly same thing happened with 5.5) on Debian Squeeze 64-bitcurrent Sun JVM. Nothing in the logs at the back-end, though, seems to be a problem with the Connector. Same thing whether or not using the 'APR based Apache Tomcat Native library 1.1.20' or not. I tried putting in a connectionTimeout into server.xml, but it makes no difference: Connector port=8009 protocol=AJP/1.3 redirectPort=8443 connectionTimeout=6 / Same with setting the minSpareThreads=32 maxThreads=256 to match those in apache.conf IfModule mpm_worker_module StartServers 2 MaxClients 256 MinSpareThreads 32 MaxSpareThreads 128 ThreadsPerChild 32 MaxRequestsPerChild 1024 /IfModule None of these tuning options seem to make much difference. Only web posts I've seen are the on/off conditions rather than erratic ones. Many thanks, for any suggestions :) Fran. - 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: Advantage of using HTTP NIO Connector
On 02/17/2011 08:11 AM, Mark Thomas wrote: On 17/02/2011 14:56, Afkham Azeez wrote: Hi folks, What is the advantage of using this connector as opposed to the default one? In which scenarios would we tend to use the default connector, and in which scenarios will it be more appropriate to use the NIO connector? NIO and APR use one thread per currently processing request. BIO uses one thread per connection. Since usually connections currently processing request, NIO and APR scale better. BIO has slightly better raw performance than NIO (excluding sendfile). It used to be only when nr-of-clientsnr-of-threads-in-pool. However, in tomcat trunk, BIO can handle keep alive on a large set of connections as well. APR and NIO support sendfile. APR has much better SSL performance. NIO supports non blocking SSL handshake, and thus can yield a better performance. NIO and APR support Comet, BIO does not. As with anything performance related, YMMV. The only way to be sure is to test it. There is a test to make each and every connector perform better. So as Mark said, the use case you're dealing with will determine what connector you use. If the application uses a lot of async javascript, then a non blocking connector may be preferred. Filip Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Replicate session-object after values in object has been changed
On 2/15/2011 1:04 PM, Thomas Andraschko wrote: Hmm not really but the tcp cluster with BackupManager would be enough (if it would check for modification). That can be easy, or hard :) If you know how to check for modification, then you can implement a simple filter that adds the attribute again best Filip The memcached manager is really a great idea and works great! I have only one issue. If you shutdown a memcached node, JSF pages can not be accessed anymore (a blank page will appear) and connection refused exceptions will be printed by tomcat. --- Martin Grotzkemartin.grot...@googlemail.com schrieb am Di, 15.2.2011: Von: Martin Grotzkemartin.grot...@googlemail.com Betreff: Re: Replicate session-object after values in object has been changed An: Tomcat Users Listusers@tomcat.apache.org Datum: Dienstag, 15. Februar, 2011 20:49 Uhr On Tue, Feb 15, 2011 at 11:08 AM, Thomas Andraschko tommygrass...@yahoo.de wrote: Thanks! i will give it a try! Is there also another manager available without using memcached? None that I'm aware of, but perhaps google will know more ;-) What do you have in mind btw? Is it especially memcached that you would like to have replaced by another backend? Cheers, Martin --- Martin Grotzkemartin.grot...@googlemail.com schrieb am Di, 15.2.2011: Von: Martin Grotzkemartin.grot...@googlemail.com Betreff: Re: Replicate session-object after values in object has been changed An: us...@tomcat.apache..org Datum: Dienstag, 15. Februar, 2011 01:27 Uhr memcached-session-manager detects session modification as you describe it. It's a custom session manager that keeps sessions (additionally) in memcached: http:// code.google.com/p/memcached-session-manager Cheers, Martin Thomas Andraschko wrote: Thanks for your answer. Yep that works but it isn't really nice if you are working with managed beans from JSF or other DI containers. Does other Servlet containers support this kind of replication or is it really the only way to put/remove the object to/from the session map? It is possible to develop a valve or interceptor to check specified entries in the session map and replicate them again? (sorry, i don't know the architecture very well) --- Mark Thomasma...@apache..org schrieb am Mo, 14.2.2011: Von: Mark Thomasma...@apache.org Betreff: Re: Replicate session-object after values in object has been changed An: Tomcat Users Listusers@tomcat.apache.org Datum: Montag, 14. Februar, 2011 19:09 Uhr On 14/02/2011 15:57, Thomas Andraschko wrote: Is it possible that Tomcat will automatically check the SessionMap entries after each request if any value in a entry has been changed? No. Tomcat adding or removing an object from the session will trigger replication. Modifying the object directly will not trigger replication. You can try re-adding the object to the session. That should trigger replication. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache..org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Replicate-session-object-after-values-in-object-has-been-changed-tp30923039p30927143.html Sent from the Tomcat - User mailing list archive at Nabble.com. - 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 -- Martin Grotzke http://www.javakaffee.de/blog/ - 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3445 - Release Date: 02/15/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how to refresh connection pool before it gets completely busy
What do you mean by refresh? best Filip On 2/1/2011 11:53 PM, Rhonny David wrote: Dear All, We are facing connection pool busy problem in tomcat 6.0.29. Till we finalize our investigation, we need connection pool to be refreshed before all connections get busy. Say for example if we have connection pool size 60, then it should get refresh when 15 connections get busy. We know that we cannot define connection pool should refresh after X connections get busy but we can at least define the timeout for an abandoned connections. We have tried this using the removeAbandonedTimeout property, but still its behaviour is that it refreshes the pool when all connections get busy. Following is the entry of our context.xml file: Resource factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory auth=Application removeAbandoned=true logAbandoned=true removeAbandonedTimeout=120 validationQuery=select 1 driverClassName=net.sourceforge.jtds.jdbc.Driver maxActive=60 maxIdle=20 maxWait=1 name=DB_Pool type=javax.sql.DataSource url=jdbc:jtds:sqlserver://10.22.4.30/XYZ / Can anyone help how we can achieve this , that connection pool refreshes before all connections get busy? Regards, David - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3417 - Release Date: 02/01/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with connections pool in Tomcat 6.0.18 6.0.20 + MySQL 5.1 + mysql-connector 5.1.x
Add in validationQuery and testOnBorrow as seen below Resource driverClassName=com.mysql.jdbc.Driver logAbandoned=false maxActive=35 maxIdle=2 maxWait=5000 name=jdbc/TheName password=password removeAbandoned=true removeAbandonedTimeout=60 type=javax.sql.DataSource url=jdbc:mysql://localhost:3306/schema username=user testOnBorrow=true validationQuery=SELECT 1/ On 01/27/2011 12:46 AM, Ramon Garcia Alarcon wrote: Hi all, I have a problem with: Tomcat 6.0.x + MySQL 5.1 + mysql-connector.5.1.x And I test with Ubuntu 10.04, Windows 2003 and Mac OSX 10.6.6 I configured the connection in tomcat like this: Resource driverClassName=com.mysql.jdbc.Driver logAbandoned=false maxActive=35 maxIdle=2 maxWait=5000 name=jdbc/TheName password=password removeAbandoned=true removeAbandonedTimeout=60 type=javax.sql.DataSource url=jdbc:mysql://localhost:3306/schema username=user/ In MySql I have good configured the wait_timeout and the interactive_timeout in 28800. The problem is that the pool never removes the connection and when the mysql closes it, I got this exception: java.sql.SQLException: Already closed Some idea? These configuration was worked properly in MySQL 4.1 and Tomcat 5.5.. Thanks! Ramon Garcia - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Form Authentication that requires no password for third party SSO
You could implement your own authenticator, extending the class org.apache.catalina.authenticator.AuthenticatorBase https://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java?view=markup protected abstract boolean authenticate(Request request, Response response, LoginConfig config) throws IOException; This would require a bit customization of Tomcat, but I would implement my own class, and my own authentication scheme Filip On 01/26/2011 11:10 AM, beau.hutche...@thomsonreuters.com wrote: Hello: I am trying to integrate my application with an SSO partner application. After successfully logging into the partner app, I will be redirected and only provided a username to log into my tomcat Form Authentication app. I am using a DataSourceRealm to check for both Users and User Roles. Are there any suggestions as to how I can still authenticate() through the tomcat container without providing a password? Thanks for your attention, Beau - 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 Form Authentication that requires no password for third party SSO
There is a file called Authenticators.properties, in there it maps what you specify in web.xml, to a specific authenticator. So you write your own authenticator, you add an entry into this file, change web.xml with your new auth-method tc server does not come with something like this best Filip On 01/27/2011 10:56 AM, beau.hutche...@thomsonreuters.com wrote: Filip: Thanks, I'll get going on my own authenticator right quick. Does tcserver come with something like this out of the box? Beau -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: Thursday, January 27, 2011 12:41 PM To: Tomcat Users List Subject: Re: Tomcat Form Authentication that requires no password for third party SSO You could implement your own authenticator, extending the class org.apache.catalina.authenticator.AuthenticatorBase https://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catal ina/authenticator/AuthenticatorBase.java?view=markup protected abstract boolean authenticate(Request request, Response response, LoginConfig config) throws IOException; This would require a bit customization of Tomcat, but I would implement my own class, and my own authentication scheme Filip On 01/26/2011 11:10 AM, beau.hutche...@thomsonreuters.com wrote: Hello: I am trying to integrate my application with an SSO partner application. After successfully logging into the partner app, I will be redirected and only provided a username to log into my tomcat Form Authentication app. I am using a DataSourceRealm to check for both Users and User Roles. Are there any suggestions as to how I can still authenticate() through the tomcat container without providing a password? Thanks for your attention, Beau - 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: Comet and multipart
On 1/4/2011 1:26 AM, sol myr wrote: Filip, thanks for your reply. You are correct that the server simply writes data, which we can format any way we like. However, we were wondering whether Tomcat has any utilities/configurations to make it easier. E.g: 1) If we use multipart format (to separate between messages), does Tomcat/Apache have utilities to make it easier? Or should we hand-code the appropriate headers, separators, etc? Not in Tomcat 6. The risk of using any utilities out there, is that they will want to block on inputstream.read until the entire request body has been read, and I suspect that's not what you want. 2) If we rely on Content-length: (to tell when one message ends and another begins), this header is usually automatically managed by Tomcat, so we'd have to ask Tomcat to manage it differently (otherwise, it might calculate one content-length for all messages put together, or it might omit it altogether and use chunked instead - which is also be an option, but then how do we tell tomcat to have a chunk per message). I would not use Content-Length, by doing so, you're setting a limit to yourself on how long the Comet request is alive best Filip Thanks again --- On Mon, 1/3/11, Filip Hanik - Dev Listsdevli...@hanik.com wrote: From: Filip Hanik - Dev Listsdevli...@hanik.com Subject: Re: Comet and multipart To: Tomcat Users Listusers@tomcat.apache.org Date: Monday, January 3, 2011, 8:47 AM On 1/3/2011 7:48 AM, sol myr wrote: Hi, We're implementing a CometServlet on top of Tomcat NIO connector, using long polling. Currently we're using the approach recommended by most tutorials: the client opens a connection and waits for a message (for a configured timeout); if such a message arrives, the client consumes it (e.g. presents it on screen), then *closes* the http connection, and opens a new connection (to wait for the next message). Unfortunately, we have a network performance problem with opening and closing connections (our 3rd party proxy is good at keeping connections alive, but is slow in negotiating new connections). So we'd like to keep the HTTP connection alive, and pass multiple messages on the same connection. We were hoping to tell the messages apart based on multipart format, or some other separator, or content length. Could anyone please tell whether that's supported on the TomcatServlet side? yes, it is supported, as long as your client knows how to do it. On the server/servlet side, all you do is read the input stream byte by byte you can create any type of protocol rules inside the HTTP message that it sends up best Filip - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1191 / Virus Database: 1435/3357 - Release Date: 01/03/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Comet and multipart
On 1/3/2011 7:48 AM, sol myr wrote: Hi, We're implementing a CometServlet on top of Tomcat NIO connector, using long polling. Currently we're using the approach recommended by most tutorials: the client opens a connection and waits for a message (for a configured timeout); if such a message arrives, the client consumes it (e.g. presents it on screen), then *closes* the http connection, and opens a new connection (to wait for the next message). Unfortunately, we have a network performance problem with opening and closing connections (our 3rd party proxy is good at keeping connections alive, but is slow in negotiating new connections). So we'd like to keep the HTTP connection alive, and pass multiple messages on the same connection. We were hoping to tell the messages apart based on multipart format, or some other separator, or content length. Could anyone please tell whether that's supported on the TomcatServlet side? yes, it is supported, as long as your client knows how to do it. On the server/servlet side, all you do is read the input stream byte by byte you can create any type of protocol rules inside the HTTP message that it sends up best Filip If so, could you please refer me to the appropriate documentation? In particular, is there some flag (on Tomcat or CometServlet) telling it to support multipart? Thanks :) - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1191 / Virus Database: 1435/3355 - Release Date: 01/02/11 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session replication question
make sure your clocks are synced across all machines, since session expiration is time based Filip On 12/23/2010 8:22 AM, Jorge Santiago Cruz Lambert wrote: Hi! I'm not an expert on Tomcat and we purchase a load balancer service with two tomcat 6.0.29 instances in separate Ubuntu servers with JVM version 1.6.0_22-b04. This instances have been configured to replicate the session as follow: Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 channelStartOptions=3 Manager className=org.apache.catalina.ha.session.DeltaManager expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=4001 autoBind=100 selectorTimeout=5000 maxThreads=10/ 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.StaticMembershipInterceptor Member className=org.apache.catalina.tribes.membership.StaticMember port=4000 securePort=-1 host=xxx.xxx.xxx.xxx domain=tomcat-cluster uniqueId={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}/ /Interceptor Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;/ 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 The balancer has a sticky session feature that makes persistent connections for 300s and its balancing algorithm is least connections. The problem is when trying to connect to load balancer with a device that changes its IP each request, it looks like session is not replicated and in some cases we can see the session id in the manager but with empty attributes. We have our application distributable, sessions are Serializable and we tried to change as previously I read in this list, the channelSendOptions from 8 (Asynchronous) to 6, and in this way we stopped the SEVERE messages from catalina saying something like: SEVERE: Manager [localhost#]: Unable to receive message through TCP channel java.lang.IllegalStateException: setAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1326) at org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:594) at org.apache.catalina.ha.session.DeltaRequest.execute(DeltaRequest.java:164) at org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1487) at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1437) at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1171) at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:92) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:901) at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:882) 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.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79) at
Re: Tomcat 6.0.18 related NIO questions.
hi shrikant, there are many benefits of NIO in a tomcat 6, the main being there is no longer a thread-per-connection limit. Note in Tomcat 7, even with the blocking connector, you can have more connections than threads. The NIO connector will read your request headers in a non blocking fashion, it will also do SSL negotiation in a non blocking fashion, so while this is taking place, you're not holding a thread waiting for a client response. Same thing, if you use send file, then the NIO connector can download a file to more than one client using a single thread. However, as soon as you enter a the HttpServlet.service method, all non blocking benefits are gone. Per the servlet specification, the same thread is used executing this method, and that means, blocking. Even if you do inputstream.read or outputstream.write, and you use the NIO connector, tomcat blocks these calls for you. In Tomcat 7 (Servlet 3.0) you will be able to do a bit more async stuff using the async API, but in Tomcat 6, those features only exists using the Comet interface. best Filip On 12/22/2010 9:31 AM, shrikant patel wrote: We are using tomcat connector as follows -- Connector connectionTimeout=50 port=8080 protocol=HTTP/1.1 ... Based on the documentation we are using the blocking call, right? So the servlet thread is blocked for IO while reading request and writing response. In case we want to use NIO, we have to specify protocol as org.apache.coyote.http11.Http11NioProtocol - non blocking Java connector, org.apache.coyote.http11.Http11AprProtocol - the APR connector. I have basic understanding of NIO. My understanding is that tomcat internally use Java NIO to read the request into buffer. When complete request is read then dispatch it to servlet for processing. That way each servlet thread is not blocked on IO. Similarly in case of response, it get response from servlet, keep buffering it and send it to client. This way servlet is not completely blocked for entire duration of the response being send to client. Please let me know if this is correct. Is there document in this regards you can point to get better understanding? I have googled, i do get many article but about NIO in general nothing specific to how tomcat handles it. Thanks in Advance. Shri - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 1435/3329 - Release Date: 12/21/10 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: unable to configure SSL in Tomcat 7.0
I'd definitely consider it a bug if tomcat continues startup in HTTP mode instead, when the file is not found. Filip On 12/22/2010 3:35 PM, Pid * wrote: On 22 Dec 2010, at 18:07, Ajay TSajayts1...@gmail.com wrote: I am new to Tomcat and am trying to install Apache Tomcat 7.0.5 on Windows 7 with java version 1.6.0_21. I am able to install it fine but unable to configure SSL. I am configuring it on port 8443 based on documentation provided. After configuration and restarting the Apache Tomcat 7 service I am able to connect tohttp://localhost:8080 but not to https://localhost:8443. Strangely http://localhost:8443 works fine Connector information: Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=true disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=${user.home}/.keystore keystorePass=changeit / Attached is the error catalina file but heres the line I am confused about: Dec 22, 2010 9:35:35 AM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore SEVERE: Failed to load keystore type JKS with path C:\Windows\System32\config\systemprofile/.keystore due to C:\Windows\System32\config\systemprofile\.keystore (The system cannot find the file specified) java.io.FileNotFoundException: What's not clear about the above? You told Tomcat where to look for the keystore file, and it's not there. Put the real path to the keystore in the attribute instead. p C:\Windows\System32\config\systemprofile\.keystore (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(Unknown Source) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:382) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:283) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:533) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:464) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:131) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:384) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:118) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:555) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:729) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:548) at org.apache.catalina.startup.Catalina.load(Catalina.java:571) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:430) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session replication with multicast
On 11/26/2010 06:36 AM, Guillaume HERAIL wrote: Hi, OS : Debian lenny Tomcat : 7.0.2 JRE : 1.6.0_21 I have a problem trying to clusterize two tomcat on two different boxes. I want to use the MemberShip's argument bind to tell to tomcat wich interface to use but i get an exception : http://paste.geeknode.org/22a07ecb (where bind=192.168.0.1 and 192.168.0.2 respectively). IIRC, linux doesn't support bind for multicast sockets Filip Here is my Cluster block : http://paste.geeknode.org/4cf7af8f If anyone has a clue... Thanks, - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session replication with multicast
alternatively, try to add -Djava.net.preferIPv4Stack=true to your JVM args On 11/26/2010 06:36 AM, Guillaume HERAIL wrote: Hi, OS : Debian lenny Tomcat : 7.0.2 JRE : 1.6.0_21 I have a problem trying to clusterize two tomcat on two different boxes. I want to use the MemberShip's argument bind to tell to tomcat wich interface to use but i get an exception : http://paste.geeknode.org/22a07ecb (where bind=192.168.0.1 and 192.168.0.2 respectively). Here is my Cluster block : http://paste.geeknode.org/4cf7af8f If anyone has a clue... Thanks, - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Issue with clustering
try upgrading On 05/04/2010 08:24 AM, Marc Wilmots wrote: Hi List, Since a few weeks now, I started to notice in the catalina.out log file messages regarding the cluster's operatability. It reports that a member or members in my cluster have disappeared, and appeared (member still alive) again. That's reasonable...the strange thing is that they occur at exactly the same time. Sometimes this message appears several times in a minute, and sometimes it doesn't appear for several minutes. I'm using Tomcat 6.0.18 with JDK 1.6.0_14 64bit on RedHat Linux 5.2. I'm thinking about several posibilities here, as for example a bad switch or something. Although, the thing is, I have other Tomcat instances in the same network that do not show this behavior. I would really apreciate it if someone could shed a light on what I can investigate next. As an example, I paste some output from my log: Apr 29, 2010 1:43:31 PM org.apache.catalina.tribes. group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -36}:4003,{10, -68, 4, -36},4003, alive=23576482,id={17 96 -31 30 -112 76 73 -38 -87 6 -74 21 -124 117 18 -66 }, payload={}, command={}, domain={}, ]] message. Will verify. Apr 29, 2010 1:43:31 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -36}:4003,{10, -68, 4, -36},4003, alive=23576482,id={17 96 -31 30 -112 76 73 -38 -87 6 -74 21 -124 117 18 -66 }, payload={}, command={}, domain={}, ]] Apr 29, 2010 1:47:59 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Member send is failing for:tcp://{10, -68, 4, -37}:4003 ; Setting to suspect and retrying. Apr 29, 2010 1:47:59 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:47:59 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:48:01 PM org.apache.catalina.ha.tcp.SimpleTcpCluster memberDisappeared INFO: Received member disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=23477210,id={96 77 36 -51 -85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ] Apr 29, 2010 1:48:01 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector performBasicCheck INFO: Suspect member, confirmed dead.[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=23477210,id={96 77 36 -51 -85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ]] Apr 29, 2010 1:48:08 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51 -85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ]] message. Will verify. Apr 29, 2010 1:48:08 PM org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51 -85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ]] Apr 29, 2010 1:48:08 PM org.apache.catalina.ha.tcp.SimpleTcpCluster memberDisappeared INFO: Received member disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -68, 4, -37}:4003,{10, -68, 4, -37},4003, alive=24454627,id={96 77 36 -51 -85 -17 67 -53 -107 -22 9 77 -71 78 -106 -112 }, payload={}, command={}, domain={}, ] Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Member send is failing for:tcp://{10, -68, 4, -37}:4003 ; Setting to suspect and retrying. Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not retrying send for:tcp://{10, -68, 4, -37}:4003; Sender is disconnected. Apr 29, 2010 1:48:09 PM org.apache.catalina.tribes.transport.nio.ParallelNioSender doLoop WARNING: Not
Re: Tomcat 6.0 clustering problem with replication mode.
The first error java.util.ConcurrentModificationException happens cause the membership changed in between. The error logs, but the system is not interrupted. The second error java.net.SocketTimeoutException: Read timed out This means the node failed to respond. This means you got a problem. You should post - your exact tomcat version - your configuration - your jvm version best Filip On 04/14/2010 05:01 AM, Pardeep Ruhil wrote: Hi, We are running our application in load balanced mode in Tomcat 6.0 with session replication. When we are starting the servers in load balanced mode, then in the console we are getting the following error : 2010-04-14 11:47:51,078 (main) [ VfsLog.java:122:INFO ] Using C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\vfs_cache as temporary files store. 2010-04-14 11:48:05,140 (GroupChannel-Heartbeat-1) [ GroupChannel.java:665:ERROR] Unable to send heartbeat through Tribes interceptor stack. Will try to sleep again. java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at org.apache.catalina.tribes.group.GroupChannel.heartbeat(GroupChannel.java:152) at org.apache.catalina.tribes.group.GroupChannel$HeartbeatThread.run(GroupChannel.java:661) class org.webslinger.commons.vfs.flat.FlatFileProvider 2010-04-14 11:48:09,937 (main) [ ChannelSocket.java:387:INFO ] JK: ajp13 listening on /0.0.0.0:8009 2010-04-14 11:48:09,984 (main) [ JkMain.java:344:INFO ] Jk running ID=0 time=16/78 config=null 2010-04-14 11:48:10,125 (main) [ Http11Protocol.java:209:INFO ] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080 When we are testing 100 concurrent users using JMeter, it is giving following error after 5-10 mins. 0-04-14 09:46:10,703 (GroupChannel-Heartbeat-1) [ BioSender.java:287:WARN ] Unable to read acknowledgement from [/192.168.1.3:1,93 a.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.net.SocketInputStream.read(SocketInputStream.java:182) at org.apache.catalina.tribes.transport.bio.BioSender.waitForAck(BioSender.java:263) at org.apache.catalina.tribes.transport.bio.BioSender.pushMessage(BioSender.java:245) at org.apache.catalina.tribes.transport.bio.BioSender.sendMessage(BioSender.java:125) at org.apache.catalina.tribes.transport.bio.MultipointBioSender.sendMessage(MultipointBioSender.java:52) at org.apache.catalina.tribes.transport.bio.PooledMultiSender.sendMessage(PooledMultiSender.java:51) 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.TcpFailureDetector.sendMessage(TcpFailureDetector.java:87) 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.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) 0-04-14 09:46:13,718 (GroupChannel-Heartbeat-1) [AbstractReplicatedMap.java:795:ERROR] Unable to send AbstractReplicatedMap.ping message .apache.catalina.tribes.ChannelException: java.net.SocketTimeoutException: Read timed out; Faulty members:tcp://{-64, -88, 1, 3}:4001; at org.apache.catalina.tribes.transport.bio.MultipointBioSender.sendMessage(MultipointBioSender.java:54) at org.apache.catalina.tribes.transport.bio.PooledMultiSender.sendMessage(PooledMultiSender.java:51) at org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(ReplicationTransmitter.java:80) at org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelCoordinator.java:78) at
Re: Tomcat on AIX 5.3
you'd have to figure out what takes the time. Could be anything, including a DNS timeout Filip On 04/14/2010 08:34 AM, János Löbb wrote: Hi, I installed Tomcat 6.0.26 in an IBM P6 LPAR . The java version is 1.5.0 that is equivalent to Java 5. The LPAR has 12G memory and there are two databases on it, a Sybase and a MySql. Sybase takes 3 G and mysql takes 3 G, so there is still plenty for Tomcat. The idea to put Tomcat here, was, that the webapp is connecting to the Sybase database on this LPAR, so getting the data locally should be faster than getting it via the network from another machine running Tomcat. Interestingly it is not the case. When the same webapp deployed on the LPAR and on the other machine - an OSX Server 10.5.8 -, the screens on a client machine are coming much faster from the OSX server compared to the AIX LPAR. Is there anything special configuring Tomcat on AIX than on OSX ? On both machines the memory settings are the same for tomcat : CATALINA_OPTS=-server -Xms512M -Xmx1024M and on AIX the option to use the IPv4 Stack is set in JAVA_OPTS. None of the .xml files were modified in the conf directory. 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: Hung threads
Looks like just idle threads, not really a problem If you want the thread pool to shrink and stop idle threads, use an Executor element in server.xml Filip On 04/13/2010 08:50 AM, Jeffrey Janner wrote: Before someone asks for it: Connector address=172.16.27.1 port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=5 maxSpareThreads=75 enableLookups=false acceptCount=100 connectionTimeout=2 disableUploadTimeout=true compression=on compressableMimeType=text/html,text/xml,text/plain,text/css,text/csv,te xt/javascript,text/rtf,text/richtext scheme=https secure=true clientAuth=false SSLEngine=on SSLCertificateFile=path_to_server.crt SSLCertificateKeyFile= path_to_server.key SSLCertificateChainFile=path_to_server_chain.crt SSLPassword=changeit / -Original Message- From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] Sent: Tuesday, April 13, 2010 9:44 AM To: Tomcat Users List Subject: Hung threads I had a connector go from minimal connections (restart) to all threads hung overnight. The current thread dump shows the threads as follows: http-172.16.27.1-443-150 daemon prio=6 tid=0x66793800 nid=0xe43c in Object.wait() [0x7063f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on0x1a924f00 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at java.lang.Object.wait(Object.java:485) at org.apache.tomcat.util.net.AprEndpoint$Worker.await(AprEndpoint.java:125 5) - locked0x1a924f00 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1280) at java.lang.Thread.run(Thread.java:619) http-172.16.27.1-443-149 daemon prio=6 tid=0x6496d400 nid=0xe400 in Object.wait() [0x705ff000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on0x1a954140 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at java.lang.Object.wait(Object.java:485) at org.apache.tomcat.util.net.AprEndpoint$Worker.await(AprEndpoint.java:125 5) - locked0x1a954140 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1280) at java.lang.Thread.run(Thread.java:619) http-172.16.27.1-443-148 daemon prio=6 tid=0x6496f400 nid=0xe3b0 in Object.wait() [0x705bf000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on0x1a8655f0 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at java.lang.Object.wait(Object.java:485) at org.apache.tomcat.util.net.AprEndpoint$Worker.await(AprEndpoint.java:125 5) - locked0x1a8655f0 (a org.apache.tomcat.util.net.AprEndpoint$Worker) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1280) at java.lang.Thread.run(Thread.java:619) and so on. Other connectors are running OK, though some also show threads in the same state. All other threads look normal. This has one customer's app hung, but others in the Tomcat instance are working just fine. Any help on where to start looking here? Server Details: Windows 2000 SP4, Sun JDK 1.6.0_18, Tomcat 5.5.17, native libs 1.1.18. Waiting for TC 5.5.29 before upgrading due to bugs with APR/SSL in 5.5.28. Jeff *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination,
Re: Tomcat NIO : CometProcessor
you're wrong, I believe it is chunk-header:blablaCRLF chunk-dataCRLF The spec says chunk = chunk-size [ chunk-extension ] CRLF chunk-data CRLF Hence, the request that was posted here, should have been 16bytes header, not 18 Filip On 04/01/2010 11:23 AM, Michael Wojcik wrote: Filip Hanik - Dev Lists wrote: I just skimmed this through, but from what I remember, the CRLF after /xml should not be counted into your chunk header No, the chunk-size is the entire length of the chunk. Since a chunked content-body can include any sort of data, it wouldn't make sense to exclude trailing whitespace characters - the content might not be of a type where whitespace characters were defined. See RFC 2616 3.6.1: chunk-data = chunk-size(OCTET) There must be exactly as many octets as specified in chunk-size. What I don't see in the trace are the zero-size chunks that terminate the chunked content-bodies. In frame 12, the client closes the connection (sends a FIN); that would appear to be why Tomcat is reporting the client closed the connection. Of course this is only a half-close, and the server *could* still send a response, but RFC 2616 doesn't acknowledge the half-close mechanism in TCP. From 4.4: 5.By the server closing the connection. (Closing the connection cannot be used to indicate the end of a request body, since that would leave no possibility for the server to send back a response.) This is, depending on your viewpoint, an error, oversight, or restriction in HTTP; but in effect it means that if the client closes its end of the conversation after sending a request but before receiving a response, the the server is free to consider the connection closed (even though it isn't) and discard the request. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat NIO : CometProcessor
hi Chris, if the connection is closed, most likely there is some sort of data error somewhere. Record your transaction with Wireshark, and we can examine it. Low latency http, meaning sending traffic back and forth should be possible within the body of the request Filip On 03/31/2010 07:01 AM, Christian Pfeiffer wrote: Hello, I just tried to use the tomcat nio and wondered if it is possible to use client and server pushes through the same socket connection? Or if I have to establish to connections for that purpose. In the end the client should be able to receive notification from server (server push) and also be able to request certain things. As I understood the Low Latency HTTP document it should be possible. Has anyone any advice for me, currently the connection gets closed after the second request from client with error CLIENT_DISCONNECTED. Thanks in advance Chris. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat NIO : CometProcessor
I would need the raw data, not copy paste, I can't make anything out of that. Or if you have, a simple test case. Filip On 03/31/2010 07:57 AM, Christian Pfeiffer wrote: Hey Filip, thanks for your swift response. Wireshark tells me: //Client// POST /url/servlet HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13 Transfer-Encoding: chunked 145 some xml/some xml //Server// HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=F9A0B9BAB695EDB6C51253A24D8989D9; Path=/streamcam_gwt Transfer-Encoding: chunked Date: Mon, 29 Mar 2010 15:44:25 GMT 9a some answer/some answer //Client// 8E second xml/second xml beside the hex values which are not set properly, cause I changed the xml for the sake of simplicity it should be fine right? Or do I miss something? BTW the last message(second xml) isnt examined by my servlet, there I already receive event Client_Disconnected instead of a read I expected. Let me know if you need more information. Thanks in advance Chris. Filip Hanik - Dev Lists schrieb: hi Chris, if the connection is closed, most likely there is some sort of data error somewhere. Record your transaction with Wireshark, and we can examine it. Low latency http, meaning sending traffic back and forth should be possible within the body of the request Filip On 03/31/2010 07:01 AM, Christian Pfeiffer wrote: Hello, I just tried to use the tomcat nio and wondered if it is possible to use client and server pushes through the same socket connection? Or if I have to establish to connections for that purpose. In the end the client should be able to receive notification from server (server push) and also be able to request certain things. As I understood the Low Latency HTTP document it should be possible. Has anyone any advice for me, currently the connection gets closed after the second request from client with error CLIENT_DISCONNECTED. Thanks in advance Chris. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - 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 NIO : CometProcessor
On 03/31/2010 09:29 AM, Christian Pfeiffer wrote: 31 32 Let's take a look at the data you are sending 0040 36 17 31 32 0d 0a 3c 78 6d 6c 3e 48 65 6c 6c 6f 6.12..xmlHello 0050 3c 2f 78 6d 6c 3e 0d 0a /xml.. Your Chunk header: 31 32 That represents : 12 Which means, Tomcat will expect 18 bytes after the 0d 0a The data you send: 0040 3c 78 6d 6c 3e 48 65 6c 6c 6f xmlHello 0050 3c 2f 78 6d 6c 3e /xml I count 16 bytes. I just skimmed this through, but from what I remember, the CRLF after /xml should not be counted into your chunk header Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[ANN] New Tomcat Committer: Keiichi Fujino (kfujino)
On behalf of the Tomcat committers I am pleased to announce that Keiichi Fujino (kfujino) has been voted in as a new Tomcat committer. Please join me in welcoming him. Regards, Filip - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Proposal : Enhancing docs for RemoteIpValve and RemoteIpFilter
simply open a bugzilla ticket and attach your patch there Filpi On 03/30/2010 09:02 AM, Cyrille Le Clerc wrote: Dear all, I would be very happy to enhance the docs of the RemoteIpValve (1) and the RemoteIpFilter (2) if the project is interested. I was thinking about adding sample to explain * the difference between the internal proxies list and the trusted proxies list, * how to handle https requests with x-forwarded-proto header, * what are the values of x-forwarded-for and x-forwarded-by headers Many samples are already available in the javadocs (3), I would be very happy to adapt them to the docs. Please let me know if this proposal is interesting. Cyrille -- Cyrille Le Clerc clecl...@xebia.fr (1) http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote IP Valve (2) will be available in Tomcat 7 in /config/filter.html (3) http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html - 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: Channel.SEND_OPTIONS_SECURE
On 03/23/2010 09:46 AM, Tom wrote: On Tue, Mar 23, 2010 at 1:58 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Tom [mailto:808...@gmail.com] Subject: Session replication: Channel.SEND_OPTIONS_SECURE There is little documentation about Channel.SEND_OPTIONS_SECURE From a brief glance at the code, SEND_OPTIONS_SECURE appears to be defined, but not yet implemented - which would explain the behavior you observe. Thanks, that is what I feared. I think for our needs a crossover cable or tunnel will be sufficient. I am also interested in SEND_OPTIONS_BYTE_MESSAGE. Can anyone elaborate on the pros/cons other than speed? only pros, since you get to control all the class loading and how it happens. otherwise, you have to build some block on top of the channel that does the class loading for you Regards, Tom - 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: jndi global look up questions
On 03/18/2010 07:05 AM, Caldarale, Charles R wrote: From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Subject: Re: jndi global look up questions What do you mean by global JNDI access. Judging from the example code supplied by the OP, he or she wants a kludge in Tomcat to so that it presumes the presence of the java:comp/env prefix. If we can believe the original message, it appears that WebSphere allows sloppy, non-spec-compliant programming to get away with this. almost all app servers allows access to the global jndi registry, the resource link is a pain in the rear very often :) - 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: question on tribes member alive time
On 03/11/2010 01:46 AM, Eddie Hsiung wrote: Hi I'm trying to debug a vendor product which uses Apache Tribes as its cluster communication implementation. I've identified that each member of the cluster derives the master node instance using the aliveTime field of all members of the cluster. The member with the largest aliveTime is elected to be the master node. I would not recommend using aliveTime as the elector for master node. The reason for that is cause if the network is busy, then multicast packets can be delayed or dropped all together. So you could end up with masters changing constantly. Instead, Tribes already defines an absolute ordering algorithm http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/AbsoluteOrder.java?view=log I would suggest using this for the simplest possible master election One thing I notice is that local member aliveTime is only updated when McastService.getLocalMember() is called while (remote) member aliveTime is updated constantly (by a separate thread?). Is this observation correct? If so, does this mean that using aliveTime to elect a master node might run into race conditions if it wasn't implemented carefully? For example, remote member aliveTime is always more up-to-date than the local member alive time. Assuming two members of the cluster started almost at the same time, It's possible that they always think the other member is alive longer (if the remote aliveTime is updated before local aliveTime) and, therefore, think the other member is the master node. Thanks for any clarification on the subject. eddie - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Comet event.setTimeOut Bug!! Still no answer
once a timeslot for free support opens up, I will answer :) Filip On 03/09/2010 12:24 AM, Animesh Sonkar wrote: Hi, I am not sure why my previous mail was not answered? I hope that i will get the reply this time So here is the same query again... Was curious what event.setTimeOut(timeOutValue) means on a comet event. 1. Does it mean that the request will timeout after timeOutValue and the server will close the connection and call the END event. I am trying to establish a persistent connection for asynchronous message delivery using comet. I create a chunked request (using socket) send HTTP POST with content. Then create thread which reads from the socket outputstream. On the server side on a comet event for the POST request 1. I set the event timeout to timeOutValue 2. Create a new thread passing the request,response and event 3. The event method of CometProcessor returns. Observations: 1. If there is no activity on the response object (i.e no data is sent) and if the comet client does not send any chunked data to the sever for timeOutValue + 1 an END event is called by the server. 2. To prevent the calling of END event in Observation 1. i send a chunked data from the client for every inactive interval of (timeOutValue -1) [Heartbeat kind of mechanism]. In this case every time i send a heartbeat, the event method on the server is triggered and event.setTimeOut is called again. This prevents the server from calling the END event of the request and my asynch message delivery from the thread i created runs fine and no END event is called Now from observation 2 what i found is as below: a. Every time event.setTimeout is called for the same http request (can be done for a chunked request sending some chunked data) the request timeout increases to (number of time event.setTimeOut is called) * (timeOutValue) I.e on consequetive calls to event.setTimeOut the timeout value is increased to (newtimeOutValue =oldTimeOutValue + timeOutValue) 1. Is this a bug in Comet? Or is this the desired behaviour? 2. What is the exact role of event.setTimeOut in case of normal request and in case of chunked request in which chunked data can be sent again and again? 3. For the asynch message delivery using comet as mentioned above is it required to refresh the connection after some inactive time,probably the timeOutValue? If yes, how can we assure that the END event is never called for this request, considering my applications lifetime for message delivery is the lifetime of the server once the thread is started. Thanks, Animesh - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: ReplicationValve filter ...
The idea behind the ReplicationValve filter is to save time and do not check for session changes for certain URL's. However, it takes about the same time to check if the session has changed as to go through the filter, so you can leaveit empty best Filip On 02/25/2010 06:43 AM, Stephane Lorin wrote: Hi, I’d just configure a tomcat’s cluster with two nodes. The version of Tomcat is 6.0.24 with JRE 6.0.15 on Ubuntu 9.10. Cluster’s part of my “Server.xml”: 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=192.168.1.108 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.MessageDispatch15In terceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*index.*;/ 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 Clustering connection work well and I see members appear or disappear in the log file. Log node 1: INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl 25 févr. 2010 14:35:42 org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 1, 108}:4000,{192, 168, 1, 108},4000, alive=1019,id={93 73 -36 -95 -25 79 67 32 -89 30 -119 95 -9 24 87 -24 }, payload={}, command={}, domain={}, ] Log node 2: INFO: Starting clustering manager at /SessionListener 25 févr. 2010 14:35:45 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions ATTENTION: Manager [/SessionListener], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 1, 115}:4000,{192, 168, 1, 115},4000, alive=57336,id={35 -70 -95 77 106 -12 71 31 -111 47 -36 105 30 78 -58 60 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. 25 févr. 2010 14:35:45 org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions INFO: Manager [/SessionListener]; session state send at 25/02/10 14:35 received in 120 ms. I’d just have any questions regarding filter of replication valve. The filter receive java regular expressions and keep out all object corresponding with filter, Can I use expression “^[.*specific_folder.*];” as filter for limited the replication of data to a little part of application where was deployed in a specific folder ? And when object must be keep out, send tomcat a replicated session empty or don’t send a session ? Thank you for your work, it’s very precious for noob like me :-) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: NioConnector limits and comet requests
On 02/23/2010 10:09 PM, James Roper wrote: Hi, I'm trying to understand how the Tomcat 6.0 NIO connector handles the various limit attributes in the configuration, particularly in regards to comet requests. I've had a look at the source code, and I think I understand, but I'd like to confirm my understanding, and also ask some further questions. The acceptCount works just like it does on the other processors, it gets passed to the ServerSocket as the backlog parameter. This limit will be reached if the acceptor thread(s) aren't able to accept new requests quickly enough. This is where behaviour differs from the default HTTP connector, all the acceptor threads do is add the channel to a poller which uses the NIO selectors to wait on activity, and then return quickly. As far as I can see, the number of active selectors can be unlimited, is that right? Would there be any advantages in limiting this? What would happen if such a limit was reached? On the default HTTP connector though, when new requests arrive, the handler will block until it can get a free worker thread, so the acceptCount limit could easily be reached. In order to reach the acceptCount limit in the NIO connector, the server would have to be under a massive amount of load, such that the accept thread never gets scheduled to accept new connections. This would be a difficult limit to reach, so the acceptCount is possibly not a very useful parameter for the NIO connector. The maxThreads is the maximum number of worker threads, this is pretty straight forward, these threads do the actual work of the requests, eventually calling some servlet service() or comet processor event() method. There is another pool for comet requests, this is the connections map in the NIO connector. This is unlimited, and it's used to store all comet requests that are not currently being processed by a worker thread. Would there be any advantages to limiting this? What would happen if such a limit was reached? The poller threads just select on all the active channels, and hand work off to the worker threads. The number of threads allowed in this pool enforce no limits on concurrent requests. So, if my understanding of all this is correct, I can fire thousands/millions of requests at the example code in http://tomcat.apache.org/tomcat-6.0-doc/aio.html, and there is nothing in Tomcat that will prevent these from all being accepted, even if doing so may cause the server to become unresponsive as it tries to send a message to one million clients, or may cause out of memory errors. Would it be beneficial for Tomcat to have an inbuilt mechanism to fail gracefully should such a situation occur? I know that part of the advantage of NIO is that it handles DoS situations that are caused by making a small number of requests that read/write very slowly much better than the thread per request model, so such limits may be unlimited by default, but some applications may be able to benefit from setting a limit in Tomcat. yes, having a maxConnections limit is beneficial. Cheers, James - 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: NioConnector limits and comet requests
On 02/25/2010 01:26 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 James, On 2/25/2010 12:47 AM, James Roper wrote: Is there anyone on this list with a detailed knowledge of the NIO Connector? In spite of his terse reply, Filip is, I believe, quite familiar with that code. Would you consider writing a patch and submitting it? The best thing to do it start out by filing a bugzilla enhancement request. That's the place to attach any patches you might develop. Enhancement requests with accompanying patches are accepted for inclusion much faster than those without patches :) I started working on this in trunk, so yes, get setup for trunk svn co http://svn.apache.org/repos/asf/trunk cd trunk ant it also has the files for eclipse in there, you may have to add some stuff to the classpath it's all handled in NioEndpoint, and I've started by adding a getKeyCount() to every poller, the only thing remaining is 1. When a poller wakes up due to a timeout, get a key count (don't do it on an actual even as that will cause performance issues) 2. In the acceptor thread, check all pollers and sum up the key counts 3. decide what to do. You can't simply close connections, but you can sleep, and let the backlog pile up for a bit or implement some kind of barrier, but this is a bit tricky too best Filip Sounds like maybe there's a task to be done in providing limits on the NIO pools/queues. I wonder how hard it is to get a tomcat dev environment setup... Last time I tried, it wasn't too bad. Just be aware that sometimes the build environment has to be specific even if the runtime environment isn't (that is, TC6 may require Java 6 to build, but only Java 5 to run). Check the docs for more information. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuG3RAACgkQ9CaO5/Lv0PA72ACghFcr0w7BPB0vZxqZszA5tEFu DDAAniC0dQYjsp7JcS8CXZAVbWZBshV2 =JtsS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: NioConnector limits and comet requests
svn co http://svn.apache.org/repos/asf/tomcat/trunk On 02/25/2010 01:48 PM, Filip Hanik - Dev Lists wrote: On 02/25/2010 01:26 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 James, On 2/25/2010 12:47 AM, James Roper wrote: Is there anyone on this list with a detailed knowledge of the NIO Connector? In spite of his terse reply, Filip is, I believe, quite familiar with that code. Would you consider writing a patch and submitting it? The best thing to do it start out by filing a bugzilla enhancement request. That's the place to attach any patches you might develop. Enhancement requests with accompanying patches are accepted for inclusion much faster than those without patches :) I started working on this in trunk, so yes, get setup for trunk svn co http://svn.apache.org/repos/asf/trunk cd trunk ant it also has the files for eclipse in there, you may have to add some stuff to the classpath it's all handled in NioEndpoint, and I've started by adding a getKeyCount() to every poller, the only thing remaining is 1. When a poller wakes up due to a timeout, get a key count (don't do it on an actual even as that will cause performance issues) 2. In the acceptor thread, check all pollers and sum up the key counts 3. decide what to do. You can't simply close connections, but you can sleep, and let the backlog pile up for a bit or implement some kind of barrier, but this is a bit tricky too best Filip Sounds like maybe there's a task to be done in providing limits on the NIO pools/queues. I wonder how hard it is to get a tomcat dev environment setup... Last time I tried, it wasn't too bad. Just be aware that sometimes the build environment has to be specific even if the runtime environment isn't (that is, TC6 may require Java 6 to build, but only Java 5 to run). Check the docs for more information. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuG3RAACgkQ9CaO5/Lv0PA72ACghFcr0w7BPB0vZxqZszA5tEFu DDAAniC0dQYjsp7JcS8CXZAVbWZBshV2 =JtsS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slow requests when using Executor pool
turn off keep alive for your profiler to not give you false positives maxKeepAliveRequests=1 Connector port=8080 protocol=HTTP/1.1 maxKeepAliveRequests=1 connectionTimeout=2 redirectPort=8443 / On 02/03/2010 02:14 PM, youngm wrote: (This is a new thread spawned from my Tomcat 6.0.24 Google Chrome thread with better information) I'm running Tomcat 6.0.24, Sun JDKx86 6u18, Windows 7 64, Firefox and Chrome browser. I've noticed that for about the first 1-3 min after my tomcat instance has started some of my requests that normally take 1 sec to be handled are taking 30+ sec to respond. I've narrowed the problem down to my use of an Executor pool to handle requests. The follwing is my server.xml: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Service name=Catalina Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ Connector executor=tomcatThreadPool port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps /Host /Engine /Service /Server If I changeConnector/ to not use and executor like so: Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / I don't experience a problem. I've hooked a profiler up and it appears all of the time is being spent doing a socketRead with the following trace: [Wall Time] java.net.SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) java.net.SocketInputStream.read(byte[], int, int) org.apache.coyote.http11.InternalInputBuffer.fill() org.apache.coyote.http11.InternalInputBuffer.parseRequestLine() org.apache.coyote.http11.Http11Processor.process(Socket) I've tried to analyse the network info with wireshark and see no decernable differences in network traffic between the 2 requests. I can try analyzing wireshark data further if the list thinks that would be useful. Though I find it strange that it works fine when not using an Executor. Anyone have any ideas or seen similar behaviour? Thanks, Mike - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Force New Connection Pool
On 02/03/2010 08:31 AM, Dan Denton wrote: Hello all. I'd like to find a way to force my tomcat instances to get new connection pools, without stopping and starting the instances and kicking out all of my connected users. I'm using Oracle RAC with a failover service, and should one node fail, our tomcat instances don't reconnect automatically. Doing a full stop/start can be time consuming, so I was wondering if it were possible to make them reconnect without a full restart. I'm running tomcat 5.5.12 on RHEL4 with JDK1.5. Thanks in advance... If you're already paying a bunch of money for RAC, then use the RAC features Resource name=jdbc/test auth=Container type=oracle.jdbc.pool.OracleDataSource factory=oracle.jdbc.pool.OracleDataSourceFactory connectionCachingEnabled=true connectionCacheName=ConnectionCache fastConnectionFailoverEnabled=true ONSConfiguration=nodes=oraclehost1:1521,oraclehost2:1521 there are a bunch of other attributes that are Oracle specific, and this will get you what you want - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Still unable to get a heap dump from Tomcat running on Windows as a service
set the HeapDumpPath option, so you can actually write to a location on disk On 02/02/2010 02:19 PM, Caldarale, Charles R wrote: From: Laird Nelson [mailto:ljnel...@gmail.com] Subject: Still unable to get a heap dump from Tomcat running on Windows as a service I am still unable to get Tomcat to dump heap when it encounters an OutOfMemoryError. You appear to be unique in that regard, since no one else seems to be having that problem. I'm using the graphical program that comes up when you select Monitor Tomcat from the Windows Start Menu. I assume this is TomcatW.exe? Not quite; it's tomcat6w.exe (note the digit and no caps). I have Tomcat 6.0.20 running as a service under the default local user account What's a default local user account? Try using a real account, possibly one in the administrators group to see if that makes a difference. set to be allowed to interact with the desktop Not needed. I've specified -XX:HeapDumpPath=C:\crap, and -XX:HeapDumpPath=C:/crap to no avail. Try just leaving that parameter out. I've set the working path for the Startup and Shutdown tabs to C:\crap and C:/crap with no effect. The Shutdown working path doesn't matter, since that's not normally used. Try setting the Startup path to the Tomcat installation directory after reinstalling Tomcat. The direction of the slash doesn't seem to matter; I get the .hprof file generated in the designated directory regardless of which I use. I've set memory to a minimum of 512 and a maximum of 1024 MB. You normally want those to be the same for a server environment to avoid heap thrashing. I entered the JVM options one per line. That is a requirement. The tomcat documentation says to enter them separated by either a # or a ; That's for command-line usage, not the GUI. Does anyone have any other suggestions to try before giving up on Tomcat in favor of either Jetty or (God help me) JBoss? Sounds like a baby with the bathwater solution... I would try removing the existing Tomcat service, reinstalling the current (6.0.24) Tomcat from the .zip download, using the service.bat script to create the service, and only then try recreating the OOM problem. Unpack the .zip download into someplace other than C:\Program Files. Also try setting the Level on the Logging tab to Debug rather than Error to see if that shows anything interesting. - 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: CometProcessor proxied through Apache httpd
On 01/27/2010 08:26 AM, Stephen Byrne wrote: Is there a way to get CometProcessor to work when proxying through Apache httpd? Here is what I have tried: I have an HttpServlet implementing CometProcessor. When I have a Tomcat connector like this: Connector port=8912 protocol=HTTP/1.1 address=192.168.1.30 / and I connect to it directly, everything works wonderfully - I get CometEvent.EventType.READ events as I send data from the client. correct When I have a Tomcat connector like this: Connector port=8911 protocol=HTTP/1.1 address=127.0.0.1 / and have Apache httpd proxy requests like this: RewriteRule ^/path/to/servlet http://localhost:8911/path/to/servlet [P] I get exactly one CometEvent.EventType.READ event with all of the data after I finish sending data from the client. that is cause the proxy buffers the entire request. The Comet technique messes with the logistics of the HTTP protocol, so this behavior is not incorrect when proxying. When I have a Tomcat connector like this: Connector port=8909 protocol=AJP/1.3 address=127.0.0.1 / AJP connectors dont support Comet, so this wont work. and have Apache httpd proxy requests like this: RewriteRule ^/path/to/servlet ajp://localhost:8909/path/to/servlet [P] I get zero CometEvents and the client gets an HTTP error 405 (Method Not Allowed). I was hoping that AJP would work so I could try using ProxyPass with flushpackets=on, but the Apache documentation says that only works with AJP. If I use Http11NioConnector instead of HTTP/1.1 and try to proxy with Apache, I get the same results as if I were using the HTTP/1.1 connector. My client code (Java) is: // Direct to Tomcat (HTTP) //URL url = new URL( http://server:8912/path/to/servlet; ); // Apache proxies to Tomcat URL url = new URL( http://server/path/to/servlet; ); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setChunkedStreamingMode( 1 ); connection.setDoOutput( true ); connection.setDoInput( true ); connection.connect(); OutputStream os = connection.getOutputStream(); for ( int i = 0; i 10; i++ ) { os.write( 1 ); os.flush(); Thread.sleep( 1000 ); } os.close(); log.debug( response: + connection.getResponseCode() ); log.debug( response: + connection.getResponseMessage() ); connection.disconnect(); - 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: AW: Comet Connection Writeable?
http://people.apache.org/~fhanik/tomcat/v6.0.0-gdev6/ Let me know what you think of the programming experience, I wasn't too stoked about it. Lots of concurrency issues that can pop up 1. svn co http://svn.apache.org/repos/asf/tomcat/sandbox/gdev6x/ 2. cd gdev6x 3. echo base.path=`pwd`/includes build.properties 4. export PATH=/path/to/jdk1.5/bin:$PATH 5. export PATH=/path/to/ant1.7/bin:$PATH 6. ant download 7. ant 8. ant -f extras.xml 9. ant -f dist.xml Filip On 01/22/2010 02:11 PM, Steffen Heil wrote: Hi I'd like to try it. However I am not accustomed to building tomcat. Do you have this compiled somewhere? Best regards, Steffen -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Gesendet: Dienstag, 19. Januar 2010 15:50 An: Tomcat Users List Betreff: Re: Comet Connection Writeable? Hi Steffen, At http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/ I implemented the feature you are looking for. Where you would do CometEvent.interestOps(CometEvent.CometOperation.OP_WRITE); and you will receive a CometEvent.EventType.WRITE When I tried to write sample applications against this, it turned out to be very complex programming. You can check out that branch and build it and see if its something we should still pursue Filip On 01/18/2010 09:06 AM, Steffen Heil wrote: Hi I am using comet connections for some time now in a server push manner: Whenever the server needs to inform the client about some event, it sends a packet to the client and waits for a reply in the same connection. As soon, as a READ event is triggered, that reply is read and the next message can be sent. Now, this requires a round-trip-time between the client and the server and is inappropriate for larger amounts of data especially on high latency connections. I am seeking for a way to determine (from a comet servlets point of view) if a connection is writeable - this is, if output buffers are empty and I can send additional data. Note, that sending a huge amount of data at once is not an option, I need to send distinct parts... So here are my questions: - How can I detect if a connection is writeable? - That is, how can I detect if the output buffers are empty? - Is there a way to use comet connection for something like a selector? Regards, Steffen - 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: Adding/removing hosts dynamically?
answer is yes, it is possible. Others have done it successfully. If you want a place to start, take a look at host manager servlet http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java?view=annotate Note, this doesn't imply that you have to do it over HTTP, implement it any way you want to fit your environment best Filip On 01/21/2010 10:24 AM, richard42 wrote: Dear Forum, Is it possible to dynamically add/remove hosts through code without restarting Tomcat (6.0)? I am writing an application that creates new websites on the fly (eg. website1.mydomain.com, website2.mydomain.com etc). Each of these websites will exist in a separate directory on the server - this is so they may be upgraded independently in the future. 1. I have considered programatically editing server.xml, but have ruled this out since it would require restarting Tomcat afterwards (and hence downtime of existing sites). 2. I have also considered running multiple instances of Tomcat, but each instance would have to use a different TCP port. In the absence of any additional software, this would mean I would need lots of external IPs. 3. I have looked at the 'tomcat-manager' app (and considered interfacing with it via HTTP) but the start function does not seem to work and from what I have read, this app is no longer supported? Would anybody be able to advise me on the best approach please? I have not ruled out any of the above options completely if they can be implemented reliably and without restarting the server. Thank you in advance! Richard. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Can anyone do a simple war deployment in Tomcat 6?
simplest http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/ http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html On 01/21/2010 01:41 PM, Clay McCoy wrote: I want to deploy a war file in an embedded Tomcat. There a few outdated examples, and many posts where this gets asked and never answered. http://www.mail-archive.com/users@tomcat.apache.org/msg19481.html The methods once used to do this are gone, and I can't find any examples of how to do such a simple and useful task. This is pretty ridiculous, surely someone knows how to do this. Thanks, Clay - 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: Can anyone do a simple war deployment in Tomcat 6?
an embedded Tomcat is the same as a regular Tomcat if you configure it that way. The easiest way I can think of is to take a look at the class we use to launch a simple tomcat in trunk http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?view=annotate there is a method called addWebApp Filip On 01/21/2010 02:50 PM, Clay McCoy wrote: Thank you for the reply, but I'm talking about embedded Tomcat. The war is deployed programmatically, and the API has changed drastically since the dated examples I can find. It would be great if the embedded use of Tomcat had the same level of documentation. On 1/21/10 3:23 PM, Filip Hanik - Dev Listsdevli...@hanik.com wrote: simplest http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/ http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html On 01/21/2010 01:41 PM, Clay McCoy wrote: I want to deploy a war file in an embedded Tomcat. There a few outdated examples, and many posts where this gets asked and never answered. http://www.mail-archive.com/users@tomcat.apache.org/msg19481.html The methods once used to do this are gone, and I can't find any examples of how to do such a simple and useful task. This is pretty ridiculous, surely someone knows how to do this. Thanks, Clay - 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: Comet Connection Writeable?
Hi Steffen, At http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/ I implemented the feature you are looking for. Where you would do CometEvent.interestOps(CometEvent.CometOperation.OP_WRITE); and you will receive a CometEvent.EventType.WRITE When I tried to write sample applications against this, it turned out to be very complex programming. You can check out that branch and build it and see if its something we should still pursue Filip On 01/18/2010 09:06 AM, Steffen Heil wrote: Hi I am using comet connections for some time now in a server push manner: Whenever the server needs to inform the client about some event, it sends a packet to the client and waits for a reply in the same connection. As soon, as a READ event is triggered, that reply is read and the next message can be sent. Now, this requires a round-trip-time between the client and the server and is inappropriate for larger amounts of data especially on high latency connections. I am seeking for a way to determine (from a comet servlets point of view) if a connection is writeable - this is, if output buffers are empty and I can send additional data. Note, that sending a huge amount of data at once is not an option, I need to send distinct parts... So here are my questions: - How can I detect if a connection is writeable? - That is, how can I detect if the output buffers are empty? - Is there a way to use comet connection for something like a selector? Regards, Steffen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSLv3/TLS man-in-middle vulnerability
On 01/18/2010 10:18 AM, Mark Thomas wrote: On 18/01/2010 11:03, Steve G. Johnson wrote: We recently installed Tomcat 5.5.23 in Windows server to support the Infor WebUI (webtop) application. We installed a cerificate and are using SSl on port 8443. This all works fine. The local IT Security team ran an HP Web Inspect and it showed a High vulnerability for SSLv3/TLS known as CVE-2009-3555. We are running JVM JRE 1.6.0._17 on the server. You state on the http://tomcat.apache.org/security-5.html site at end of page that this is not a vulnerability depending on a number of factors. This is very unclear tor us. The Web Inspect product sated that this must be fixed as follows: Patches must be applied to the underlying web server and ssl library. OpenSSL Patch: http://www.openssl.org/source/openssl-0.9.8l.tar.gz Apache Mod-SSL Patch: http://www.apache.org/dist/httpd/patches/apply_to_2.2.14 /CVE-2009-3555-2.2.patch These patches may cause issues with sites that require renegotiation. (Sites requiring public HTTPS access with certain folders protected by client-side certificates) What can we do to make the vulnerability shown in Web Inspect go away? You have a couple of options, depending on which connector you are using. BIO NIO connectors - use JSSE for SSL - JSSE is provided by the JDK - a fix will require a fix the JDK - talk to your JDK vendor - the next 6.0.x release (coming soon) will contain a workaround NIO doesn't allow handshakes and is not vulnerable. Instead it will time out the request So if using Tomcat 6, then NIO is a work around Filip APR/native connector - uses OpenSSL for SSL - OpenSSL is provided by the OpenSSL project - a fix requires a fix in OpenSSL - APR/native 1.1.19 includes a workaround for this issue Right now, the quickest way to fix this is to switch to the APR/native connector and use 1.1.19 Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: NIO-connector problems (excessive CPU-usage)
yes, the issue is known. However, we have not been able to create a use case for it, since I've never been able to reproduce it. One of the work arounds would be to close the selector, but that is a royal pain, since you'd then have to reregister all keys and you'd end up in a synchronization nightmare. Filip On 01/13/2010 07:57 AM, Tobias Lind wrote: Hi! We've been using Tomcat on Linux for a very long time (and the good old JServe before it), and we recently started testing the NIO-connector instead of the old blocking one. We are currently running the latest Tomcat v6.0.20. We have a pretty large website with quite a lot of traffic, and switching to the NIO-connector gives us a VERY good performance boost! We also got rid of problems with hanging connections, etc, so it was very promising. But it also gave us new headaches :/ We were using IBM's JDK 6.0_7 (the latest), and on the first testing on our production server, the CPU hit 100% (everything started and the site worked though). We installed Sun's JDK 1.6.0_17 instead, and the CPU was constantly running at ~20-30% even when the traffic to the site was quite low. In about 24 hours runtime, we also saw one occasion where the CPU went up to 100% and never came down again (while no clients where actually running our server), and it took a Tomcat-restart to get it down to 30% again. I started investigating, and found quite a lot of reports on problem with NIO and the Selector looping out of control. Hera are some links to pages about this problem: http://bugs.sun.com/view_bug.do?bug_id=6403933 http://bugs.sun.com/view_bug.do?bug_id=6525190 http://forums.sun.com/thread.jspa?threadID=5135128 http://issues.apache.org/jira/browse/DIRMINA-678 A thread-dump showed that it's very likely to be this problem we are seeing. These threads are taking much more CPU than expected (although on Sun's JDK it seems a bit better than on IBM's), and when the system load jumped to 100%, it was the http-80-ClientPoller-0 that behaving badly: http-80-Acceptor-0 daemon prio=10 tid=0x0828d400 nid=0x7308 runnable [0x4df19000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145) - locked0x547f84c8 (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1266) at java.lang.Thread.run(Thread.java:619) http-80-ClientPoller-1 daemon prio=10 tid=0x0825f400 nid=0x7307 runnable [0x4df6a000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.PollArrayWrapper.poll0(Native Method) at sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:100) at sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:56) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69) - locked0x54941568 (a sun.nio.ch.Util$1) - locked0x54941558 (a java.util.Collections$UnmodifiableSet) - locked0x54941410 (a sun.nio.ch.PollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1545) at java.lang.Thread.run(Thread.java:619) http-80-ClientPoller-0 daemon prio=10 tid=0x0831b400 nid=0x7306 runnable [0x4dfbb000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.PollArrayWrapper.poll0(Native Method) at sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:100) at sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:56) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69) - locked0x54941758 (a sun.nio.ch.Util$1) - locked0x54941748 (a java.util.Collections$UnmodifiableSet) - locked0x54941610 (a sun.nio.ch.PollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1545) at java.lang.Thread.run(Thread.java:619) I'm sure this issue is well known to the Tomcat community and that it has been discussed before, but I'd just like to know the current status on the issue. The webpages i referred to above indicates that there are some workarounds to this problem - are these workarounds implemented in Tomcat? Is there anything we can do to get it running? We'd
Re: NIO-connector problems (excessive CPU-usage)
) - locked0x548b0798 (a sun.nio.ch.PollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1545) at java.lang.Thread.run(Thread.java:619) /Tobias -Original Message- From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Sent: den 13 januari 2010 16:13 To: Tomcat Users List Subject: Re: NIO-connector problems (excessive CPU-usage) yes, the issue is known. However, we have not been able to create a use case for it, since I've never been able to reproduce it. One of the work arounds would be to close the selector, but that is a royal pain, since you'd then have to reregister all keys and you'd end up in a synchronization nightmare. Filip On 01/13/2010 07:57 AM, Tobias Lind wrote: Hi! We've been using Tomcat on Linux for a very long time (and the good old JServe before it), and we recently started testing the NIO-connector instead of the old blocking one. We are currently running the latest Tomcat v6.0.20. We have a pretty large website with quite a lot of traffic, and switching to the NIO-connector gives us a VERY good performance boost! We also got rid of problems with hanging connections, etc, so it was very promising. But it also gave us new headaches :/ We were using IBM's JDK 6.0_7 (the latest), and on the first testing on our production server, the CPU hit 100% (everything started and the site worked though). We installed Sun's JDK 1.6.0_17 instead, and the CPU was constantly running at ~20-30% even when the traffic to the site was quite low. In about 24 hours runtime, we also saw one occasion where the CPU went up to 100% and never came down again (while no clients where actually running our server), and it took a Tomcat-restart to get it down to 30% again. I started investigating, and found quite a lot of reports on problem with NIO and the Selector looping out of control. Hera are some links to pages about this problem: http://bugs.sun.com/view_bug.do?bug_id=6403933 http://bugs.sun.com/view_bug.do?bug_id=6525190 http://forums.sun.com/thread.jspa?threadID=5135128 http://issues.apache.org/jira/browse/DIRMINA-678 A thread-dump showed that it's very likely to be this problem we are seeing. These threads are taking much more CPU than expected (although on Sun's JDK it seems a bit better than on IBM's), and when the system load jumped to 100%, it was the http-80-ClientPoller-0 that behaving badly: http-80-Acceptor-0 daemon prio=10 tid=0x0828d400 nid=0x7308 runnable [0x4df19000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145) - locked0x547f84c8 (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1266) at java.lang.Thread.run(Thread.java:619) http-80-ClientPoller-1 daemon prio=10 tid=0x0825f400 nid=0x7307 runnable [0x4df6a000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.PollArrayWrapper.poll0(Native Method) at sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:100) at sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:56) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69) - locked0x54941568 (a sun.nio.ch.Util$1) - locked0x54941558 (a java.util.Collections$UnmodifiableSet) - locked0x54941410 (a sun.nio.ch.PollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1545) at java.lang.Thread.run(Thread.java:619) http-80-ClientPoller-0 daemon prio=10 tid=0x0831b400 nid=0x7306 runnable [0x4dfbb000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.PollArrayWrapper.poll0(Native Method) at sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:100) at sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:56) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69) - locked0x54941758 (a sun.nio.ch.Util$1) - locked0x54941748 (a java.util.Collections$UnmodifiableSet) - locked0x54941610 (a sun.nio.ch.PollSelectorImpl
Re: More on Tomcat Sessions - limiting cluster session replication to sessions that will last longer than 'n' duration
The sensible approach would be 1. Refactor DeltaManager and BackupManager to defer the session creation message until the request is complete 2. Then simply swap out the ReplicationValve with an implementation that makes sense Filip On 01/12/2010 11:42 AM, Robin Wilson wrote: REPOSTING this so it won't be on the other thread - sorry about that. Earlier this week I posted a question about how to prevent sessions from being created in our Tapestry pages, and/or how to get Tomcat to get rid of a bunch of '1-second' sessions we're creating during a load test because the sessions eventually fill up the heap. (They are being created faster than Tomcat can clean them out - even though they expire faster than we create them.) So, my lead developer thinks he has found a way to alleviate our problems (at least for our production Tomcat 6.0.20 cluster of 4 servers). We will not replicate sessions to other cluster members unless they have a duration longer than a 'threshold' we set. We are altering the DeltaManager to make this change, so that simply creating a session doesn't automatically guarantee that it is replicated to other nodes in the cluster. The session duration will also have to be greater than a sessionDurationMinThreshold value we will set in the 'server.xml' file for the new DeltaManager. The idea is that sessions created that have very short durations are really 'transient' anyway, so there is no need to pass them off to the other members of the cluster. The question I have, is there anything we should watch out for in making this adjustment to the DeltaManager? We will test this pretty heavily before we deploy it to our production environment, but I'm worried about things we should be looking for in that testing (other than just validating that our useful session data can be available across multiple cluster members). -- Robin D. Wilson Director of Web Development KingsIsle Entertainment, Inc. CELL: 512-426-3929 DESK: 512-623-5913 www.KingsIsle.com - 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: Error running two tomcats in same cluster on same Windows box
address=224.0.0.0 that's not an IP, the last 0 is not allowed, must be 1-254 Filip On 12/22/2009 05:36 PM, John Tangney wrote: We run two tomcats on the same Windows Server 2008 box. They have their server.xml tweaked so that they use unique ports. Here's a diff: $ diff server.xml /cygdrive/c/Program\ Files/Apache\ Software\ Foundation/Tomcat\ 6.0/conf/server.xml 22c22 Server port=8105 shutdown=SHUTDOWN --- Server port=8005 shutdown=SHUTDOWN 67c67 Connector port=8180 protocol=HTTP/1.1 --- Connector port=8080 protocol=HTTP/1.1 69c69 redirectPort=8543 / --- redirectPort=8443 / 88c88 Connector port=8109 protocol=AJP/1.3 redirectPort=8543 / --- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / 100c100 Engine name=WinBox_Temp defaultHost=localhost jvmRoute=WinBox_temp --- Engine name=WinBox defaultHost=localhost jvmRoute=WinBox If we have one of the tomcats broadcast its multicast packets on 228.0.0.0 while the second broadcasts on 224.0.0.0, everything works fine and they each cluster with other nodes that use those multicast addresses. (Think staging and prod clusters) But when we want two tomcats on the same machine to join the _same_ cluster (224.0.0.0), we get this in the log file: SEVERE: Unable to start cluster. org.apache.catalina.tribes.ChannelException: java.net.SocketException: An operation was attempted on something that is not a socket; No faulty members identified. at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:169) at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407) at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:669) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1035) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.SocketException: An operation was attempted on something that is not a socket at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method) at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299) at java.net.MulticastSocket.setInterface(MulticastSocket.java:420) at org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket(McastServiceImpl.java:206) at org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:173) at org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:169) at org.apache.catalina.tribes.membership.McastService.start(McastService.java:356) at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:154) ... 18 more Here's the juicy part of server.xml: Membership className=org.apache.catalina.tribes.membership.McastService address=224.0.0.0 bind=10.5.1.102 port=45564 frequency=500 dropTime=3000/ Naturally, I have googled the exception, but the only hits I have found go on about corrupted winsock registry entries, which seems irrelevant since everything works when the two tomcats use separate multicast addresses. Note that 10.5.1.102 is a statically-assigned IP on this box's second NIC. So... a) Is it possible to run two tomcat nodes in the same cluster on the same windows box? b) If so, what's the magic to keep windows happy? It _appears_ that windows won't let the two tomcats bind to the same multicast address/port. (Same config works fine on Linux.)
Re: Error running two tomcats in same cluster on same Windows box
sorry, ignore previous post, it's failing on this operation: socket.setInterface(mcastBindAddress); There is a small chance that Window's doesn't allow multicast sockets to be bound to an IP try removing the bind attribute Filip On 12/23/2009 06:48 AM, Filip Hanik - Dev Lists wrote: address=224.0.0.0 that's not an IP, the last 0 is not allowed, must be 1-254 Filip On 12/22/2009 05:36 PM, John Tangney wrote: We run two tomcats on the same Windows Server 2008 box. They have their server.xml tweaked so that they use unique ports. Here's a diff: $ diff server.xml /cygdrive/c/Program\ Files/Apache\ Software\ Foundation/Tomcat\ 6.0/conf/server.xml 22c22 Server port=8105 shutdown=SHUTDOWN --- Server port=8005 shutdown=SHUTDOWN 67c67 Connector port=8180 protocol=HTTP/1.1 --- Connector port=8080 protocol=HTTP/1.1 69c69 redirectPort=8543 / --- redirectPort=8443 / 88c88 Connector port=8109 protocol=AJP/1.3 redirectPort=8543 / --- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / 100c100 Engine name=WinBox_Temp defaultHost=localhost jvmRoute=WinBox_temp --- Engine name=WinBox defaultHost=localhost jvmRoute=WinBox If we have one of the tomcats broadcast its multicast packets on 228.0.0.0 while the second broadcasts on 224.0.0.0, everything works fine and they each cluster with other nodes that use those multicast addresses. (Think staging and prod clusters) But when we want two tomcats on the same machine to join the _same_ cluster (224.0.0.0), we get this in the log file: SEVERE: Unable to start cluster. org.apache.catalina.tribes.ChannelException: java.net.SocketException: An operation was attempted on something that is not a socket; No faulty members identified. at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:169) at org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149) at org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407) at org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:669) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1035) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.SocketException: An operation was attempted on something that is not a socket at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method) at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299) at java.net.MulticastSocket.setInterface(MulticastSocket.java:420) at org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket(McastServiceImpl.java:206) at org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:173) at org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:169) at org.apache.catalina.tribes.membership.McastService.start(McastService.java:356) at org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:154) ... 18 more Here's the juicy part of server.xml: Membership className=org.apache.catalina.tribes.membership.McastService address=224.0.0.0 bind=10.5.1.102 port=45564 frequency=500 dropTime=3000/ Naturally, I have googled the exception, but the only hits I have found go on about corrupted winsock registry entries, which seems irrelevant since everything works when the two tomcats use separate multicast addresses. Note that 10.5.1.102 is a statically-assigned IP on this box's second NIC. So
Re: Error running two tomcats in same cluster on same Windows box
On 12/23/2009 11:42 AM, John Tangney wrote: Thanks for your response, Filip! On Dec 23, 2009, at 6:05 AM, Filip Hanik - Dev Lists wrote: sorry, ignore previous post, Yeah, I had the same reaction to 224.0.0.0 but it works when one Tomcat is running, so I assumed it's OK. it's failing on this operation: socket.setInterface(mcastBindAddress); There is a small chance that Window's doesn't allow multicast sockets to be bound to an IP try removing the bind attribute No, that can't be it did you try it? , because when I run just one tomcat on that windows machine (with the bind – without it Tomcat will bind to the wrong NIC which is itself a problem) everything works just fine. It's only when I run two tomcats at the same time with the same Membership ... Could it be that Windows (or some layer in between) is holding a socket open? Is that what An operation was attempted on something that is not a socket means? Thanks! --johnt - 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: Error running two tomcats in same cluster on same Windows box
On 12/23/2009 01:46 PM, John Tangney wrote: On Dec 23, 2009, at 12:19 PM, Filip Hanik - Dev Lists wrote: On 12/23/2009 11:42 AM, John Tangney wrote: it's failing on this operation: socket.setInterface(mcastBindAddress); There is a small chance that Window's doesn't allow multicast sockets to be bound to an IP try removing the bind attribute No, that can't be it did you try it? Yes, I did try that. With the bind attribute, a SINGLE tomcat binds to the correct NIC and the cluster works perfectly. It's only when we have TWO tomcats both on the same machine that we have the problem. That, my friend, is a totally different problem. A regression in in 6.0.20 only https://issues.apache.org/bugzilla/show_bug.cgi?id=47308 Will be fixed in the next release Filip Without the bind attribute, Tomcat binds to the wrong NIC which prevents the other nodes from getting the multicast packets. I could experiment with another windows box to see if I can run 2 tomcats without the bind attribute. (I can't do that on the machine that's experiencing the prob because it's a production box.) But even if that works, we stuck, because we have to use the 2nd NIC for clustering. Could it be that a socket is not being closed? Thanks! --johnt - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Errors in session replication and very high server load
Well, the log messages you see, are all based on timeouts. If your system has a load average of 12, unless you have a 12-way machine, that is very high, and could be the cause of your timeouts. You will need to figure out what is causing the high load average. Filip On 12/18/2009 01:30 AM, mohame...@easy-dialog.info wrote: Dear All, I have a strange problem. When I added a new server to my tomcat cluster I have noticed that the load is getting very high on the server. Tomcat log show a lot of these lines 18.12.2009 09:07:14 org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -120}:4000,{62, 75, -127, -120},4000, alive=65087504,id={-64 -42 103 97 8 -7 69 -88 -113 -106 -32 -64 46 76 -117 -58 }, payload={}, command={}, domain={}, ] 18.12.2009 09:07:14 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -122}:4000,{62, 75, -127, -122},4000, alive=64996684,id={-15 62 -53 -50 -43 81 75 18 -112 -43 58 -102 69 72 83 21 }, payload={}, command={}, domain={}, ]] 18.12.2009 09:07:19 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector performBasicCheck WARNUNG: Member added, even though we werent notified:org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -117}:4000,{62, 75, -127, -117},4000, alive=58229968,id={16 -115 -21 -109 18 -76 79 58 -95 -17 57 -32 -69 -111 -20 28 }, payload={}, command={}, domain={}, ] 18.12.2009 09:07:19 org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -117}:4000,{62, 75, -127, -117},4000, alive=58229968,id={16 -115 -21 -109 18 -76 79 58 -95 -17 57 -32 -69 -111 -20 28 }, payload={}, command={}, domain={}, ] 18.12.2009 09:08:10 org.apache.catalina.ha.tcp.SimpleTcpCluster memberDisappeared INFO: Received member disappeared:org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -121}:4000,{62, 75, -127, -121},4000, alive=64986581,id={-87 -91 115 -83 80 64 76 -9 -68 -107 -109 52 0 -47 109 98 }, payload={}, command={}, domain={}, ] 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector performBasicCheck INFO: Suspect member, confirmed dead.[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -121}:4000,{62, 75, -127, -121},4000, alive=64986581,id={-87 -91 115 -83 80 64 76 -9 -68 -107 -109 52 0 -47 109 98 }, payload={}, command={}, domain={}, ]] 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -121}:4000,{62, 75, -127, -121},4000, alive=65045054,id={-87 -91 115 -83 80 64 76 -9 -68 -107 -109 52 0 -47 109 98 }, payload={}, command={}, domain={}, ]] message. Will verify. 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Verification complete. Member still alive[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -121}:4000,{62, 75, -127, -121},4000, alive=65045054,id={-87 -91 115 -83 80 64 76 -9 -68 -107 -109 52 0 -47 109 98 }, payload={}, command={}, domain={}, ]] 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -122}:4000,{62, 75, -127, -122},4000, alive=65054434,id={-15 62 -53 -50 -43 81 75 18 -112 -43 58 -102 69 72 83 21 }, payload={}, command={}, domain={}, ]] message. Will verify. 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -118}:4000,{62, 75, -127, -118},4000, alive=58290426,id={101 61 65 84 -59 -114 65 -57 -106 8 -118 -25 -55 56 -82 111 }, payload={}, command={}, domain={}, ]] message. Will verify. 18.12.2009 09:08:10 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector memberDisappeared INFO: Received memberDisappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://{62, 75, -127, -120}:4000,{62, 75, -127, -120},4000, alive=65141440,id={-64 -42 103 97 8 -7 69 -88 -113 -106 -32 -64 46 76 -117 -58 }, payload={}, command={}, domain={}, ]] message. Will verify. Also the load on the server is getting very high (while no CPU usage). This is the output of top top - 08:29:51 up 63 days, 22:53, 1 user, load average: 12.95, 10.61, 8.35 Tasks: 163 total, 1 running, 162 sleeping, 0 stopped, 0 zombie Cpu(s): 0.7%us, 0.6%sy, 0.0%ni, 98.4%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 33023640k total, 19154120k used, 13869520k free, 373012k buffers Swap: 92k total, 676k used, 999316k free,
Re: tomcat jdbc pool is not proxying resultSets and preparedStatements
Thank you very much! On 12/17/2009 07:11 AM, Guillermo Fernandes wrote: I have attached the interceptor to the bugzilla ticket. Actually, it extends the AbstractStatementInterceptor. Guillermo. On Wed, Dec 16, 2009 at 4:47 PM, Filip Hanik - Dev Listsdevli...@hanik.com wrote: correct, there is an AbstractStatementInterceptor that you would extend in order to write such an extension. Filip On 12/16/2009 06:02 AM, Guillermo Fernandes wrote: Hi Filip, Yes, we are aware that the API allow us to write our own JdbcInterceptor so we are writing an interceptor to handle this issue by creating a proxy for the statement and resultSet. We will attach it to the bugzilla ticket as a workaround, but we think the issue should be fixed inside the jdbc-pool (it could be a fixed JdbcInterceptor). Thanks, Guillermo On Wed, Dec 16, 2009 at 12:19 AM, Filip Hanik - Dev Lists devli...@hanik.com wrote: On 12/15/2009 10:34 AM, Guillermo Fernandes wrote: Hi, I'm using ddlutils 1.0 and tomcat jdbc pool 1.0.7.1 and I getting an error due to a connection is closed and the pool is not aware of that. Basically the issue is that ddlutils has a resultset iterator and when it finishes it closes the connection by getting it from the * resultSet.preparedStatement.connection* and the connection returned is not the proxy that the pool has created. wow, that seems backwards, but since the API allows you to do so, I would guess its a valid use case. So the issue happens when another client retrieves a connection from the pool because the pool returns a connection that was actually closed. validationQuery=... and testOnBorrow=true would take care of this as a work around for now. Why tomcat jdbc pool is not creating proxies for preparedStatements and resultSets like commons-dbcp? performance of course, the lesser the better. SlowQueryReport interceptor already has an example of this, so its doable. Is there any other way to address this issue? see work around above Filip Thanks, Guillermo - 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 jdbc pool is not proxying resultSets and preparedStatements
correct, there is an AbstractStatementInterceptor that you would extend in order to write such an extension. Filip On 12/16/2009 06:02 AM, Guillermo Fernandes wrote: Hi Filip, Yes, we are aware that the API allow us to write our own JdbcInterceptor so we are writing an interceptor to handle this issue by creating a proxy for the statement and resultSet. We will attach it to the bugzilla ticket as a workaround, but we think the issue should be fixed inside the jdbc-pool (it could be a fixed JdbcInterceptor). Thanks, Guillermo On Wed, Dec 16, 2009 at 12:19 AM, Filip Hanik - Dev Lists devli...@hanik.com wrote: On 12/15/2009 10:34 AM, Guillermo Fernandes wrote: Hi, I'm using ddlutils 1.0 and tomcat jdbc pool 1.0.7.1 and I getting an error due to a connection is closed and the pool is not aware of that. Basically the issue is that ddlutils has a resultset iterator and when it finishes it closes the connection by getting it from the * resultSet.preparedStatement.connection* and the connection returned is not the proxy that the pool has created. wow, that seems backwards, but since the API allows you to do so, I would guess its a valid use case. So the issue happens when another client retrieves a connection from the pool because the pool returns a connection that was actually closed. validationQuery=... and testOnBorrow=true would take care of this as a work around for now. Why tomcat jdbc pool is not creating proxies for preparedStatements and resultSets like commons-dbcp? performance of course, the lesser the better. SlowQueryReport interceptor already has an example of this, so its doable. Is there any other way to address this issue? see work around above Filip Thanks, Guillermo - 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 jdbc pool is not proxying resultSets and preparedStatements
On 12/15/2009 10:34 AM, Guillermo Fernandes wrote: Hi, I'm using ddlutils 1.0 and tomcat jdbc pool 1.0.7.1 and I getting an error due to a connection is closed and the pool is not aware of that. Basically the issue is that ddlutils has a resultset iterator and when it finishes it closes the connection by getting it from the * resultSet.preparedStatement.connection* and the connection returned is not the proxy that the pool has created. wow, that seems backwards, but since the API allows you to do so, I would guess its a valid use case. So the issue happens when another client retrieves a connection from the pool because the pool returns a connection that was actually closed. validationQuery=... and testOnBorrow=true would take care of this as a work around for now. Why tomcat jdbc pool is not creating proxies for preparedStatements and resultSets like commons-dbcp? performance of course, the lesser the better. SlowQueryReport interceptor already has an example of this, so its doable. Is there any other way to address this issue? see work around above Filip Thanks, Guillermo - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org