Re: Tomcat 8 DB Connection Pooling

2015-06-11 Thread Filip Hanik
set the properties

logAbandoned=true
removeAbandoned=true
removeAbandonedTimeout=60 (value is in seconds, should be larger than
your longest running transaction)
timeBetweenEvictionRunsMillis=15000 (value is in milliseconds)

if you have a leak (meaning your code is not returning the connections) you
will see log entries
​ that clearly detail the stack trace of where the problem occurred

an abandoned connection is a connection where you called
DataSource.getConnection() and then never called Connection.close() on

Filip
​


On Thu, Jun 11, 2015 at 6:18 PM, Douglas Schaible doug...@mac.com wrote:

 Good Day All,

 I am having a problem with a connection pool and I was hoping for some
 guidance.

 I have defined the connection pool below for two deployed applications to
 use.  When I bounce the server I can see that it immediately crates 100
 connections to the DB.  (I am ok with this, but that is not what is
 specified in the config)  Then when I access the application repeatedly
 very quickly new connections to the DB are created each time a page is
 called till it reaches about 150 and then future calls fail with the
 message
 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too
 many connections” logged by the server.

 If we don’t place any extra load on the server the number of connections
 to the DB are reduced to 1 or 2 after 24 hours and you get the error
 Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none
 available[size:100; busy:100; idle:0; lastwait:3].” from one of the
 applications and the other application continues to work just fine.

 I believe that the DB, MySQL, is dropping the connection, but tomcat does
 not know that it has been dropped.

 I am looking for some guidance on how to tune this configuration.  Any
 suggestions?



  Resource
name=jdbc/PDB
auth=Container
type=javax.sql.DataSource
factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
initialSize=10
maxTotal=100
maxIdle=5
maxWaitMillis=1
username=“xx
password=“xx
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://x.xx.us-east-1.rds.amazonaws.com”/


 Server version:Apache Tomcat/8.0.20
 Server number: 8.0.20.0
 OS Name:   Linux
 OS Version:3.14.35-28.38.amzn1.x86_64
 Architecture:  amd64
 JVM Version:   1.7.0_79-mockbuild_2015_04_22_23_18-b00
 JVM Vendor:Oracle Corporation

 Thanks,
 Doug




Re: Tomcat 8 DB Connection Pooling

2015-06-11 Thread Filip Hanik
Configuration reference:
https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

On Thu, Jun 11, 2015 at 6:58 PM, Filip Hanik fi...@hanik.com wrote:

 set the properties

 logAbandoned=true
 removeAbandoned=true
 removeAbandonedTimeout=60 (value is in seconds, should be larger than
 your longest running transaction)
 timeBetweenEvictionRunsMillis=15000 (value is in milliseconds)

 if you have a leak (meaning your code is not returning the connections)
 you will see log entries
 ​ that clearly detail the stack trace of where the problem occurred

 an abandoned connection is a connection where you called
 DataSource.getConnection() and then never called Connection.close() on

 Filip
 ​


 On Thu, Jun 11, 2015 at 6:18 PM, Douglas Schaible doug...@mac.com wrote:

 Good Day All,

 I am having a problem with a connection pool and I was hoping for some
 guidance.

 I have defined the connection pool below for two deployed applications to
 use.  When I bounce the server I can see that it immediately crates 100
 connections to the DB.  (I am ok with this, but that is not what is
 specified in the config)  Then when I access the application repeatedly
 very quickly new connections to the DB are created each time a page is
 called till it reaches about 150 and then future calls fail with the
 message
 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too
 many connections” logged by the server.

 If we don’t place any extra load on the server the number of connections
 to the DB are reduced to 1 or 2 after 24 hours and you get the error
 Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none
 available[size:100; busy:100; idle:0; lastwait:3].” from one of the
 applications and the other application continues to work just fine.

 I believe that the DB, MySQL, is dropping the connection, but tomcat does
 not know that it has been dropped.

 I am looking for some guidance on how to tune this configuration.  Any
 suggestions?



  Resource
name=jdbc/PDB
auth=Container
type=javax.sql.DataSource
factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
initialSize=10
maxTotal=100
maxIdle=5
maxWaitMillis=1
username=“xx
password=“xx
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://x.xx.us-east-1.rds.amazonaws.com”/


 Server version:Apache Tomcat/8.0.20
 Server number: 8.0.20.0
 OS Name:   Linux
 OS Version:3.14.35-28.38.amzn1.x86_64
 Architecture:  amd64
 JVM Version:   1.7.0_79-mockbuild_2015_04_22_23_18-b00
 JVM Vendor:Oracle Corporation

 Thanks,
 Doug





Re: Connection leak Tomcat7 and Oracle

2015-02-24 Thread Filip Hanik
unless DBCP changed of course.

I would add
​the following property to your Resource element​


factory=org.apache.tomcat.jdbc.pool.DataSourceFactory

http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html



On Tue, Feb 24, 2015 at 3:47 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Red,

 On 2/24/15 4:20 PM, Red wrote:
  OS: Ubuntu 14.04.2 LTS Oracle: 12.1.0.1.0 or  11.2.0.3.0 Tomcat:
  7.0.52-1ubuntu0.1 odjbc: Ojdbc6 or Ojdbc7 (placed in
  /var/lib/tomcat7/lib) java version 1.8.0_31 of 1.7.0_65
 
  Context.xml: Resource  name=*1 auth=Container
  type=javax.sql.DataSource
  driverClassName=oracle.jdbc.OracleDriver
  url=jdbc:oracle:thin:@//*:1521/ minIdle=1
  username=*** password=*** maxActive=10 maxIdle=10
  maxWait=-1  / Resource  name=**2 auth=Container
  type=javax.sql.DataSource
  driverClassName=oracle.jdbc.OracleDriver
  url=jdbc:oracle:thin:@//***:1521/**
  username=*** password=** maxActive=20
  maxIdle=10 maxWait=-1   /
 
  Immediately after tomcat startup, number of connection goes up
  until it reaches below:
 
  SQL select machine, username, count (1) from v$session group by
  machine, username;
 
  MACHINE   USERNAME  COUNT(1) -
  - -- tc**1
  40 tc**2   60
 
  Then, after a while connection count drops to:
 
  MACHINE   USERNAME  COUNT(1) -
  - -- tc**1   6
  tc**2   60
 
 
 
  I have commented all other pools, most fail due to lack of
  resources on database side (hundreeds of connections).  Connection
  are opened if pool is defined in context.xml, even if actually not
  used anywhere.
 
  Catalina.out gives me nothing for two pools, bunch of errors with 3
  or more, but those seem to be due to exhaustion of databases
  availability.
 
  Looked up oracle support, nothing of use there.  All of this works
  fine with tomcat6, java6, oracle 11g or 12c

 So which one of these makes a difference? Tomcat's connection pool
 didn't change dramatically between Tomcat 6 and 7. The Java version
 likely has nothing to do with it, and the Oracle version also likely
 has nothing to do with it.

 So what's the problem?

 Has your application's user behavior changed in any way? Say, an
 increase in traffic?

 What you describe sounds an awful lot like poor resource management in
 the application itself.

 1. Are you sure every part of your application is using your JDBC pools?

 2. Read this:

 http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJU7P9wAAoJEBzwKT+lPKRYX/YP/ijgvvieYaNlgaM7cODgPPzm
 4GdEyJfXW+xQA5HBOBQemz5CX8YWrSgr9PrlSumf/uU6mx57G1yhmDdmwv1N5jnJ
 ct9hBU97aw/6t7FiGF+JPyEjbhETBRIZB5NoOKPiP8CNJeTMd8a9z1Qe6aU1oXMM
 yPtsvzg7J5aziKzpdm9xrb0lXtdQe9ga5YfikPShS6Tup1iJzcCImi27RQ6nuUFY
 zC8wHVmz0PU8UcbLpFDQGTTUsq6JtQvR/aGpDcHYfq8dNqavnP/QECcx6ZQlixy6
 HX30Oj4s/D/I5ez8PXAo2PiSF4ZZ86j0UQt9ntqcDeE7w7ldIfLQ2NCj5jANS6SL
 coG3n0tszmVSfCQ3fCXsTphbry0NZSJjNwmkZ4ezXj+3KpD5oATbaTLVL9ZeH9s4
 d3HiheNcF//pdeGDZ5Zy09vAO94V9CD+fr2TbbovluHzgpuOu7vYqAwg6IzuMQfs
 QWwmiC+Rccp6PnWltSJ7ClIKTh9mDHI7cejdFmQJe4J0kN7HZHggkk7ZlJD5/p6h
 sEVxmBZ0JMm0GJzoqOurtHKrviqvbfOJhXd5w6Jmv9Dyj7yK/izhXkACmOp7Rz9K
 9/T1OQsyWBtbWho8/xdisEUvsuY9w3lIf2uIeQmikIpICQ4NYddxz5I3/zpd8CSo
 KApJwDf0qsXvXduOrANP
 =F0TE
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat 8 SQL Connection Problems

2015-02-10 Thread Filip Hanik
Try
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

On Tue, Feb 10, 2015 at 10:22 AM, Jerry Malcolm techst...@malcolms.com
wrote:

 Has something changed on TC 8 requiring some different configuration for
 SQL connections?  I just installed 8.0.15 on three servers (see last week's
 post regarding errors on 8.0.17).  All three servers work for a while.
 Then after about an hour I start getting the following errors:

 java.sql.SQLException: Cannot get a connection, general error
 at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(
 PoolingDataSource.java:130)
 at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(
 BasicDataSource.java:1412)

 I bounce Tomcat, and it works again for another hour or so.  Then it hits
 again.

 None of the servers are high-traffic.  I can pretty much guarantee I'm not
 truly using up all connections.

 This is failing identically on all three servers (unrelated customers and
 unrelated apps... just migrated all my servers at the same time).

 I moved back to Tomcat 7, no change otherwise to config, etc.  The problem
 went away on all servers.   So it's definitely related to TC 8.

 Please help.  I want to move up to TC 8.  Do I need to make some mandatory
 config changes to something to make TC 8 happy with regard to SQL
 connections?  Or do I have some catastrophic bug in my code with regard to
 connections that TC7 was letting slide and TC8 is now enforcing?  If so, is
 there a way to monitor TC's connection pool stats and figure this out?

 Thanks.

 Jerry





 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: tomcat-jdbc PoolCleaner deadlock

2015-02-06 Thread Filip Hanik
thank you Robert!

On Fri, Feb 6, 2015 at 11:14 AM, Robert Anderson ranom...@gmail.com wrote:

 Hi,

 After a full week of normal usage, no deadlocks were found.


 Thank you very much.

 Robert



 2015-01-30 16:38 GMT-03:00 Robert Anderson ranom...@gmail.com:

  Ok, Filip!
 
  Thanks,
 
  Robert
 
  2015-01-30 16:31 GMT-03:00 Filip Hanik fi...@hanik.com:
 
  Robert, kindly let us know if disabling the pool cleaner does resolve
 your
  dead lock
 
  Filip
 
 
  On Fri, Jan 30, 2015 at 12:25 PM, Robert Anderson ranom...@gmail.com
  wrote:
 
   Great, Filip!
  
   Returns true if the pool sweeper is enabled for the connection pool.
  The
   pool sweeper is enabled if any settings that require async
 intervention
  in
   the pool are turned on boolean result =
   getTimeBetweenEvictionRunsMillis()0; result = result 
   (isRemoveAbandoned()  getRemoveAbandonedTimeout()0); result =
 result
  ||
   (isTestWhileIdle()  getValidationQuery()!=null); return result; [1]
  
   Best regards.
  
  
   [1]
  
  
 
 https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/tomcat/jdbc/pool/PoolConfiguration.html#isPoolSweeperEnabled()
  
   2015-01-30 16:13 GMT-03:00 Filip Hanik fi...@hanik.com:
  
Are you seeing that message, cause it seems to be a defensive check,
  but
wouldn't happen due to
   
509 public void initializePoolCleaner(PoolConfiguration properties)
 {
  510
//if
the evictor thread is supposed to run, start it now 511 if
  (properties.
isPoolSweeperEnabled()) { 512 poolCleaner = new PoolCleaner(this,
properties
.getTimeBetweenEvictionRunsMillis()); 513 poolCleaner.start(); 514 }
   //end
if 515 }
   
On Fri, Jan 30, 2015 at 12:05 PM, Robert Anderson 
 ranom...@gmail.com
  
wrote:
   
 Filip,

 timeBetweenEvictionRunsMillis=0 does not disable PoolCleaner [1].

   
   
   

 if (sleepTime = 0) {
 log.warn(Database connection pool evicter thread
 interval is set to 0, defaulting to 30 seconds);
 this.sleepTime = 1000 * 30;
 } else if (sleepTime  1000) {
 log.warn(Database connection pool evicter thread
 interval is set to lower than 1 second.);
 }

   
   
   


 [1]

   
  
 
 http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java


 2015-01-30 15:17 GMT-03:00 Robert Anderson ranom...@gmail.com:

  Sorry,
 
  [1] https://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
 
  2015-01-30 15:15 GMT-03:00 Robert Anderson ranom...@gmail.com
 :
 
  Filip,
 
  however, disabling the pool cleaner it should yield better
  results.
 
  The documention[1] says:
 
  This value should not be set under 1 second
 
  Isn't true?
 
 
 
  2015-01-30 15:07 GMT-03:00 Filip Hanik fi...@hanik.com:
 
  Looking at the locks that are involved in the dead lock, it's
  all in
the
  intersys traces. Furthermore, it seems as intersys may already
  be
doing
  pooling inside the driver. If that is the case, you have two
   options
 
  1. disable pooling in intersys OR
  2. don't use tomcat's jdbc pool since intersys already does
  pooling
 
  however, disabling the pool cleaner it should yield better
  results.
 
  On Fri, Jan 30, 2015 at 11:02 AM, Filip Hanik 
 fi...@hanik.com
wrote:
 
   Disable the pool cleaner
  
   timeBetweenEvictionRunsMillis=0
  
  
  
 
 
 
 

   
  
 
 
 



Re: tomcat-jdbc PoolCleaner deadlock

2015-01-30 Thread Filip Hanik
Looking at the locks that are involved in the dead lock, it's all in the
intersys traces. Furthermore, it seems as intersys may already be doing
pooling inside the driver. If that is the case, you have two options

1. disable pooling in intersys OR
2. don't use tomcat's jdbc pool since intersys already does pooling

however, disabling the pool cleaner it should yield better results.

On Fri, Jan 30, 2015 at 11:02 AM, Filip Hanik fi...@hanik.com wrote:

 Disable the pool cleaner

 timeBetweenEvictionRunsMillis=0





Re: tomcat-jdbc PoolCleaner deadlock

2015-01-30 Thread Filip Hanik
Disable the pool cleaner

timeBetweenEvictionRunsMillis=0


Re: tomcat-jdbc PoolCleaner deadlock

2015-01-30 Thread Filip Hanik
Robert, it should say, if you set a positive value, the value should not be
less than 1000ms. Otherwise you are hammering the system with eviction
checks.
Setting the value to 0, disables the check all together. There are other
ways to disable the same check by setting other flags,

918 @Override 919 public boolean isPoolSweeperEnabled() { 920 boolean timer
= getTimeBetweenEvictionRunsMillis()0; 921 boolean result = timer  (
isRemoveAbandoned()  getRemoveAbandonedTimeout()0); 922 result = result
|| (timer  getSuspectTimeout()0); 923 result = result || (timer 
isTestWhileIdle()  getValidationQuery()!=null); 924 result = result || (
timer  getMinEvictableIdleTimeMillis()0); 925 return result; 926 }

On Fri, Jan 30, 2015 at 11:17 AM, Robert Anderson ranom...@gmail.com
wrote:

 Sorry,

 [1] https://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

 2015-01-30 15:15 GMT-03:00 Robert Anderson ranom...@gmail.com:

  Filip,
 
  however, disabling the pool cleaner it should yield better results.
 
  The documention[1] says:
 
  This value should not be set under 1 second
 
  Isn't true?
 
 
 
  2015-01-30 15:07 GMT-03:00 Filip Hanik fi...@hanik.com:
 
  Looking at the locks that are involved in the dead lock, it's all in the
  intersys traces. Furthermore, it seems as intersys may already be doing
  pooling inside the driver. If that is the case, you have two options
 
  1. disable pooling in intersys OR
  2. don't use tomcat's jdbc pool since intersys already does pooling
 
  however, disabling the pool cleaner it should yield better results.
 
  On Fri, Jan 30, 2015 at 11:02 AM, Filip Hanik fi...@hanik.com wrote:
 
   Disable the pool cleaner
  
   timeBetweenEvictionRunsMillis=0
  
  
  
 
 
 



Re: tomcat-jdbc PoolCleaner deadlock

2015-01-30 Thread Filip Hanik
Are you seeing that message, cause it seems to be a defensive check, but
wouldn't happen due to

509 public void initializePoolCleaner(PoolConfiguration properties) { 510 //if
the evictor thread is supposed to run, start it now 511 if (properties.
isPoolSweeperEnabled()) { 512 poolCleaner = new PoolCleaner(this, properties
.getTimeBetweenEvictionRunsMillis()); 513 poolCleaner.start(); 514 } //end
if 515 }

On Fri, Jan 30, 2015 at 12:05 PM, Robert Anderson ranom...@gmail.com
wrote:

 Filip,

 timeBetweenEvictionRunsMillis=0 does not disable PoolCleaner [1].





 if (sleepTime = 0) {
 log.warn(Database connection pool evicter thread
 interval is set to 0, defaulting to 30 seconds);
 this.sleepTime = 1000 * 30;
 } else if (sleepTime  1000) {
 log.warn(Database connection pool evicter thread
 interval is set to lower than 1 second.);
 }






 [1]
 http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java


 2015-01-30 15:17 GMT-03:00 Robert Anderson ranom...@gmail.com:

  Sorry,
 
  [1] https://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
 
  2015-01-30 15:15 GMT-03:00 Robert Anderson ranom...@gmail.com:
 
  Filip,
 
  however, disabling the pool cleaner it should yield better results.
 
  The documention[1] says:
 
  This value should not be set under 1 second
 
  Isn't true?
 
 
 
  2015-01-30 15:07 GMT-03:00 Filip Hanik fi...@hanik.com:
 
  Looking at the locks that are involved in the dead lock, it's all in the
  intersys traces. Furthermore, it seems as intersys may already be doing
  pooling inside the driver. If that is the case, you have two options
 
  1. disable pooling in intersys OR
  2. don't use tomcat's jdbc pool since intersys already does pooling
 
  however, disabling the pool cleaner it should yield better results.
 
  On Fri, Jan 30, 2015 at 11:02 AM, Filip Hanik fi...@hanik.com wrote:
 
   Disable the pool cleaner
  
   timeBetweenEvictionRunsMillis=0
  
  
  
 
 
 
 



Re: tomcat-jdbc PoolCleaner deadlock

2015-01-30 Thread Filip Hanik
Robert, kindly let us know if disabling the pool cleaner does resolve your
dead lock

Filip


On Fri, Jan 30, 2015 at 12:25 PM, Robert Anderson ranom...@gmail.com
wrote:

 Great, Filip!

 Returns true if the pool sweeper is enabled for the connection pool. The
 pool sweeper is enabled if any settings that require async intervention in
 the pool are turned on boolean result =
 getTimeBetweenEvictionRunsMillis()0; result = result 
 (isRemoveAbandoned()  getRemoveAbandonedTimeout()0); result = result ||
 (isTestWhileIdle()  getValidationQuery()!=null); return result; [1]

 Best regards.


 [1]

 https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/tomcat/jdbc/pool/PoolConfiguration.html#isPoolSweeperEnabled()

 2015-01-30 16:13 GMT-03:00 Filip Hanik fi...@hanik.com:

  Are you seeing that message, cause it seems to be a defensive check, but
  wouldn't happen due to
 
  509 public void initializePoolCleaner(PoolConfiguration properties) { 510
  //if
  the evictor thread is supposed to run, start it now 511 if (properties.
  isPoolSweeperEnabled()) { 512 poolCleaner = new PoolCleaner(this,
  properties
  .getTimeBetweenEvictionRunsMillis()); 513 poolCleaner.start(); 514 }
 //end
  if 515 }
 
  On Fri, Jan 30, 2015 at 12:05 PM, Robert Anderson ranom...@gmail.com
  wrote:
 
   Filip,
  
   timeBetweenEvictionRunsMillis=0 does not disable PoolCleaner [1].
  
 
 
 
  
   if (sleepTime = 0) {
   log.warn(Database connection pool evicter thread
   interval is set to 0, defaulting to 30 seconds);
   this.sleepTime = 1000 * 30;
   } else if (sleepTime  1000) {
   log.warn(Database connection pool evicter thread
   interval is set to lower than 1 second.);
   }
  
 
 
 
  
  
   [1]
  
 
 http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
  
  
   2015-01-30 15:17 GMT-03:00 Robert Anderson ranom...@gmail.com:
  
Sorry,
   
[1] https://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
   
2015-01-30 15:15 GMT-03:00 Robert Anderson ranom...@gmail.com:
   
Filip,
   
however, disabling the pool cleaner it should yield better results.
   
The documention[1] says:
   
This value should not be set under 1 second
   
Isn't true?
   
   
   
2015-01-30 15:07 GMT-03:00 Filip Hanik fi...@hanik.com:
   
Looking at the locks that are involved in the dead lock, it's all in
  the
intersys traces. Furthermore, it seems as intersys may already be
  doing
pooling inside the driver. If that is the case, you have two
 options
   
1. disable pooling in intersys OR
2. don't use tomcat's jdbc pool since intersys already does pooling
   
however, disabling the pool cleaner it should yield better results.
   
On Fri, Jan 30, 2015 at 11:02 AM, Filip Hanik fi...@hanik.com
  wrote:
   
 Disable the pool cleaner

 timeBetweenEvictionRunsMillis=0



   
   
   
   
  
 



Re: Occasional long wait for a JDBC connection

2015-01-14 Thread Filip Hanik
The timeout happens in your SocketRead, this is configurable (default is
forever)
http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html

what appears to be happening is that somewhere there isn't a reset packet
sent from the server to the JDBC driver. Setting a timeout may alleviate
this. This property is not the same as query timeout, this is simply a
timeout in between packets. but if you have long running queries, this may
affect it.

*socketTimeout*



On Wed, Jan 14, 2015 at 11:44 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Darren,

 On 1/13/15 11:32 PM, Darren Davis wrote:
  On Tue, Jan 13, 2015 at 8:39 PM, Christopher Schultz 
  ch...@christopherschultz.net wrote:
 
  Darren,
 
  (Sorry... just had to remove that monstrous stack trace...)
 
  On 1/13/15 5:04 PM, Darren Davis wrote:
  Hi Christopher.  Yes, we've tried a show process list and can
  find no evidence of the validation query running on mysql.
 
  Strange. Maybe you are waiting for the db server's buffer to flush
  or something like that.
 
 
  I think this is because the client thinks it still has an open
  connection, the client net stat command shows an open connection
  over port 3306, at least for a few minutes after it's killed by
  the load balancer.  The Server loses its connection in netstat
  immediately.
 
 
  We also just tried an experiment outside of Tomcat
  completely, but connecting to a downed web server host and
  manually opening up a mysql client connection to the data
  server and executing a single command.
 
  We left that client window idle for an hour and 5 minutes,
  and attempted to execute a simple select count(*) command
  against a tiny table.  The client attempted to execute the
  query, and a NetStat on that box showed an open connection
  between the two servers using port 3306.  We also checked the
  process list during this time and could not find any queries
  at all from the sever in question.
 
  At about the 15 minute wait mark, the client finally came
  back with this message: ERROR 2013 (HY000): Lost connection
  to MySQL server during query.
 
  Was this with the MySQL command-line client? What query did you
  issue (SELECT 1)?
 
 
  Yes, it was just the command line client, and we issued a select
  count(*) from a table with a couple rows in it.
 
 
  Attempting the execute the command a 2nd time (using the up
  arrow), re-established the connection and it ran perfectly in
  a few milliseconds.
 
  That's interesting. I've never experienced anything like that with
  MySQL, but we use a VLAN between our application and database
  servers with no hardware firewall, so we don't have any connection
  timeout problems. Also, when connections are dropped due to
  inactivity, they re-connect without any problems.
 
  I checked the mysql configuration and it is set to the
  default values for keeping connections/interactive
  connections open (for 8 hours), so it seems that maybe the
  Cisco firewall between the two servers is terminating
  connections out from under us, but in a way what the O/S
  cannot detect it.
 
  What if you set that idle connection timeout to something like 5
  minutes? Can you reproduce this issue more quickly? Can you look
  at the fw configuration to see if you can change the idle timeout
  /down/ to something more testable?
 
  As part of our move to the new versions of Tomcat/Java, we are in a
  new
  cloud environment which features a different type of firewall.
  The provider confirmed to us late today, that it is configured to
  kill idle TCP connections after an hour, which is something our
  old firewall didn't do.
 
  Because we sometimes have low traffic during this time of the
  year, especially on the weekends, what we think is happening is
  that one or more of the minimum 10 connections is going unused
  for more than an hour, and since we didn't have any connection
  testing while idle turned on, they were being killed by the
  firewall out from under the pool, and depending on how soon they
  were used after that, we would run into the 15 minute delay
  before they were deemed lost, and replaced with a new
  connection.

 This should be entirely possible. That's the point of the
 connection-validation operation (whether done by an actual query or
 not). The question is why the connection is being dropped in a way
 that is thwarting the connection-validation at all. It may come down
 to some kind of OS-level setting, or a slightly different
 configuration on the firewall.

 It seems that removing the firewall's idle-connection policy would be
 an easy way to try to get around this issue at least temporarily.

  I've also fired up the yourKit profiler on this box and am
  seeing other threads which have had to wait in the same
  SocketInputStream.read code, all three started a few seconds
  apart, it just wasn't detected as a deadlock, because it took
  

Re: Help! Tomcat crashing on takeoff

2014-12-12 Thread Filip Hanik
Couple of things that comes to mind

1. the 'java' binary that gets executed is actually not the one you think
it is
2. the file /wintouch/tomcat/bin/bootstrap.jar is corrupted or not readable
by the JVM hence it can't find the class

Filip




On Fri, Dec 12, 2014 at 11:27 AM, James H. H. Lampert 
jam...@touchtonecorp.com wrote:

 On 12/12/14 10:02 AM, Caldarale, Charles R wrote:

 From: James H. H. Lampert [mailto:jam...@touchtonecorp.com]
 Subject: Help! Tomcat crashing on takeoff


  I'm trying to bring up Tomcat on a customer's AS/400.


 Don't suppose you'd want to give us a clue as to _exactly_ which
 version of Tomcat you're trying to run?


 Certainly.

 The customer box (an AS/400 at V6R1) is, according to RELEASE-NOTES, on
 7.0.56. Our box (another AS/400 at V6R1) is on 7.0.54. We have another
 customer box (another AS/400, this one at V7R1) that is running 7.0.56 just
 fine.

 I just wiped out the /wintouch/tomcat directory (same convention we use at
 all of our Tomcat installations), re-unzipped it, and tried to launch it
 without doing any of our usual configuration changes (e.g., enabling SSL,
 setting up a user for Manager). It still crashed exactly the same way.

 --
 James H. H. Lampert

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Help! Tomcat crashing on takeoff

2014-12-12 Thread Filip Hanik
possibly add

 -verbose:class

to your JVM options and see if that yields anything

On Fri, Dec 12, 2014 at 1:44 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 James,

 On 12/12/14 3:19 PM, James H. H. Lampert wrote:
  On 12/12/14 11:43 AM, Christopher Schultz wrote:
  I wouldn't be surprised if the AS/400 unzip software does Bad
  Things to ZIP archives. Make sure you use UNIX-compatible tools
  to unpack everything, or maybe do everything from inside that
  UNIX-like environment (I seem to recall that, while you are
  running AS/400's i OS, you are also running some kind of
  UNIX-like environment on top of it). You might even want to check
  MD5 digest or something similar on the two machines to see if any
  files have been corrupted.
 
  EBCDIC can certainly be confusing things, here.
 
  What AS/400 unzip software?

 Hah, I can't tell if that's a joke or not.

  When we unzip the Tomcat zip file on a system, we use JAR, in a
  QSHELL session. And likewise, JAR tvm jarname.jar shows what
  appear to be a good bin/bootstrap.jar, a good bin/tomcat-juli.jar,
  and a good lib/catalina.jar

 Okay, good so far. Is there any way to run md5sum or something similar
 against them to determine that they are byte-for-byte identical to
 what you have on the other (working) system?

 jar should be able to unzip the Tomcat .zip distribution without any
 problems (JAR is just ZIP with a MANIFEST.MF file... and even that
 isn't required).

  Now, KEYTOOL is a worthless mess on AS/400s, but I've never seen
  anything like this happen from using JAR on AS/400s.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUi1OvAAoJEBzwKT+lPKRYtwwP/i5XAtDgSXn0QjsZzYzLpKvF
 ygL/uK4LXqClHiiaOUHPYYRo9mDw3S1h3EsF6gr1qepoyZgGvxENd+q/8EfBJsT3
 HSng3hkKSB2vrMGJDhCf0utXVXPfOm3c60OHiH4TKizQs/k6GYA0tvTSWX/pfPRg
 8I2xuOHwe0FYX/9Xe5GyDnVKwC1J5/Omgsb4Fj9XL9WuvwJcmuDDyxQY0YyzjeWq
 1sVdCOjFJUI6yD9qp7/76bKmh3Jd1m9gmjVhHtEO039k/wfq0du8LpfS5OpqZtjh
 uprHdKqZl+VfhVKA0tv2iOEaORy6KlNIqbpVJ6w9fYe06ELoO4fNWu158wGk8EWd
 Hq0uO1EfTCW8YfyjjAj2Sl1y/6JnPM5vhCgxnuQGRJWY2ag/NDDBVzPLaN6aQptk
 QzLyDExM5TX25+CvNtjvUycueVlAfhDad5YCVIHPyBsq/JmUNarOGNvS7zcoBVZV
 iEfKEwXguTwqSh3+5/ebeECPmAyPID0yF5ed/uQ8VX71A9Sv/fF31qFyhi3LKLxS
 WHnBRp4b/iXqRtIUCv/VRkg8tedGYyzGbWFV+e++Y7l2FQRbLGo+55h4xT7vQllS
 Ypp9qnIW+x5Sqgc6G9qZ3/aoTLbrXV+9yObV2aR2x5J1WTp1Yl00BgQEWmJbsiWz
 u7lGL0iCpbyS4DhgBzIY
 =u7Ly
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Help! Tomcat crashing on takeoff

2014-12-12 Thread Filip Hanik
or

-Dibm.cl.verbose=ClassToTrace


On Fri, Dec 12, 2014 at 2:26 PM, Filip Hanik fi...@hanik.com wrote:

 possibly add

  -verbose:class

 to your JVM options and see if that yields anything

 On Fri, Dec 12, 2014 at 1:44 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 James,

 On 12/12/14 3:19 PM, James H. H. Lampert wrote:
  On 12/12/14 11:43 AM, Christopher Schultz wrote:
  I wouldn't be surprised if the AS/400 unzip software does Bad
  Things to ZIP archives. Make sure you use UNIX-compatible tools
  to unpack everything, or maybe do everything from inside that
  UNIX-like environment (I seem to recall that, while you are
  running AS/400's i OS, you are also running some kind of
  UNIX-like environment on top of it). You might even want to check
  MD5 digest or something similar on the two machines to see if any
  files have been corrupted.
 
  EBCDIC can certainly be confusing things, here.
 
  What AS/400 unzip software?

 Hah, I can't tell if that's a joke or not.

  When we unzip the Tomcat zip file on a system, we use JAR, in a
  QSHELL session. And likewise, JAR tvm jarname.jar shows what
  appear to be a good bin/bootstrap.jar, a good bin/tomcat-juli.jar,
  and a good lib/catalina.jar

 Okay, good so far. Is there any way to run md5sum or something similar
 against them to determine that they are byte-for-byte identical to
 what you have on the other (working) system?

 jar should be able to unzip the Tomcat .zip distribution without any
 problems (JAR is just ZIP with a MANIFEST.MF file... and even that
 isn't required).

  Now, KEYTOOL is a worthless mess on AS/400s, but I've never seen
  anything like this happen from using JAR on AS/400s.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUi1OvAAoJEBzwKT+lPKRYtwwP/i5XAtDgSXn0QjsZzYzLpKvF
 ygL/uK4LXqClHiiaOUHPYYRo9mDw3S1h3EsF6gr1qepoyZgGvxENd+q/8EfBJsT3
 HSng3hkKSB2vrMGJDhCf0utXVXPfOm3c60OHiH4TKizQs/k6GYA0tvTSWX/pfPRg
 8I2xuOHwe0FYX/9Xe5GyDnVKwC1J5/Omgsb4Fj9XL9WuvwJcmuDDyxQY0YyzjeWq
 1sVdCOjFJUI6yD9qp7/76bKmh3Jd1m9gmjVhHtEO039k/wfq0du8LpfS5OpqZtjh
 uprHdKqZl+VfhVKA0tv2iOEaORy6KlNIqbpVJ6w9fYe06ELoO4fNWu158wGk8EWd
 Hq0uO1EfTCW8YfyjjAj2Sl1y/6JnPM5vhCgxnuQGRJWY2ag/NDDBVzPLaN6aQptk
 QzLyDExM5TX25+CvNtjvUycueVlAfhDad5YCVIHPyBsq/JmUNarOGNvS7zcoBVZV
 iEfKEwXguTwqSh3+5/ebeECPmAyPID0yF5ed/uQ8VX71A9Sv/fF31qFyhi3LKLxS
 WHnBRp4b/iXqRtIUCv/VRkg8tedGYyzGbWFV+e++Y7l2FQRbLGo+55h4xT7vQllS
 Ypp9qnIW+x5Sqgc6G9qZ3/aoTLbrXV+9yObV2aR2x5J1WTp1Yl00BgQEWmJbsiWz
 u7lGL0iCpbyS4DhgBzIY
 =u7Ly
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Help! Tomcat crashing on takeoff

2014-12-12 Thread Filip Hanik
On Fri, Dec 12, 2014 at 3:55 PM, James H. H. Lampert 
jam...@touchtonecorp.com wrote:


 On Fri, Dec 12, 2014 at 2:26 PM, Filip Hanik fi...@hanik.com wrote:


  possibly add

 -verbose:class

 to your JVM options and see if that yields anything


 On 12/12/14 1:27 PM, Filip Hanik wrote: or


 -Dibm.cl.verbose=ClassToTrace


 Again calling /wintouch/tomcat/bin/startup.sh from an interactive QSHELL
 session, first with just the one, then with both, added to the JAVA_OPTS
 environment variable: No change, with either. Still the same exceptions in
 catalina.out; still the same information to STDOUT; still the same joblogs
 produced by calling the shell script from an interactive QSHELL session.


​We're not looking for change, we're looking for the output, that may tell
us what is going on. Please post it, if you're not getting any output, then
either those aren't supported (which I definitely thought they would be),
or you're invoking it incorrectly

Filip


Re: Help! Tomcat crashing on takeoff

2014-12-12 Thread Filip Hanik
It means they didn't take into effect.

On the command line you should be able to do

 java -verbose:class -version

and see if that flag works, if it does, then I suggest you create a
setenv.sh file next to startup.sh and put

JAVA_OPTS=-verbose:class -Dibm.cl.verbose=ClassToTrace
export JAVA_OPTS

and hopefully that way it takes into effect



On Fri, Dec 12, 2014 at 6:47 PM, James H. H. Lampert 
jam...@touchtonecorp.com wrote:

 On 12/12/14 5:36 PM, Filip Hanik wrote:

  ​We're not looking for change, we're looking for the output, that may tell
 us what is going on. Please post it, if you're not getting any output,
 then
 either those aren't supported (which I definitely thought they would be),
 or you're invoking it incorrectly


 Of course I wasn't expecting any change in behavior. No change
 implicitly meant no change in the output. And I then explicitly said that
 the exceptions in catalina.out look the same, what gets sent to STDOUT
 looks the same, and the joblogs from what QSHELL spawned off look the same.

 If there's anyplace else that additional output from those parameters
 could have gone, besides catalina.out, STDOUT, or a spool file, I can't
 imagine where, and I have over 20 years of experience with AS/400s.


 --
 JHHL

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat JDBC connection pool: Using initSql together with validatorClassName

2014-12-03 Thread Filip Hanik
You should be able to run init SQL commands yourself in your custom
validator

https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/tomcat/jdbc/pool/Validator.html




On Wed, Dec 3, 2014 at 11:42 AM, Wes Clark wcl...@guidewire.com wrote:

 These actions seems to incorrectly conflated in the code.  I'd also like
 to do the same thing, so if you get it working, keep me posted.

 -Original Message-
 From: Iris Hupkens [mailto:i.hupk...@topdesk.com]
 Sent: Wednesday, December 03, 2014 5:14 AM
 To: 'users@tomcat.apache.org'
 Subject: Tomcat JDBC connection pool: Using initSql together with
 validatorClassName

 Hello,

 I am using the Tomcat JDBC connection pool (version 7.0.55) as a
 stand-alone library. The connection pool is configured with a custom
 validator class in order to use the JDBC4 isValid method for connection
 validation.  I would also like to use initSql to perform some preparation
 on all connections created in the pool (such as setting sorting to case
 insensitive under Oracle). However, it appears that initSql does not work
 in combination with a validator class.

 Looking at the source, the code that executes the initSql statement is
 skipped if a validator class is configured. The documentation for initSql
 states that it is executed in place of the validation query when
 connections are initialized, but the method which does the validation first
 checks if there is a validator class that should be used instead, and then
 returns immediately.

 I was wondering: is this a bug, or is it intentionally not possible? If
 it's intentional, is there perhaps a different way to configure the Tomcat
 connection pool to use both a custom validator class and execute initial
 SQL statements when first creating a connection?

 Kind regards,
 Iris Hupkens

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat JDBC pool - too many connections in TIME_WAIT state

2014-11-05 Thread Filip Hanik
this is part of the TCP lifecycle, you can adjust this timeout yourself on
the Operating system level

http://www.cs.northwestern.edu/~agupta/cs340/project2/TCPIP_State_Transition_Diagram.pdf

cat /proc/sys/net/ipv4/tcp_fin_timeoutecho 15 
/proc/sys/net/ipv4/tcp_fin_timeout


On Wed, Nov 5, 2014 at 7:36 AM, Daniel Mikusa dmik...@pivotal.io wrote:

 On Wed, Nov 5, 2014 at 9:13 AM, Vasily Kukhta v.b.kuk...@gmail.com
 wrote:

  Hello all!
 
  I have developed an application using Tomcat JDBC pool. Everything is
 fine
  except that the pool leaves hundreds of TCP connections in TIME_WAIT
 state,
 

 I have to ask, but are you sure it's the pool?  TCP connections in the
 TIME_WAIT state would indicate that a connection was closed.  Given that
 the job of the pool is to keep the connections open and reuse them, it just
 seems a little odd.


  which kills the server sooner or later... Could you please suggest what
 to
  fix, my configuration is below:
 
  PoolProperties pp = new PoolProperties();
 
  String connprops =
 
 
 oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=3000;oracle.net.READ_TIMEOUT=3000;
 
  pp.setUsername(user);
  pp.setPassword(pass);
  pp.setConnectionProperties(connprops);
 
  pp.setDriverClassName(oracle.jdbc.OracleDriver);
 
  pp.setTestOnBorrow(true);
  pp.setTestOnConnect(true);
 
  pp.setTestWhileIdle(true);
 
  pp.setMaxWait(1000);
  pp.setMinEvictableIdleTimeMillis(1);
  pp.setTimeBetweenEvictionRunsMillis(5000);
 
  pp.setValidationInterval(1);
  pp.setValidationQuery(SELECT 1 FROM DUAL);
 
  pp.setRemoveAbandoned(true);
  pp.setRemoveAbandonedTimeout(5);
 
 
 
 pp.setJdbcInterceptors(org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor(queryTimeout=3));
  dataSource = new DataSource();
  dataSource.setPoolProperties(pp);
 

 Nothing is jumping out at me as incorrect.  Maybe try without the
 connection properties (i.e. the driver level timeouts)?  Maybe try
 increasing the log level for org.apache.tomcat.jdbc.pool to FINEST or
 DEBUG.  That might generate some additional logging to show why the
 connections are being closed.

 Also, check that your server is not timing out the connection, perhaps due
 to a server side limit.  I've see this happen a lot.  Although it seems
 unlikely, it's probably also worth checking that there's no firewall or
 network device that could be closing the connections.

 Dan


  Thank you in advance!
 



Re: Debugging Tomcat JDBC pool disconnects.

2014-09-24 Thread Filip Hanik
If you implement a JdbcInterceptor, the method JdbcInterceptor.disconnected
will always be called.
If the disconnect is permanent, then JdbcInterceptor.reset(null,null) will
be called after disconnected

On Tue, Sep 23, 2014 at 9:41 AM, Todd Chapman t...@chaka.net wrote:

 Hi,

 My application uses the Tomcat JDBC pool. While using netstat and tcpdump
 to diagnose connection problems I noticed that the client side occasionally
 closes a DB connection and opens a new one. That is unexpected based on my
 configuration.

 poolProperties.setInitialSize(10);
 poolProperties.setMinIdle(10);
 poolProperties.setMaxActive(100);
 poolProperties.setMaxIdle(100);
 poolProperties.setMaxWait(1);
 poolProperties.setTimeBetweenEvictionRunsMillis(3);
 poolProperties.setMinEvictableIdleTimeMillis(3);
 poolProperties.setTestWhileIdle(false);
 poolProperties.setTestOnBorrow(true);
 poolProperties.setValidationQuery(SELECT 1 AS data);
 poolProperties.setValidationInterval(3);
 poolProperties.setLogValidationErrors(true);
 poolProperties.setTestOnReturn(false);
 poolProperties. maxAge(0);

 I would expect the pool size to never shrink based on this configuration.
 Well maybe if borrow test fails but no validation errors are being logged.

 How can I figure out where close() is being called on the physical DB
 connection? I tried writing a JdbcInterceptor but it's disconnected()
 method gets called on the PooledConnection, not the physical connection.

 Does Tomcat JDBC Pool implement javax.sql.ConnectionEventListener
 interface?

 Thanks you for any help,

 -Todd



Re: [ANN] New committer: Felix Schumacher

2014-09-19 Thread Filip Hanik
Welcome aboard!! Start committing :)

On Fri, Sep 19, 2014 at 6:28 AM, Tim Funk funk...@apache.org wrote:

 +1 Awesome! Welcome!

 -Tim

 On Fri, Sep 19, 2014 at 3:49 AM, Rainer Jung rj...@apache.org wrote:

  On behalf of the Tomcat committers I am pleased to announce that
  Felix Schumacher (fschumacher) has been voted in as a new Tomcat
 committer.
 
  Please join me in welcoming him.
 
  Regards,
 
  Rainer
 
 



Re: Connection count explosion due to thread http-nio-80-ClientPoller-x death

2014-09-18 Thread Filip Hanik
Thanks Lars, if you are indeed experiencing a non caught error, let us know
what it is.

On Thu, Sep 18, 2014 at 2:30 AM, Lars Engholm Johansen lar...@gmail.com
wrote:

 Thanks guys for all the feedback.

 I have tried the following suggested tasks:

- Upgrading Tomcat to the newest 7.0.55 on all our servers - Problem
still persists
- Force a System.gc() when connection count is on the loose -
Connection count is not dropping
- Lowering the log level of NioEndpoint class that contains the Poller
code - No info about why the poller thread exits in any tomcat logs
- Reverting the JVM stack size per thread to the default is discussed
previously - Problem still persists

 I have now checked out the NioEndpoint source code and recompiled it with a
 logging try-catch surrounding the whole of the Poller.run() implementation
 as I noticed that the outer try-catch here only catches OOME.
 I will report back with my findings as soon as the problem arises again.

 /Lars



 On Fri, Jun 27, 2014 at 9:02 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA256
 
  Filip,
 
  On 6/27/14, 11:36 AM, Filip Hanik wrote:
   Are there any log entries that would indicate that the poller
   thread has died? This/these thread/s start when Tomcat starts. and
   a stack over flow on a processing thread should never affect the
   poller thread.
 
  OP reported in the initial post that the thread had disappeared:
 
  On 6/16/14, 5:40 AM, Lars Engholm Johansen wrote:
   We have no output in tomcat or our logs at the time when this event
occurs. The only sign is when comparing full java thread dump with
   a dump from a newly launched Tomcat:
  
   One of  http-nio-80-ClientPoller-0  or  http-nio-80-ClientPoller-1
   is missing/has died.
 
  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1
  Comment: GPGTools - http://gpgtools.org
  Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
  iQIcBAEBCAAGBQJTrb+yAAoJEBzwKT+lPKRYhYEP/05kiei/EUFhtxL6RMIl70Ok
  cb3I9XEvrQDBTkEDnGLvxw8MQSs6ocHaxdEOxzie289sYxvkuLWxOsKpikWkuUHH
  pEgHM5WuGuCS2AmcrTGiH6WPCnNAj8YM/zyx25NZOn8turWIbvh8GRzBFf265qP5
  79z2Vb15NisYyNEqvkWHvli5CeDeOW2fgHcgv5Ec5fWb1/KyXAyVtRmEWnHpy/LB
  j/VLjzbBtFSJGT64W4i572qQ7C+f/XRgNzV6Fh/53gwPf+ggz5vKS9XEQEpa5SOz
  rlTrWuVs+WehBoCLE9TZB2J+argV7noqSQDumYcXeSf/4THkfhbhAlcBKXa/YLgH
  Paip710VV6S+9K1dAZOt4i1h28YXZ+qNviO6b/auo1DEdt21ezpklEOQyZbQcHYf
  H4VZ2mcSaMQo3QpWpze6QxvSsRZFAofpkLoqCRfsORlnV2c2xfjhRC1YtZ0sshfM
  zNnWQCEjRe5V+UB69mtjatJrDG16qjTcUZQlot3r4zxdjMq5D0W9XmC6WH2eCXhl
  aeH8SMISdn4GcYGMoUm7hWSWHs5azyBPma9AWJfYC+mLk8UbmvLP9gZN+KWenWOr
  xLiqCgMUvpLiOFsbNs8oWMDWGW59xT2zBjS3Aa20ZYJP/GeLWJkOrAPwTeqIaXG+
  tV1WjkDkejPrC4WWKwzm
  =sTia
  -END PGP SIGNATURE-
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 



Re: Global JNDI resources lookup behavior difference between version 6.0.39 and 6.0.41/7.0.55

2014-09-03 Thread Filip Hanik
can you post your configuration file. that will be the only way we can help
you fix it, as I doubt tomcat will go back to pre 6.0.41 days :)

Filip



On Wed, Sep 3, 2014 at 9:36 AM, Robert Anderson ranom...@gmail.com wrote:

 Hi,


 In a privileged context, a have the following jsp to test a global jndi
 resource:

 %@ page session=false import=java.util.*,java.sql.*,javax.naming.*,
 javax.sql.*,org.apache.commons.dbcp.* contentType=text/html %
 %!

 protected void doLookup(JspWriter out) throws ServletException, IOException
 {
  Context ctx;
  try {
   ctx = new InitialContext();
   Object o = ctx.lookup(java:jdbc/cacheapp);
   out.println(o);


  } catch (NamingException e) {
   out.println(e.getMessage());
  } catch (Exception e) {
  }
  }

 %

 html
 head
   titleTest JNDI/title
 /head
 body

 h1Teste JNDI/h1
 hr/
 %
 doLookup(out);
 %
 hr/

 /body
 /html


 Versions earlier than 6.0.41:

 org.apache.tomcat.jdbc.pool.DataSource@29050dfd
 {ConnectionPool[defaultAutoCommit=null;
 defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null;
 driverClassName=com.intersys.jdbc.CacheDriver; maxActive=10; maxIdle=2;
 minIdle=1; initialSize=10; maxWait=1; testOnBorrow=true;
 testOnReturn=false; timeBetweenEvictionRunsMillis=5000;
 numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=6;
 testWhileIdle=false; testOnConnect=false; password=;
 url=jdbc:Cache://localhost:1972/USER; username=tomcat;
 validationQuery=select 1 from dual; validationQueryTimeout=-1;
 validatorClassName=null; validationInterval=0;
 accessToUnderlyingConnectionAllowed=true; removeAbandoned=true;
 removeAbandonedTimeout=300; logAbandoned=false; connectionProperties=null;
 initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true;
 useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false;
 dataSource=null; dataSourceJNDI=null; suspectTimeout=0;
 alternateUsernameAllowed=true; commitOnReturn=false;
 rollbackOnReturn=false; useDisposableConnectionFacade=true;
 logValidationErrors=false; propagateInterruptState=false;
 ignoreExceptionOnPreLoad=false; }


 6.0.41 and 7.0.55:

 Name jdbc is not bound in this Context

 That is a bug?


 We are having a issue in psi-probe because this behavior change (
 https://code.google.com/p/psi-probe/issues/detail?id=411).


 Thanks in advance.



Re: Global JNDI resources lookup behavior difference between version 6.0.39 and 6.0.41/7.0.55

2014-09-03 Thread Filip Hanik
On Wed, Sep 3, 2014 at 11:09 AM, Robert Anderson ranom...@gmail.com wrote:

 Thanks, Daniel. But my question the question is why that was working in
 6.0.39 and the firsts releases of 7.0.x?
 Tomcat is not bind in java:global name anymore. Was it a feature request
 or is it a bug?


​Not sure, the resource links have been around for a long time. It may have
been a security feature to not expose .
However, I'm sure there was a reason for it, and very unlikely it will
change back
You can get around it by adding a ResourceLink element in your
conf/context.xml, as this setting will apply to all your apps deployed.

Filip



 Em 03/09/2014 13:48, Daniel Mikusa dmik...@pivotal.io escreveu:

  On Wed, Sep 3, 2014 at 11:51 AM, Robert Anderson ranom...@gmail.com
  wrote:
 
   Ok! :)
  
   Steps to reproduce:
  
   1)Download and unpack 6.0.39
  
  
  
 
 http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.39/bin/apache-tomcat-6.0.39.tar.gz
  
   2) Create a global jndi resouce in server.xml
  
   
   GlobalNamingResources
   Resource name=jdbc/cacheapp auth=Container
   type=javax.sql.DataSource removeAbandoned=true
   removeAbandonedTimeout=300
  maxActive=10 maxIdle=2
 minIdle=1
   maxWait=1
  validationQuery=select 1 from dual
  testOnBorrow=true
  validationInterval=0
  username=_system password=SYS
   driverClassName=com.intersys.jdbc.CacheDriver
  
  url=jdbc:Cache://localhost:1972/USER/
  
 /GlobalNamingResources
   ...
  
   3) Install psi-probe:
  
 
 https://code.google.com/p/psi-probe/downloads/detail?name=probe-2.3.3.zip,
   unpack and copy probe.war to webapps dir;
  
   4)  Edit tomcat-users.xml
  
   role rolename=probeuser /
 role rolename=poweruser /
 role rolename=poweruserplus /
 role rolename=manager /
  
 user username=admin password=t0psecret roles=manager /
  
   5) Start tomcat and go to  http://localhost:8080/probe/datasources.htm
  
   It will list global jndi resources.
  
 
  I think the question is how does it list these?  You haven't added any
  resource links, so technically there are no resources available to your
  application through JNDI.  See the Introduction section here, which
 states
  why resource links are necessary.
 
 
 
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/globalresources.html#Introduction
 
  Have you tried looking at your running 6.0.41 server, connecting with JMX
  and looking at the MBeans?  Is your database connection pool resources
  actually available?
 
  Dan
 
 
   Instead of Tomcat 6.0.39, use 6.0.41 and probe will not list global
 jndi
   resources anymore.
  
  
   Thanks.
  
  
  
   2014-09-03 12:39 GMT-03:00 Filip Hanik fi...@hanik.com:
  
can you post your configuration file. that will be the only way we
 can
   help
you fix it, as I doubt tomcat will go back to pre 6.0.41 days :)
   
Filip
   
   
   
On Wed, Sep 3, 2014 at 9:36 AM, Robert Anderson ranom...@gmail.com
wrote:
   
 Hi,


 In a privileged context, a have the following jsp to test a global
  jndi
 resource:

 %@ page session=false
  import=java.util.*,java.sql.*,javax.naming.*,
 javax.sql.*,org.apache.commons.dbcp.* contentType=text/html %
 %!

 protected void doLookup(JspWriter out) throws ServletException,
IOException
 {
  Context ctx;
  try {
   ctx = new InitialContext();
   Object o = ctx.lookup(java:jdbc/cacheapp);
   out.println(o);


  } catch (NamingException e) {
   out.println(e.getMessage());
  } catch (Exception e) {
  }
  }

 %

 html
 head
   titleTest JNDI/title
 /head
 body

 h1Teste JNDI/h1
 hr/
 %
 doLookup(out);
 %
 hr/

 /body
 /html


 Versions earlier than 6.0.41:

 org.apache.tomcat.jdbc.pool.DataSource@29050dfd
 {ConnectionPool[defaultAutoCommit=null;
 defaultReadOnly=null; defaultTransactionIsolation=-1;
defaultCatalog=null;
 driverClassName=com.intersys.jdbc.CacheDriver; maxActive=10;
  maxIdle=2;
 minIdle=1; initialSize=10; maxWait=1; testOnBorrow=true;
 testOnReturn=false; timeBetweenEvictionRunsMillis=5000;
 numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=6;
 testWhileIdle=false; testOnConnect=false; password=;
 url=jdbc:Cache://localhost:1972/USER; username=tomcat;
 validationQuery=select 1 from dual; validationQueryTimeout=-1;
 validatorClassName=null; validationInterval=0;
 accessToUnderlyingConnectionAllowed=true; removeAbandoned=true;
 removeAbandonedTimeout=300; logAbandoned=false;
connectionProperties=null;
 initSQL=null; jdbcInterceptors=null; jmxEnabled=true;
 fairQueue=true;
 useEquals=true; abandonWhenPercentageFull=0; maxAge=0;
 useLock=false;
 dataSource=null

Re: java.lang.IllegalArgumentException at java.nio.Buffer.limit

2014-08-07 Thread Filip Hanik
if you could capture the XML that you are trying to write, we can put it
into a test case and reproduce.

Filip



On Thu, Aug 7, 2014 at 3:24 PM, Terence M. Bandoian tere...@tmbsw.com
wrote:

 On 8/7/2014 10:04 AM, John Smith wrote:

 TC 7.0.54 / RHEL 6 / JDK 1.7.0_60

 I'm getting a pretty consistent error in my logs that started showing up
 recently. I use logback and have a servlet catch all 500 errors and log
 them. The error seems to be associated with one servlet that writes XML
 output.

 Two changes I made recently were implement SSL for one subdirectory on the
 webapp, and removing redirects in IPTables to the HWLB. I can't really
 think of any other code level changes that might have caused the change in
 behavior. Please let me know if you need more information. Any thoughts?

 The writeXML method is:

 protected void writeXML(HttpServletResponse res, String xml) throws
 IOException {
  res.setContentType(text/xml);
  PrintWriter out = res.getWriter();
  out.write(xml);
  out.close();
 }


 The stacktrace almost always looks like this:
 _
 14:18:59.617 [http-nio-8080-exec-45] ERROR c.m.
 SiteExceptionHandlerServlet
 - Stacktrace was: java.lang.IllegalArgumentException
 at java.nio.Buffer.limit(Buffer.java:267)
 at org.apache.tomcat.util.buf.C2BConverter.convert(C2BConverter.java:85)
 at
 org.apache.catalina.connector.OutputBuffer.realWriteChars(
 OutputBuffer.java:481)
 at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:464)
 at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:384)
 at org.apache.catalina.connector.OutputBuffer.write(
 OutputBuffer.java:554)
 at org.apache.catalina.connector.CoyoteWriter.write(
 CoyoteWriter.java:174)
 at org.apache.catalina.connector.CoyoteWriter.write(
 CoyoteWriter.java:184)
 at com.mysite.AbstractServlet.writeXML(AbstractServlet.java:182)
 at com.mysite.level.GetLevelServlet.getAllAsXML(GetLevelServlet.java:82)
 at com.mysite.level.GetLevelServlet.manageActions(
 GetLevelServlet.java:33)
 at com.mysite.AbstractServlet.doPost(AbstractServlet.java:52)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 ...
 __

 Although there are variations like:

 Stacktrace was: java.lang.IllegalArgumentException
 at java.nio.Buffer.position(Buffer.java:236)
 at sun.nio.cs.ISO_8859_1$Encoder.encodeArrayLoop(ISO_8859_1.java:179)
 at sun.nio.cs.ISO_8859_1$Encoder.encodeLoop(ISO_8859_1.java:212)
 at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:561)
 at org.apache.tomcat.util.buf.C2BConverter.convert(C2BConverter.java:108)
 at
 org.apache.catalina.connector.OutputBuffer.realWriteChars(
 OutputBuffer.java:481)
 at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:464)
 at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:384)
 at org.apache.catalina.connector.OutputBuffer.write(
 OutputBuffer.java:554)
 at org.apache.catalina.connector.CoyoteWriter.write(
 CoyoteWriter.java:174)
 at org.apache.catalina.connector.CoyoteWriter.write(
 CoyoteWriter.java:184)
 at com.mysite.AbstractServlet.writeXML(AbstractServlet.java:182)

 ___



 What's on line 182 of AbstractServlet.java?

 -Terence Bandoian


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Query timeouts using tomcat jdbc pool

2014-07-23 Thread Filip Hanik
Vasily, the exception depends on where the timeout occurs.

If the timeout is triggered by the driver, because you hit the
setQueryTimeout limit
http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#setQueryTimeout(int)
then yes, as per javadoc, it is up to the JDBC driver to throw an exception.


Filip




On Wed, Jul 23, 2014 at 10:04 AM, Vasily Kukhta v.b.kuk...@gmail.com
wrote:

 Thank you, I have changed timeBetweenEvictionRunsMillis value and it is
 working properly now. Another problem has appeared: although the timeout is
 handled correctly, no exception is thrown. I thought an SQLException would
 be thrown if query takes too long. Maybe pool does not throw exceptions at
 all in that situation?

 Than you!


 2014-07-21 20:40 GMT+04:00 Daniel Mikusa dmik...@gopivotal.com:

  On Mon, Jul 21, 2014 at 11:05 AM, Vasily Kukhta v.b.kuk...@gmail.com
  wrote:
 
   Hello, dear tomcat users!
  
   I am developing high-load application using tomcat jdbc connection pool
  and
   Oracle database. It is very important to ensure my app to have very
 small
   DB query timeouts (no longer than 3 seconds) to prevent long-running
   queries or database slowness from blocking all my application. To
  simulate
   long-running queries I have put the DB in QUIESCE state using ALTER
  SYSTEM
   QUIESCE RESTRICTED statement.
  
   But it looks like the timeout values have no impact - when i begin to
  test
   my application, it hangs...
  
 
  Have you taken thread dumps of your application when it hangs?  What do
  these show your threads are doing?
 
 
  
   Here is my jdbc pool configuration:
  
   String connprops =
   oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=3000;
   + oracle.net.READ_TIMEOUT=3000;
  
  
   pp.setConnectionProperties(connprops);
  
   pp.setDriverClassName(oracle.jdbc.OracleDriver);
  
   pp.setTestOnBorrow(true);
   pp.setTestOnConnect(true);
 
  pp.setTestOnReturn(true);
   pp.setTestWhileIdle(true);
  
 
  It's probably not necessary to have all of these enabled.  I usually only
  see testOnBorrow and testWhileIdle enabled.  TestOnReturn is almost
  worthless, in my opinion.  TestOnConnect might be helpful to catch
  connection issues at boot, but generally a connection that is just
 created
  should be good unless you have configuration problems.
 
 
   pp.setMaxWait(2000);
   pp.setMinEvictableIdleTimeMillis(2);
  
 
 
   pp.setTimeBetweenEvictionRunsMillis(2);
  
 
  This might be high given your aggressive settings for
  removeAbandonedTimeout.  The timeBetweenEvictionRunsMillis setting
 dictates
  how often the pool looks for idle connections, abandoned connections, and
  how often it validates idle connections.  If you set this to 20 secs,
 using
  an abandoned timeout less than 20 seconds is probably not going to be
  accurate.
 
  For example, if the cleaner thread runs and your application has been
  holding a connection for 2999ms, it won't consider the connection
  abandoned.  However the cleaner thread won't run again for another 20
 secs
  (based on the config value you used), thus the application can continue
  using that connection for way over the abandoned timeout you've
 configured.
 
 
   pp.setValidationInterval(3000);
   pp.setValidationQuery(SELECT 1 FROM DUAL);
  
 
  Seems OK.
 
 
  
   pp.setMaxAge(3000);
  
 
  This seems pretty short and might limit how much pooling actually occurs.
   Also, since this is enforced when you return the connection to the pool
  it's not going to help with your current issue.  What are you trying to
  accomplish by setting this value so low?
 
 
   pp.setRemoveAbandoned(true);
   pp.setRemoveAbandonedTimeout(3);
  
 
  This is a pretty low value for abandoned timeout.  If you're hoping to
 use
  this to limit how long a query can executed, it's probably not the best
  approach. This will limit the amount of time that a connection can be
  checked out of the connection pool, and unless you also configure
  the ResetAbandonedTimer interceptor, it's going to limit the total time
  your application has to use the connection.  If you configure the
  ResetAbandonedTimer interceptor, it will function closer to the use case
  you've described but it's probably not the most efficient way to
 accomplish
  this task.
 
  Generally you'd set the remove abandoned timeout to reclaim connections
  that were not properly closed, not to reclaim connections where a query
 is
  stuck or running for a long time.  I think the jdbc driver can more
 easily
  handle killing stuck / long running queries.  See next comment.
 
 
  
  
  
 
 pp.setJdbcInterceptors(org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor(queryTimeout=3));
  
 
  I'm a little surprised this isn't 

Re: Query timeouts using tomcat jdbc pool

2014-07-23 Thread Filip Hanik
maxAge is not a timeout setting. It simply means the connection gets
retired(closed) instead of returned to the pool after a certain amount of
time

timeBetweenEvictionRunsMillis is not a timeout either. It is the interval
that the thread checks for timeouts, but not query, connection checkout
time out.

removeAbandonedTimeout - is the timeout you're looking for. This is the
timeout for a connection usage. That is the time between the
DataSource.getConnection() call and the Connection.close() call.

And whether an exception is thrown here, depends on the driver. the pool
simply calls close() on the driver connection, if that yields an exception
if another thread is executing a query or not, depends on the driver itself.

See
http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html


On Wed, Jul 23, 2014 at 10:56 AM, Vasily Kukhta v.b.kuk...@gmail.com
wrote:

 So, it means that if the timeout is detected not using setQueryTimeout
 method, but by the tomcat pool settings (setMaxAge or
 setTimeBetweenEvictionRunsMillis), it means that no exception can be thrown
 at all?

 Vasily



 2014-07-23 12:14 GMT+04:00 Filip Hanik fi...@hanik.com:

  Vasily, the exception depends on where the timeout occurs.
 
  If the timeout is triggered by the driver, because you hit the
  setQueryTimeout limit
 
 
 http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#setQueryTimeout(int)
  then yes, as per javadoc, it is up to the JDBC driver to throw an
  exception.
 
 
  Filip
 
 
 
 
  On Wed, Jul 23, 2014 at 10:04 AM, Vasily Kukhta v.b.kuk...@gmail.com
  wrote:
 
   Thank you, I have changed timeBetweenEvictionRunsMillis value and it is
   working properly now. Another problem has appeared: although the
 timeout
  is
   handled correctly, no exception is thrown. I thought an SQLException
  would
   be thrown if query takes too long. Maybe pool does not throw exceptions
  at
   all in that situation?
  
   Than you!
  
  
   2014-07-21 20:40 GMT+04:00 Daniel Mikusa dmik...@gopivotal.com:
  
On Mon, Jul 21, 2014 at 11:05 AM, Vasily Kukhta 
 v.b.kuk...@gmail.com
wrote:
   
 Hello, dear tomcat users!

 I am developing high-load application using tomcat jdbc connection
  pool
and
 Oracle database. It is very important to ensure my app to have very
   small
 DB query timeouts (no longer than 3 seconds) to prevent
 long-running
 queries or database slowness from blocking all my application. To
simulate
 long-running queries I have put the DB in QUIESCE state using ALTER
SYSTEM
 QUIESCE RESTRICTED statement.

 But it looks like the timeout values have no impact - when i begin
 to
test
 my application, it hangs...

   
Have you taken thread dumps of your application when it hangs?
  What
  do
these show your threads are doing?
   
   

 Here is my jdbc pool configuration:

 String connprops =
 oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=3000;
 + oracle.net.READ_TIMEOUT=3000;


 pp.setConnectionProperties(connprops);

 pp.setDriverClassName(oracle.jdbc.OracleDriver);

 pp.setTestOnBorrow(true);
 pp.setTestOnConnect(true);
   
pp.setTestOnReturn(true);
 pp.setTestWhileIdle(true);

   
It's probably not necessary to have all of these enabled.  I usually
  only
see testOnBorrow and testWhileIdle enabled.  TestOnReturn is almost
worthless, in my opinion.  TestOnConnect might be helpful to catch
connection issues at boot, but generally a connection that is just
   created
should be good unless you have configuration problems.
   
   
 pp.setMaxWait(2000);
 pp.setMinEvictableIdleTimeMillis(2);

   
   
 pp.setTimeBetweenEvictionRunsMillis(2);

   
This might be high given your aggressive settings for
removeAbandonedTimeout.  The timeBetweenEvictionRunsMillis setting
   dictates
how often the pool looks for idle connections, abandoned connections,
  and
how often it validates idle connections.  If you set this to 20 secs,
   using
an abandoned timeout less than 20 seconds is probably not going to be
accurate.
   
For example, if the cleaner thread runs and your application has been
holding a connection for 2999ms, it won't consider the connection
abandoned.  However the cleaner thread won't run again for another 20
   secs
(based on the config value you used), thus the application can
 continue
using that connection for way over the abandoned timeout you've
   configured.
   
   
 pp.setValidationInterval(3000);
 pp.setValidationQuery(SELECT 1 FROM DUAL);

   
Seems OK.
   
   

 pp.setMaxAge(3000);

   
This seems pretty short and might

Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
I'd be more inclined to continue down the path of the NIO connector, it has
been tested and used more. What are the errors you get when running with
NIO?


On Thu, Jul 3, 2014 at 8:51 AM, Konstantin Kolinko knst.koli...@gmail.com
wrote:

 2014-07-03 18:46 GMT+04:00 João Sávio joaosa...@gmail.com:
  Unfortunately it's not working yet
 
  I increased the log level as you suggested. Log attached
 
  Thanks
 

 Please read numbers 6. and 7. here:
 http://tomcat.apache.org/lists.html#tomcat-users

 The attachment was thrown away by the mail server.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Issue with spring when migrating from 7.0.50 to 7.0.52-53-54

2014-07-03 Thread Filip Hanik
These errors may happen when you have two libraries that both contain the
class javax.persistence.spi.PersistenceProvider
search the libraries (*.jar) in both tomcat and your WAR file, and see if
there are multiple instances of the above named class


On Thu, Jul 3, 2014 at 9:28 AM, Xavier Outhier xouth...@yahoo.fr wrote:

 Hi,

 we have an application that is running under Tomcat. We are trying to
 upgrade to latest version 7.0.54 from 7.0.39.
 As 7.0.54 lead to some errors, we tried to find out which version broke
 the application. The result is that the issue appears with 7.0.52 and is
 not present until 7.0.50.

 The exception that we can see is:
 org.springframework.beans.factory.BeanCreationException: Error creating
 bean with name
 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'
 defined in file [xyz]: Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error creating
 bean with name 'entityManagerFactory' defined in file [xyz]: Invocation of
 init method failed; nested exception is
 java.lang.IncompatibleClassChangeError: Class
 org.eclipse.persistence.jpa.PersistenceProvider does not implement the
 requested interface javax.persistence.spi.PersistenceProvider
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 at
 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
 at
 org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
 at
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
 at
 org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
 at
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
 at
 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
 at xyz(xyz1.java:41)
 at xyz (xyz2.java:94)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 Caused by: org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in file [xyz]:
 Invocation of init method failed; nested exception is
 java.lang.IncompatibleClassChangeError: Class
 org.eclipse.persistence.jpa.PersistenceProvider does not implement the
 requested interface javax.persistence.spi.PersistenceProvider
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 at
 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
 at
 org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
 at
 org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)
 at
 org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
 at
 org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.init(PersistenceExceptionTranslationInterceptor.java:79)
 at
 org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.init(PersistenceExceptionTranslationAdvisor.java:70)
 at
 org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:99)
 

Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
you mention NIO and say maxThreads, that sounds like the Connector
configuration, but the BIO receiver is on the cluster, and it a completely
different component that also has an applicable NIO configuration.

are you confusing the two?
I'm saying that you should use the NIO receiver on the cluster component,
and if you do, what kind of errors do you get?


On Thu, Jul 3, 2014 at 12:19 PM, Mark Eggers its_toas...@yahoo.com.invalid
wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 João,

 This list has a convention of posting either inline or at the end of
 the message you're replying to.

 See here for mailing list notes:

 http://tomcat.apache.org/lists.html#tomcat-users

 On 7/3/2014 10:24 AM, João Sávio wrote:
  Hello
 
  Some points below:
 
  ** What is on time?* In my application, a group of users should
  always hit the same node after the first request. So, in first
  request each group of users will receive an specific cookie, and
  LB will perform the load balancing based on this cookie. In first
  request, a user can hit any node, but from the second, he or she
  should hit the same node.

 Hmm, so 'on time' really means that subsequent requests should hit the
 same server.

 If you're using sessions, Tomcat has an attribute on the Engine
 element called jvmRoute. So depending on your load balancer (and if
 you use AJP), you can use Tomcat and AJP to route traffic. In that
 case, there's no need to write a special cookie.

 At any rate, this doesn't sound like a clustering error per se.

 
  ** What are the errors? Test result errors?* For this test, I
  simplified the code of my application: - first request: store one
  object in session - second request: verify if the object is in
  session. If it's not - ERROR
 

 So looking at the information from 'on time', the scenario should be:

 1. first request, pick a random server and store a session object
 2. second request, pick the SAME server and ask for the session object

 Again, I'm not seeing where this is a clustering issue per se.

  ** How big are are the sessions that you're trying to replicate?*
  - I'm using Spring MVC, and I have 3 additional objects in
  session. They are not big (15 attributes each one)
 

 And all attributes are serializable? The objects are also marked as
 serializable?

  ** What's the load like on the box when you're running the tests
  that you get errors on?* - I've experiencing this issue on BIO
  even without load
 

 I may have not phrased my question carefully. What is the CPU and
 memory situation on your test box while running the 4 Tomcat servers?

 I know you've trimmed down your Xms and Xmx (presumably to fit in your
 test environment), but in combination with your other JVM parameters
 could this be causing some issues?

 I would follow Dan's recommendation of maybe just setting Xms, Xmx, GC
 logging to see what happens. Ah, I see you're going to do that below.

  ** It is preferred to use the non blocking receiver to be able to
  grow your cluster without running into thread starvation.* -
  That's why I've tried NIO first, but I'd like to see if BIO solve
  my issue and if using BIO my system doesn't get too slow.

 I don't think speed is so much an issue here, but scalability is. NIO
 can handle multiple requests per thread, BIO cannot.

 
 
  Now, I'll try to run my tests using NIO, default VM configuration
  and FINER logs.

 Post the results when you get them. If the logs are relatively small,
 just cut and paste into the mail message.

 I suspect FINER is going to generate LOTS of logging and slow down
 your application.

 
  Thanks a lot João

 . . . . just my two cents
 /mde/

 
 
  2014-07-03 14:07 GMT-03:00 Mark Eggers
  its_toas...@yahoo.com.invalid:
 
  On 7/3/2014 9:12 AM, João Sávio wrote:
  cluster.log - http://pastebin.com/c98WhnmG
 
 
  2014-07-03 13:04 GMT-03:00 João Sávio joaosa...@gmail.com:
 
  Hello!
 
  Using NIO (with channelSendOptions=4, i.e.,
  synchronous), with lightly load, my tests pass 100%. But,
  on heavy load, not all sessions are replicated on time, and
  I have about 20% of errors. If I increase maxThreads to
  400, I have about 15% of errors.
 
  More information: * I am not performing parallel requests
  with same session * my cluster has 4 nodes (all in one
  machine - for test purpose only) * Java 7 64 bits, Tomcat
  7.0.52, windows 7 64 bits * using default NIO
  configuration, but with maxThreads=400 * VM options:
  -Xms512M   - on real environment this value is 1024
  -Xmx512M  - on real environment this value is 1024
  -XX:NewSize=450M -XX:MaxNewSize=450M -XX:PermSize=128M
  -XX:MaxPermSize=245M -XX:SurvivorRatio=8
  -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15
  -XX:+UseBiasedLocking -XX:CMSInitiatingOccupancyFraction=60
   -XX:+UseCMSInitiatingOccupancyOnly
  -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC
  -XX:+CMSIncrementalMode -XX:+UseParNewGC
  -XX:+DisableExplicitGC -XX:+PrintGCDateStamps
  -XX:+PrintGCDetails
  

Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
   1. are your machines in time sync? If they are not, a session can get
   timed out.
   2.
   3. SEVERE: Manager [localhost#/myApp]: Unable to receive message through
   TCP channel
   4. java.lang.IllegalStateException: setAttribute: Session [
   DEC3612CF763194E7953DB3FD2C433E0] has already been invalidated
   5. at org.apache.catalina.session.StandardSession.setAttribute(
   StandardSession.java:1437)
   6. at org.apache.catalina.ha.session.DeltaSession.setAttribute(
   DeltaSession.java:695)
   7. at org.apache.catalina.ha.session.DeltaRequest.execute(
   DeltaRequest.java:168)
   8. at
   org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(
   DeltaManager.java:1337)
   9. at org.apache.catalina.ha.session.DeltaManager.messageReceived
   (DeltaManager.java:1283)
   10. at
   org.apache.catalina.ha.session.DeltaManager.messageDataReceived(
   DeltaManager.java:1001)
   11. at
   org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(
   ClusterSessionListener.java:91)
   12. at
   org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(
   SimpleTcpCluster.java:943)
   13. at
   org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(
   SimpleTcpCluster.java:924)
   14. at
   org.apache.catalina.tribes.group.GroupChannel.messageReceived(
   GroupChannel.java:278)




On Thu, Jul 3, 2014 at 1:07 PM, João Sávio joaosa...@gmail.com wrote:

 Hi everyone

 I ran my test (total of 1k requests, total of 100 threads) against two
 nodes with default VM settings. I've just set heap size. I had about 15% of
 errors.

 cluster.log - node1 - http://pastebin.com/cpX900Qw
 cluster.log - node2 - http://pastebin.com/qCSzMaU6

 Running for a long time (total of 500k requests, total of 100 threads) I
 had about 11% of errors. In this case we can see the statistics:

 Jul 03, 2014 5:53:28 PM
 org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor report
 INFO: ThroughputInterceptor Report[
 Tx Msg:1 messages
 Sent:12.36 MB (total)
  Sent:12.36 MB (application)
 Time:7.82 seconds
 Tx Speed:1.58 MB/sec (total)
  TxSpeed:1.58 MB/sec (application)
 Error Msg:0
 Rx Msg:10198 messages
  Rx Speed:0.08 MB/sec (since 1st msg)
 Received:12.38 MB]


 All session attributes are Serializable, and it's a session replication
 issue because if I ran my test with just one node, I had 0% of errors.

 Regarding on time, just a correction:

 1. first request, pick a random server and store a session object
 2. second request, pick *ANY* server (chose by LB based on the cookie - it
 can be the same, but not necessarily) and ask for the session object.

 To be more clean, I've been working with a conference system. Each
 conference should occur in one node. So, the first request can hit any
 server, and from the second request should hit the node where the
 conference is.


 Thanks a lot
 João


 2014-07-03 15:40 GMT-03:00 Filip Hanik fi...@hanik.com:

  you mention NIO and say maxThreads, that sounds like the Connector
  configuration, but the BIO receiver is on the cluster, and it a
 completely
  different component that also has an applicable NIO configuration.
 
  are you confusing the two?
  I'm saying that you should use the NIO receiver on the cluster component,
  and if you do, what kind of errors do you get?
 
 
  On Thu, Jul 3, 2014 at 12:19 PM, Mark Eggers
 its_toas...@yahoo.com.invalid
  
  wrote:
 
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA1
  
   João,
  
   This list has a convention of posting either inline or at the end of
   the message you're replying to.
  
   See here for mailing list notes:
  
   http://tomcat.apache.org/lists.html#tomcat-users
  
   On 7/3/2014 10:24 AM, João Sávio wrote:
Hello
   
Some points below:
   
** What is on time?* In my application, a group of users should
always hit the same node after the first request. So, in first
request each group of users will receive an specific cookie, and
LB will perform the load balancing based on this cookie. In first
request, a user can hit any node, but from the second, he or she
should hit the same node.
  
   Hmm, so 'on time' really means that subsequent requests should hit the
   same server.
  
   If you're using sessions, Tomcat has an attribute on the Engine
   element called jvmRoute. So depending on your load balancer (and if
   you use AJP), you can use Tomcat and AJP to route traffic. In that
   case, there's no need to write a special cookie.
  
   At any rate, this doesn't sound like a clustering error per se.
  
   
** What are the errors? Test result errors?* For this test, I
simplified the code of my application: - first request: store one
object in session - second request: verify if the object is in
session. If it's not - ERROR
   
  
   So looking at the information from 'on time', the scenario should be:
  
   1. first request, pick a random server

Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
Ok, at least the stack trace is clear. The session has been invalidated
somehow.
We would need to figure out when and how this happens, is it possible that
you are doing a clean shutdown of a tomcat instance and that instance
expires all the sessions? If that is the case, kill the tomcat with 'kill
-9' to simulate a failure. there is a flag called
'expireSessionsOnShutdown', do you have that set?





On Thu, Jul 3, 2014 at 2:05 PM, João Sávio joaosa...@gmail.com wrote:

 Hello Mark

 In fact, I'm not explicit invalidating session on this two requests.

 Regards
 João



Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
A race condition could happen if you set replication to happen async. But I
do have a memory of the configuration specifying synchronous replication,
which would guarantee that the replication changes have happened before the
request is complete.




On Thu, Jul 3, 2014 at 3:51 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Mark,

 On 7/3/14, 2:19 PM, Mark Eggers wrote:
  João,
 
  This list has a convention of posting either inline or at the end
  of the message you're replying to.
 
  See here for mailing list notes:
 
  http://tomcat.apache.org/lists.html#tomcat-users
 
  On 7/3/2014 10:24 AM, João Sávio wrote:
  Hello
 
  Some points below:
 
  ** What is on time?* In my application, a group of users should
   always hit the same node after the first request. So, in first
  request each group of users will receive an specific cookie, and
  LB will perform the load balancing based on this cookie. In first
   request, a user can hit any node, but from the second, he or she
   should hit the same node.
 
  Hmm, so 'on time' really means that subsequent requests should hit
  the same server.
 
  If you're using sessions, Tomcat has an attribute on the Engine
  element called jvmRoute. So depending on your load balancer (and
  if you use AJP), you can use Tomcat and AJP to route traffic. In
  that case, there's no need to write a special cookie.
 
  At any rate, this doesn't sound like a clustering error per se.


 I wonder if the real problem is a race condition: the cluster can't
 replicate fast enough to stabilize before the second request comes in,
 plus the lb configuration might not be correct.

 João, can you confirm that request #1 and #2 are definitely hitting
 the same Tomcat instance?

 If you connect to TomcatA, set a session attribute, then reconnect to
 TomcatA and get that session attribute, then it should be the same
 unless something is awfully wrong. You don't even need to have
 clustering enabled to test the above.

 However if you hit TomcatA, set a session attribute, then connect to
 TomcatB and try to get that session attribute, your request may have
 arrived too early for the cluster to have pushed-out the session
 attribute change.

 So, if you can prove that both requests have gone to TomcatA and you
 are getting errors, then there are several possibilities:

 1. Tomcat has a huge bug and no web applications would work worldwide.
 2. You are mishandling the setting of the session attribute
 3. You are wrong about which server the client is hitting

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTtdBTAAoJEBzwKT+lPKRYtiwP/1dW2qplyepTgDTNixNw0viZ
 29XFywsYAmDdMxzWcgkcl7Nrw3kVUcJVf+jLpxNCUxRJq7z4+zuyOLkImn2XW4a+
 ygG1op69FSwsVEfQyHIH8OVjdYDUj6WPpP8bu2KbbkR0jtAiHO569+869WOvPyuA
 z+oBhBhWB5w7e41qmQnLr6y3+hU19hGuayxkR61tqmZCPp6kpwRH2yN3IbhId2In
 8DLoR5z6077jxPeXR6o3goB6Y9LbrPoYFUwdfQTpzrF8AvQ2wDl/CRuM2n9wB/ez
 Oclnz0bw4JNegtarEJeiu4G1Qqf7WCqhVv4a8GfWYtr0ISk8GBBcCRjYZcoyU5IU
 hSnNBGn586AhZ3BK5t1ySwrC6RiKH6MIR8fdBOSw1eZnTycPBSK6avZ4E8ahQDIp
 uA93W+cME58gtmzdl2q7iLjRbwGdgebw++yfR4G42Tb4rUYsmOzsCPGx/nIqxB5E
 FBea8xGwb802rFpYMxgMp8SzRy078RrDx2aptNfrb5oP9YeQ/pGrX9tVVtTlxNTk
 8DKA8GHL4fiONAJB48iD2sTSv4jAhFInHnF4ykl0zjN7t3f0phMmSExeoH7HbFUI
 G589M4KAs5X00xCSFt9gXdU+tpuFL+/x6kBAGrNmT5IySIvm+BfxTXjvg2daAjcC
 +FAocYeosZumP5g2tICv
 =1Si4
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
did you post your server.xml cause I can't find it?


On Thu, Jul 3, 2014 at 4:25 PM, João Sávio joaosa...@gmail.com wrote:

 Hello Filip

 I'm using channelSendOptions=4, which is supposed to be synchronous

 Regards
 João



Re: Help with Tomcat 7 clustering using BIO receiver

2014-07-03 Thread Filip Hanik
Joao,
try channelSendOptions=6
this will mean that
1. You wish to use ACK's (option 2)
2. You wish the ACK to be synchronous

If you don't have the 0x0002 option enabled, it wont use ACKs at all.

Filip




On Thu, Jul 3, 2014 at 4:44 PM, João Sávio joaosa...@gmail.com wrote:

 If I set channelSendOptions=8 (default value = asynchronous), the % of
 errors increase (as expected)

 Regards
 João


 2014-07-03 19:43 GMT-03:00 João Sávio joaosa...@gmail.com:

  I don't think so.
 
  Here it is: http://pastebin.com/qYCzmECb  (server.xml - node1)
 
  Regards
  João
 



 --
 http://joaosavio.wordpress.com



Re: Error in DBCP Connection Pool with tomcat 6.x

2014-07-01 Thread Filip Hanik
Looks like your code already called java.sql.Connection.close() and then
attempts to use the connection again

Filip



On Tue, Jul 1, 2014 at 8:09 AM, Propes, Barry L barry.l.pro...@citi.com
wrote:



 -Original Message-
 From: Vijendra Pachoriya [mailto:vijendra.pachor...@indegene.com]
 Sent: Tuesday, July 01, 2014 2:31 AM
 To: users@tomcat.apache.org
 Cc: Alok Roy
 Subject: Error in DBCP Connection Pool with tomcat 6.x

 Hi Tomcat Team,

 Please help me out in solving below error.

 Below is the details :

 Configuration in my context.xml


 Resource name=jdbc/ABC
 auth=Container
 type=javax.sql.DataSource
 maxActive=50
 maxIdle=10
 maxWait=1
 username=ABC
 password=ABC
 removeAbandoned=true
 logAbandoned=true
 testOnBorrow=true
 testWhileIdle=true
 timeBetweenEvictionRunsMillis=3
 validationQuery=SELECT 1 FROM dual
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@MY_DB /


 ==Error Message
 

 at
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
 at
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
 at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
 at java.lang.Thread.run(Thread.java:679)
 Caused by: org.springframework.transaction.TransactionSystemException:
 Could not roll back JPA transaction; nested exception is
 javax.persistence.PersistenceException: unexpected error when rollbacking
 at
 org.springframework.orm.jpa.JpaTransactionManager.doRollback(JpaTransactionManager.java:486)
 at
 org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)
 at
 org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
 at
 org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:339)
 at
 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 at
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 at
 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 at sun.proxy.$Proxy185.selectPharmaUser(Unknown Source)
 at
 com.aptilon.axcelrx.server.service.impl.AuthenticationServiceImpl.login(AuthenticationServiceImpl.java:170)
 at
 com.aptilon.axcelrx.server.ws.endpoint.AuthenticationEndpoint.login_aroundBody0(AuthenticationEndpoint.java:110)
 ... 45 more
 Caused by: javax.persistence.PersistenceException: unexpected error when
 rollbacking
 at
 org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:88)
 at
 org.springframework.orm.jpa.JpaTransactionManager.doRollback(JpaTransactionManager.java:482)
 ... 54 more
 Caused by: org.hibernate.exception.GenericJDBCException: Cannot release
 connection
 at
 org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
 at
 org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
 at
 org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
 at
 org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
 at
 org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:478)
 at
 org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:429)
 at
 org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:316)
 at
 org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:248)
 at
 org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:208)
 at
 org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:85)
 ... 55 more
 Caused by: java.sql.SQLException: Already closed.
 at
 org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114)
 at
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:191)
 at
 org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:97)
 at
 org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:474)
 ... 60 more


 ===

 Your help in this regard is highly appreciated.


 Thanks  Regards,
 Vijendra


 ---
 I've also got these attributes in my xml file, 

Re: Connection count explosion due to thread http-nio-80-ClientPoller-x death

2014-06-27 Thread Filip Hanik
Are there any log entries that would indicate that the poller thread has
died?
This/these thread/s start when Tomcat starts. and a stack over flow on a
processing thread should never affect the poller thread.

Filip



On Thu, Jun 26, 2014 at 4:01 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 André,

 On 6/26/14, 11:09 AM, André Warnier wrote:
  Lars Engholm Johansen wrote:
  Thanks for all the replies guys.
 
  Have you observed a performance increase by setting
  acceptorThreadCount to 4 instead of a lower number? I'm just
  curious.
 
 
  No, but this was the consensus after elongated discussions in my
  team. We have 12 cpu cores - better save than sorry. I know that
  the official docs reads although you would never really need
  more than 2 :-)
 
  The GC that Andre suggested was to get rid of some of CLOSE_WAIT
  connections in netstat output, in case if those are owned by
  some abandoned and non properly closed I/O classes that are
  still present in JVM memory.
 
 
  Please check out the open connections graph at
  http://imgur.com/s4fOUte As far as I interpret, we only have a
  slight connection count growth during the days until the poller
  thread die. These may or may not disappear by forcing a GC, but
  the amount is not problematic until we hit the
  http-nio-80-ClientPoller-x thread death.
 
  Just to make sure : what kind of connections does this graph
  actually show ? in which TCP state ? does it count only the
  established, or also the FIN_WAIT, CLOSE_WAIT, LISTEN etc..
  ?

 I think the state of the connections is a red herring: Tomcat will
 hold those connections forever because the poller thread has died.
 Nothing else matters.

 Even if the CLOSE_WAIT connections were somehow cleared, Tomcat would
 never respond properly to another request, ever. A Tomcat restart is
 required if the poller thread dies.

 One could argue that the poller threads should maybe try harder not
 to die, but sometimes you can't stop thread death.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTrKZWAAoJEBzwKT+lPKRYZm8QAJ9fD8acAGZY/Tddt4TvUfat
 rjpEhyfhUkBIMZkPito/pKHsT8EuwP36g3spa8tmj94gSB+ajgqDjJ6jZ47AN/eG
 /0mSEMaedsaEXdO5e3RELDsDv16/fS0+OStvkG0/K22bWgf4Lbh7V9sC+LtIF04S
 szo++GV9ykgv9fmFVyxXKRwpDdNWxNzJvgGCi/gXo/1bpSYUTwRUQcXb0aANvU2i
 90KAj4ng9SJqyGwLKvYencYH7Ga2vqmuePHNLKKtiNT6iRLz9ZI8O1qW+SzJIG+e
 moqS0VOz8C9v2yk1Dl7Ox7gw9A1dAd4GhLwtpsAcJFdpA4PKzto1hvKIuCLr3j7h
 7pyw0/N2Nldl+nEOOhQiRU41e2L+wci0Rln2b83azvuqO2GrxUlJVthqjbTvLjMX
 TbFYAjpIUPZFlIMKtefXA+cPF7JUh1expXk5J6/l1u6hWHR8a/uQ8G5M/5DK+ObV
 1n5f/xU9eoLjbGs7/RC87VhWsxW/WutPh68cPKeC2oH6Hk1VL0lkjUiQ3i4DC+ym
 yx4BvO1HUqY9uvjoGF0XoJRTcVlOyUP1G3zpxBBvL7ZpaU+r/c5MjjcMrgg6yzZe
 NhMYKGJJ+qIfAtZHCm3snPCFYPysz9JwuUIGPB6ZBOukzDUAi59YLM/u9CIexkiJ
 hZpHrNNu9zANMbFvt6jh
 =SJdz
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Connection count explosion due to thread http-nio-80-ClientPoller-x death

2014-06-19 Thread Filip Hanik
Our sites still functions normally with no cpu spikes during this build up
until around 60,000 connections, but then the server refuses further
connections and a manual Tomcat restart is required.

yes, the connection limit is a 16 bit short count minus some reserved
addresses. So your system should become unresponsive, you've run out of
ports (the 16 bit value in a TCP connection).

netstat -na should give you your connection state when this happens, and
that is helpful debug information.

Filip




On Thu, Jun 19, 2014 at 2:44 PM, André Warnier a...@ice-sa.com wrote:

 Konstantin Kolinko wrote:

 2014-06-19 17:10 GMT+04:00 Lars Engholm Johansen lar...@gmail.com:

 I will try to force a GC next time I am at the console about to restart a
 Tomcat where one of the http-nio-80-ClientPoller-x threads have died and
 connection count is exploding.

 But I do not see this as a solution - can you somehow deduct why this
 thread died from the outcome from a GC?


 Nobody said that a thread died because of GC.

 The GC that Andre suggested was to get rid of some of CLOSE_WAIT
 connections in netstat output, in case if those are owned by some
 abandoned and non properly closed I/O classes that are still present
 in JVM memory.


 Exactly, thanks Konstantin for clarifying.

 I was going per the following in the original post :

 Our sites still functions normally with no cpu spikes during this build up
 until around 60,000 connections, but then the server refuses further
 connections and a manual Tomcat restart is required.

 CLOSE_WAIT is a normal state for a TCP connection, but it should not
 normally last long.
 It indicates basically that the other side has closed the connection, and
 that this side should do the same. But it doesn't, and as long as it
 doesn't the connection remains in the CLOSE_WAIT state.  It's like
 half-closed, but not entirely, and as long as it isn't, the OS cannot get
 rid of it.
 For a more precise explanation, Google for TCP CLOSE_WAIT state.

 I have noticed in the past, with some Linux versions, that when the number
 of such CLOSE_WAIT connections goes above a certain level (several
 hundred), the TCP/IP stack can become totally unresponsive and not accept
 any new connections at all, on any port.
 In my case, this was due to the following kind of scenario :
 Some class Xconnection instantiates an object, and upon creation this
 object opens a TCP connection to something. This object is now used as an
 alias for this connection.  Time passes, and finally the object goes out
 of scope (e.g. the reference to it is set to null), and one may believe
 that the underlying connection gets closed as a side-effect.  But it
 doesn't, not as long as this object is not actually garbage-collected,
 which triggers the actual object destruction and the closing of the
 underlying connection.
 Forcing a GC is a way to provoke this (and restarting Tomcat another, but
 more drastic).

 If a forced GC gets rid of your many CLOSE_WAIT connections and makes your
 Tomcat operative again, that would be a sign that something similar to the
 above is occurring; and then you would need to look in your application for
 the oversight. (e.g. the class should have a close method (closing the
 underlying connection), which should be invoked before letting the object
 go out of scope).

 The insidious part is that everything may look fine for a long time (apart
 from an occasional long list of CLOSE_WAIT connections).  A GC will happen
 from time to time (*), which will get rid of these connections.  And those
 CLOSE_WAIT connections do not consume a lot of resources, so you'll never
 notice.
 Until at some point, the number of these CLOSE_WAIT connections gets just
 at the point where the OS can't swallow any more of them, and then you have
 a big problem.

 That sounds a bit like your case, doesn't it ?

 (*) and this is the insidious squared part : the smaller the Heap, the
 more often a GC will happen, so the sooner these CLOSE_WAIT connections
 will disappear.  Conversely, by increasing the Heap size, you leave more
 time between GCs, and make the problem more likely to happen.


 I believe that the rest below may be either a consequence, or a red
 herring, and I would first eliminate the above as a cause.



  And could an Exception/Error in Tomcat thread  http-nio-80-ClientPoller-0
  or  http-nio-80-ClientPoller-1  make the thread die with no Stacktrace
 in
 the Tomcat logs?


 A critical error (java.lang.ThreadDeath,
 java.lang.VirtualMachineError) will cause death of a thread.

 A subtype of the latter is java.lang.OutOfMemoryError.

 As of now, such errors are passed through and are not logged by
 Tomcat, but are logged by java.lang.ThreadGroup.uncaughtException().
 ThreadGroup prints them to System.err (catalina.out).


 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional 

Re: catalina.out is 13G

2014-04-22 Thread Filip Hanik
http://www.tomcatexpert.com/knowledge-base/rotating-catalinaout-log-files


On Tue, Apr 22, 2014 at 8:20 AM, Randhir Singh
randhir.si...@sterlite.comwrote:

 Hi,

 I have a immediate concern as the mount point on which Tomcat is placed is
 99% and on checking I found that catalina.out is 13GB. I wanted to
 implement a solution for this but am not sure, can I take a backup of
 catalina.out and truncate catalina.out on the running application?

 Humbly requesting a revert on an immediate basis on whether I can truncate
 catalina.out after taking a backup on a running tomcat application.

 Regards

 --

 *STL Disclaimer:*
 The content of this message may be legally privileged and confidential and
 are for the use of the intended recipient(s) only. It should not be read,
 copied and used by anyone other than the intended recipient(s). If you have
 received this message in error, please immediately notify the sender,
 preserve its confidentiality and delete it. Before opening any attachments
 please check them for viruses and defects. No employee or agent is
 authorised to conclude any binding agreement on behalf of Sterlite
 Technologies Limited with another party by email without express written
 confirmation by authorised person. Visit us at
 www.sterlitetechnologies.com
  Please consider environment before printing this email !







Re: catalina.out is 13G

2014-04-22 Thread Filip Hanik
check out /usr/bin/truncate

truncate --size 0 /path/to/fil



On Tue, Apr 22, 2014 at 8:28 AM, Randhir Singh
randhir.si...@sterlite.comwrote:

 Thanks for your answer Leon. The space should be freed immediately on the
 system, can the catalina.out be truncated on an running system?

 Regards

 -Original Message-
 From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com]
 Sent: Tuesday, April 22, 2014 7:55 PM
 To: Tomcat Users List
 Subject: Re: catalina.out is 13G

 Hello Randhir,

 whatever revert means.
 However, if you remove the file the place will be occupied on most *'nix
 system until a process restart. You will probably have to restart your
 server to free this mount point's storage anyway.

 regards
 Leon


 On Tue, Apr 22, 2014 at 4:20 PM, Randhir Singh
 randhir.si...@sterlite.comwrote:

  Hi,
 
  I have a immediate concern as the mount point on which Tomcat is
  placed is 99% and on checking I found that catalina.out is 13GB. I
  wanted to implement a solution for this but am not sure, can I take a
  backup of catalina.out and truncate catalina.out on the running
  application?
 
  Humbly requesting a revert on an immediate basis on whether I can
  truncate catalina.out after taking a backup on a running tomcat
  application.
 
  Regards
 
  --
 
  *STL Disclaimer:*
  The content of this message may be legally privileged and confidential
  and are for the use of the intended recipient(s) only. It should not
  be read, copied and used by anyone other than the intended
  recipient(s). If you have received this message in error, please
  immediately notify the sender, preserve its confidentiality and delete
  it. Before opening any attachments please check them for viruses and
  defects. No employee or agent is authorised to conclude any binding
  agreement on behalf of Sterlite Technologies Limited with another
  party by email without express written confirmation by authorised
  person. Visit us at www.sterlitetechnologies.com  Please consider
  environment before printing this email !
 
 
 
 
 

 --

 *STL Disclaimer:*
 The content of this message may be legally privileged and confidential and
 are for the use of the intended recipient(s) only. It should not be read,
 copied and used by anyone other than the intended recipient(s). If you have
 received this message in error, please immediately notify the sender,
 preserve its confidentiality and delete it. Before opening any attachments
 please check them for viruses and defects. No employee or agent is
 authorised to conclude any binding agreement on behalf of Sterlite
 Technologies Limited with another party by email without express written
 confirmation by authorised person. Visit us at
 www.sterlitetechnologies.com
  Please consider environment before printing this email !





 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: PooledConnection.getConnection - Tomcat JDBC Pool

2014-03-26 Thread Filip Hanik
Jonathan opened up the following bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=56310

and I do believe our pool is incorrectly implementing the
ConnectionPoolDatasource. I do believe it shouldn't implement that
interface at all.



On Wed, Mar 26, 2014 at 10:41 AM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Jonathan,

 On 3/26/14, 9:16 AM, Pierce, Jonathan D wrote:
  I agree that it is counter-intuitive.  I also agree that the
  application should not need to use the PooledConnection interface.
 
  However, XAConnection is needed to be used by a transaction
  manager, and it extends PooledConnection. So if I understancd
  correctly, an application gets an XAConnection from an
  XADataSource, it does all of the necessary XA boiler plate, and
  then calls XAConnection.getConnection() to get the
  java.sql.Connection object that will be used for all of the
  standard JDBC calls. If the application is using a connection pool,
  then I think XAConnection.getConnection should NOT return the
  physical connection, but a handle that when closed will return the
  connection to the pool.

 That's clearly what the Javadoc says it should do. It looks like this
 is a case of a poorly-conceived API (IMHO).

 Filip clearly thinks this is a bug, so it will likely get a fix pretty
 quickly. It doesn't seem that hard to return a wrapper instead of the
 underlying object.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTMwMuAAoJEBzwKT+lPKRYWNcQAJKcslDaOvFhAZZageXrvwSI
 Lh+tM5cajwxWaa/QE02uWf+zBErnhmC25hp7CkbEv3QcAKG0y1lHo4wa3PSyVWF6
 jcd1AkD2sUDh2+X65rOvlOJka1eW8MD8Tg7xWWN5uOmvMUJeesFupV2FmTy9uiri
 2fqr3tfcSJ5OyXuvAHmPzL7U1mka11JKfG/plR3Hz2m0T1ROmrUXcUgESGFGFaVt
 BHtUeu8NecC+R89eNyU2Qa1j/aGNj894uwjYY8NgpojAbabFuMBjlc1BL5vYL5vx
 IUvtn+2P9mqdPY2SuDw6AXgz6dzDuAuog4wUdMl2jGJen6CmBhqXaUDKE6svmJaF
 hhXFUcgAXzyXSigQrbrMcSwvD7llRqOSyXdjCXYoFr0skZ34tDRmaPTx0JSAd1Dt
 Y7Wk/IPmIFM3VirpoqmtlMHeExIKsQEcPPiW71ZcCyY0F3eY2AGTHge/uRnGoMgc
 47/7ppkIwyTm7U267/I1KQoGIqzO4NFD9COdmEDWNj4mINXo8iXnC595BGOkq6Ub
 eOJzA1PIWtqLssuXEovg4hia6JR//ctz56oEKuGHwnTqE1OP9RBmgUKM2jKoFo0b
 uxNulNj65aFf/Fvodenw4bpKQZciY8hSVCY7nLf316pXoNArsacQuSz7xEfQvZhE
 soK4sDPgR1AL+d78HLqh
 =WECl
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: PooledConnection.getConnection - Tomcat JDBC Pool

2014-03-25 Thread Filip Hanik
Please open a bug, and we will get this taken care of. I do have one
question,Aries library, on which call does it expect to return the
connection to the pool? XAConnection.close() or
XAConnection.getConnection().close(); ?




On Tue, Mar 25, 2014 at 6:05 AM, Jonathan Pierce jondavid...@gmail.comwrote:

 I am trying to use the tomcat jdbc pool library (outside of tomcat)
 along with the Apache Aries Transaction library in an OSGi environment
 to handle distributed transactions.

 One of the classes (XADataSourceEnlistingWrapper) provided by the
 Aries Transaction wrappers library is a DataSource wrapper that auto
 enlists connections.

 It appears that the Aries class is trying to call
 XAConnection.getConnection with the expectation that the returned
 Connection object will recycle connections when the close() method is
 called (i.e. return the connection to the pool)

 However, in the tomcat jdbc pooling library
 PooledConnection.getConnection() (and by extension
 XAConnection.getConnection()) seems to be returning the physical
 connection.  So the physical connection is getting closed without
 being returned to the pool and I'm getting exceptions saying the pool
 is empty after a few requests.

 It looks like one of these libraries is implementing the interface
 wrong (or its entirely possible I'm missing something).  After reading
 the J2SE docs for PooledConnection it seems like
 PooledConnection.getConnection() should not return the physical
 connection but a handle that when closed indicates the connection
 should be returned to the pool.  If that is the case the tomcat jdbc
 pooling library handling the call incorrectly and its a bug.

 I wanted to ask to post here before submitting a bug to the tracker in
 case I'm missing something.

 Thanks,
 Jonathan

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: DBCP2 connection pool leak?

2014-02-28 Thread Filip Hanik
you can try out tomcat-jdbc, and see if that solves your problem, it may
help you narrow it down.
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html




On Fri, Feb 28, 2014 at 11:26 AM, Mark Thomas ma...@apache.org wrote:

 On 28/02/2014 18:22, Felipe Jaekel wrote:
  Hi,
 
  Today I tried to migrate my production server from 7.0.50 to 8.0.3.
 
  After about 3 hours running I start to get JDBC exceptions(stacktrace
  below) and the server stops responding. Looking at Amazon RDS monitoring
 it
  shows the connection limit reached 97%. Restarted the server and after
  about the same time the same problem happened.
 
  With 7.0.50 the highest value reached was 60%, so I think that the
  connection pool may be leaking.
 
  I understand that DBCP2 isn't final yet. I just like to know if that is a
  known issue, so I'll return to Tomcat 7.

 It isn't a known issue. There have been some code changes since the DBCP
 version that was used in 8.0.3 but nothing I recall that related to a
 connection leak. It is worth taking a look at what is going on with JMX
 as that might give you some hints.

 Mark

 
  Thanks,
  Phillip
 
 
 
 
 
  javax.persistence.PersistenceException:
  org.hibernate.exception.GenericJDBCException: could not inspect JDBC
  autocommit mode
at
 org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
at
 org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:316)
at
 br.com.spdata.persistence.mysql.service.ErroService.checkExistente(ErroService.java:134)
at
 br.com.spdata.persistence.mysql.service.ErroService.persist(ErroService.java:58)
at
 br.com.spdata.email.AbstractErrorPageController.(AbstractErrorPageController.java:78)
at
 br.com.spdata.tecnico.ErrorPageController.(ErrorPageController.java:14)
at sun.reflect.GeneratedConstructorAccessor798.newInstance(Unknown
 Source)
at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at
 com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:186)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:100)
at
 com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
at
 com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at
 com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at
 com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at
 com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at
 org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
at org.apache.el.parser.AstValue.getValue(AstValue.java:135)
at
 org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187)
at
 com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238)
at
 com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:154)
at
 com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
at
 com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at
 com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
at
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at
 org.primefaces.renderkit.HeadRenderer.encodeEnd(HeadRenderer.java:106)
at
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at
 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
at
 com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at
 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
at
 com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at
 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
 

Re: Tomcat 7.0.50 - Starting tomcat get this error overrides final method start.

2014-02-20 Thread Filip Hanik
If I remember correctly, IIRC, those adapters have been removed from Spring
security. If you upgrade your Tomcat, try to upgrade your Spring Security
version too

http://64.20.104.11/spring-security/spring-security/commit/e2062bbe79033b214f55f7c2ce03542a70f29a78


On Thu, Feb 20, 2014 at 7:20 AM, Patel Sufyan (HEALTH AND SOCIAL CARE
INFORMATION CENTRE) sufyan.pa...@hscic.gov.uk wrote:

 Hi,

 I am using Apache Tomcat realm to perform the user authentication and have
 added the following to the server.xml

 Realm appContextLocation=conf/spring-security.xml
 className=org.springframework.security.adapters.catalina.CatalinaSpringSecurityUserRealm
 key=my_password resourceName=UserDatabase/

 However, since upgrading to Tomcat 7.0.50 from 6.0.39, when starting
 Tomcat service (through Eclipse), I get the error below. From trawling
 through the net I could not find the exact error but I get the feeling that
 I will need to replace this class with something else. Or is there anything
 I can do/download to fix it?

 SEVERE: Begin event threw error
 java.lang.VerifyError: class
 org.springframework.security.adapters.catalina.CatalinaSpringSecurityUserRealm
 overrides final method start.()V
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(Unknown Source)
 at java.security.SecureClassLoader.defineClass(Unknown
 Source)
 at java.net.URLClassLoader.defineClass(Unknown Source)
 at java.net.URLClassLoader.access$100(Unknown Source)
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native
 Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at
 org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)
 at
 org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1288)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
 Source)
 at
 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
 Source)
 at
 org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
 at
 org.apache.catalina.startup.Catalina.load(Catalina.java:616)
 at
 org.apache.catalina.startup.Catalina.load(Catalina.java:664)
 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:281)
 at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)



 Thanks in advance

 Suf




 

 This message may contain confidential information. If you are not the
 intended recipient please inform the
 sender that you have received the message in error before deleting it.
 Please do not disclose, copy or distribute information in this e-mail or
 take any action in reliance on its contents:
 to do so is strictly prohibited and may be unlawful.

 Thank you for your co-operation.

 NHSmail is the secure email and directory service available for all NHS
 staff in England and Scotland
 NHSmail is approved for exchanging patient data and other sensitive
 information with NHSmail and GSi recipients
 NHSmail provides an email address for your career in the NHS and can be
 

Re: What is the best connector configuration for thousands of mostly idle users?

2014-02-10 Thread Filip Hanik
Jesse, mostly idle users and you wish to conserve resources. Use the
JkOptions +DisableReuse
on the mod_jk module. This will close connections after the request has
been completed. Many will tell you this will slow down your system since
new connections have to be created for each request. Usually, the overhead
of this connection creation on a LAN is worth it. Measure for yourself.
Then you can go back to the regular blocking AJP connector, that will
perform a bit better as it doesn't have to do polling.




On Mon, Feb 10, 2014 at 9:04 AM, Jesse Barnum jsb_tom...@360works.comwrote:

 On Feb 7, 2014, at 1:11 PM, Mark Thomas ma...@apache.org wrote:

 
  This is a single core box (sorry, should have mentioned that in the
 configuration details). Would you still expect increasing the worker thread
 count to help?
 
  Yes. I'd return it to the default of 200 and let Tomcat manage the pool.
  It will increase/decrease the thread pool size as necessary. Depending
  on how long some clients take to send the data, you might need to
  increase the thread pool beyond 200.
 
  Mark

 Unfortunately, this has made the problem worse.

 We are now getting site failure messages from our monitoring software more
 frequently, and outside of peak hours, and CPU usage is running much higher
 than normal.

 Looking at the manager page shows 76 threads busy out of 200, and YourKit
 shows that many threads (I'm assuming 76-1) are stuck at this point:

  ajp-nio-8009-exec-148 [WAITING] CPU time: 0:50
  sun.misc.Unsafe.park(boolean, long)
  java.util.concurrent.locks.LockSupport.parkNanos(Object, long)
 
 java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(int,
 long)
 
 java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(int,
 long)
  java.util.concurrent.CountDownLatch.await(long, TimeUnit)
 
 org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.awaitLatch(CountDownLatch,
 long, TimeUnit)
 
 org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.awaitReadLatch(long,
 TimeUnit)
  org.apache.tomcat.util.net.NioBlockingSelector.read(ByteBuffer,
 NioChannel, long)
  org.apache.tomcat.util.net.NioSelectorPool.read(ByteBuffer, NioChannel,
 Selector, long, boolean)
  org.apache.tomcat.util.net.NioSelectorPool.read(ByteBuffer, NioChannel,
 Selector, long)
  org.apache.coyote.ajp.AjpNioProcessor.readSocket(byte[], int, int,
 boolean)
  org.apache.coyote.ajp.AjpNioProcessor.read(byte[], int, int, boolean)
  org.apache.coyote.ajp.AjpNioProcessor.readMessage(AjpMessage, boolean)
  org.apache.coyote.ajp.AjpNioProcessor.receive()
  org.apache.coyote.ajp.AbstractAjpProcessor.refillReadBuffer()
 
 org.apache.coyote.ajp.AbstractAjpProcessor$SocketInputBuffer.doRead(ByteChunk,
 Request)
  org.apache.coyote.Request.doRead(ByteChunk)
  org.apache.catalina.connector.InputBuffer.realReadBytes(byte[], int, int)
  org.apache.tomcat.util.buf.ByteChunk.substract(byte[], int, int)
  org.apache.catalina.connector.InputBuffer.read(byte[], int, int)
  org.apache.catalina.connector.CoyoteInputStream.read(byte[])
  com.prosc.io.IOUtils.writeInputToOutput(InputStream, OutputStream, int)

 Almost all requests to the site are POST operations with small payloads.
 My theory, based on this stack trace, is that all threads are in contention
 for the single selector thread to read the contents of the POST, and that
 as the number of worker threads increases, so does thread contention,
 reducing overall throughput. Please let me know whether this sounds
 accurate to you.

 If so, how do I solve this? Here are my ideas, but I'm really not familiar
 enough with the connector configurations to know whether I'm on the right
 track or not:
 * Set 'org.apache.tomcat.util.net.NioSelectorShared' property to false. It
 sounds like this would give each worker thread concurrent access to the
 POST requests, although I can't quite tell from the documentation if that's
 true.
 * Re-write my client application to use multiple GET requests instead of
 single POST requests. This would be a lot of work, and seems like it should
 not be necessary.
 * Ditch the NIO connector and Apache/SSL front-end and move to APR/SSL
 with a whole lot of threads. Also seems like it should not be necessary; I
 thought my use case is exactly what NIO is made for.

 I'm open to any other ideas, thank you for all of your help!

 --Jesse Barnum, President, 360Works
 http://www.360works.com
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat JNDI Datasource

2014-02-06 Thread Filip Hanik
Yes, define the connection pool in server.xml, GlobalNamingResources then
in context.xml define a ContextLink That binds the shared connection pool
to each context.



On Thursday, February 6, 2014, David Newman dnew...@unixmonkeys.com wrote:

 I have defined a JNDI JDBC datasource as a resource in the global
 context.xml file.  I was under the impression that what this does is to
 create a shared connection pool that is tomcat wide.  But in practice what
 seems to happen is that a new instance of that connection pool is created
 for each context that is running in the container.  For example, if I have
 6 web applications deployed I end up with 60 connections to my database,
 assuming the default initialSize parameter of 10.

 Is there a way to have a single connection pool that is shared amongst
 deployed applications?

 In case it is relevant this is tomcat 7.0.19 using the tomcat connection
 pool.

 Thanks
 -Dave



Re: Tomcat 7 / Java 7

2014-01-27 Thread Filip Hanik
Yes it is compatible, and no, there is nothing you really need to do except
to test your applications that they work too.


On Mon, Jan 27, 2014 at 9:37 AM, Singh, Ragini rsi...@central.uh.eduwrote:

 Hello,

 Is Tomcat 7.0.42  compatible with Java 7?
 http://stackoverflow.com/questions/9294355/is-tomcat-7-now-compatible-with-java-7
 If yes, do you know if there is something special to migrate an existing
 installation of Tomcat 7/Java 6 to Tomcat 7/Java 7?


 -Ragini




Re: [OT] Out of memory exception - top posting

2014-01-24 Thread Filip Hanik
Since this is part of a thread, neither top nor bottom posting makes sense,
why include the previous post if we all have access to it in our
conversation thread.
the only time it makes sense to include it, would be when you reply in line
to multiple questions with multiple answers.

there, that should put a lid on it ;)


Re: Weird issue setting up SSL on a WinDoze box

2014-01-22 Thread Filip Hanik
delete the file tcnative-1.dll and tomcat reverts to java based ssl and
keystores.

On Wednesday, January 22, 2014, James H. H. Lampert 
jam...@touchtonecorp.com wrote:

 On 1/22/14 5:26 PM, Caldarale, Charles R wrote:

 You have installed and enabled the APR connector, but are trying to use
 the Java keystore.


 Actually, *I* didn't do the installation (the fellow at the next desk over
 did), and so I have no idea what options were selected.

 AS/400 installations use the Java SL mechanism. I know exactly nothing
 about APR or OpenSSL (a certain line from Men in Black pretty much sums
 it up, http://www.imdb.com/title/tt0119654/quotes?item=qt0402580 -- at
 this point, I'm Jay and everybody else on this list is Kay). If I sound
 frustrated, it's because I am.

 I'll be looking up the links you gave me tomorrow morning; anything else
 anybody can do to enlighten me would be appreciated.

 --
 JHHL

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Error when performing a reset of the server

2014-01-08 Thread Filip Hanik
Chuck, does this happen upon startup, restart or shutdown of the service?
That would be the first part of tracking it down.
here is some general configuration options available to you as a service

http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html




On Wed, Jan 8, 2014 at 1:57 PM, Chuck Johnson chuck.john...@simpson.eduwrote:

 Greetings,

 I am running 64-bit Tomcat 7.0.42 on a Windows 2008 R2 server as a
 service. We are using 64-bit Java 7 (jre7  and jdk1.7.0_25 are both
 installed on the server). I don't have much of any experience running
 Tomcat server, so I am at the early stages of learning about it... my
 experience is with Apache web server and various versions of IIS.

 The issue we are seeing is that the server throws an Error 1053: The
 service did not respond to the start or control request in a timely fashion

 I'm sorry if this question has been asked previously, I have searched
 on-line for a solution and found several potential fixes, although I am not
 sure if one is more appropriate than the other. One MS Support article
 recommends installing an update to the Microsoft .NET Framework 1.1 service
 pack (which I would think would be installed already since this is a newer
 installation), this is not a Tomcat/Java specific article. The other
 solution was to go into the Tomcat configuration tool and change the Mode
 from jvm to java in the Shutdown tab. I am also not sure if giving the
 Tomcat server more memory would help resolve the issue, the server has an
 Initial memory allocation  as well as a Maximum memory pool of 1024 MB.

 I am curious if there is anyone who has experienced these same problems
 stopping and restarting the server and how it was resolved.

 Thanks,

 Chuck

 Chuck Johnson
 Academic Software Specialist
 Information Technology Services
 Simpson College
 Indianola, Iowa
 direct: 515-961-1866 * optional: 515-961-1681
 www.simpson.eduhttp://www.simpson.edu/




Re: Error when performing a reset of the server

2014-01-08 Thread Filip Hanik
David, for you it is pretty straight forward, configure the shutdown
timeout, it could just be the app inside tomcat not shutting down, and you
can force it with a timeout. see the link I sent you.
Chuck, good chance this is what you need too.


On Wed, Jan 8, 2014 at 5:18 PM, David kerber dcker...@verizon.net wrote:

 On 1/8/2014 7:04 PM, David kerber wrote:

 I see this occasionally when trying to shut down the server, and I


 Correction:  when shutting down the Tomcat service, not the server itself.



  believe it's the app that has a stuck session or something, though I
 haven't been able to isolate it.  However, it doesn't require a server
 reboot; just killing the tomcat process in task manager and then
 restarting it works fine.



 On 1/8/2014 6:58 PM, Chuck Johnson wrote:

 Hi Filip,

 I haven't had the error occur when I have had to restart the Tomcat
 server, my co-worker is the person who has experienced it and my
 understanding is that it happens when she attempts to perform a reset
 and the only way that she resolves it is to reboot the windows server.

 I will read through the site that you have sent and see what I can
 figure out.

 Thanks,

 Chuck

 Chuck Johnson
 Academic Software Specialist
 Information Technology Services
 Simpson College
 Indianola, Iowa
 direct: 515-961-1866 * optional: 515-961-1681
 www.simpson.edu

 -Original Message-
 From: Filip Hanik [mailto:fi...@hanik.com]
 Sent: Wednesday, January 08, 2014 4:44 PM
 To: Tomcat Users List
 Subject: Re: Error when performing a reset of the server

 Chuck, does this happen upon startup, restart or shutdown of the service?
 That would be the first part of tracking it down.
 here is some general configuration options available to you as a service

 http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html




 On Wed, Jan 8, 2014 at 1:57 PM, Chuck Johnson
 chuck.john...@simpson.eduwrote:

  Greetings,

 I am running 64-bit Tomcat 7.0.42 on a Windows 2008 R2 server as a
 service. We are using 64-bit Java 7 (jre7  and jdk1.7.0_25 are both
 installed on the server). I don't have much of any experience running
 Tomcat server, so I am at the early stages of learning about it... my
 experience is with Apache web server and various versions of IIS.

 The issue we are seeing is that the server throws an Error 1053: The
 service did not respond to the start or control request in a timely
 fashion

 I'm sorry if this question has been asked previously, I have searched
 on-line for a solution and found several potential fixes, although I
 am not sure if one is more appropriate than the other. One MS Support
 article recommends installing an update to the Microsoft .NET
 Framework 1.1 service pack (which I would think would be installed
 already since this is a newer installation), this is not a Tomcat/Java
 specific article. The other solution was to go into the Tomcat
 configuration tool and change the Mode from jvm to java in the
 Shutdown tab. I am also not sure if giving the Tomcat server more
 memory would help resolve the issue, the server has an Initial memory
 allocation  as well as a Maximum memory pool of 1024 MB.

 I am curious if there is anyone who has experienced these same
 problems stopping and restarting the server and how it was resolved.

 Thanks,

 Chuck

 Chuck Johnson
 Academic Software Specialist
 Information Technology Services
 Simpson College
 Indianola, Iowa
 direct: 515-961-1866 * optional: 515-961-1681
 www.simpson.eduhttp://www.simpson.edu/




 --


 -
 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: Poller CometPoller general questions

2012-07-17 Thread Filip Hanik Mailing Lists
In http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
you can read about pollerThreadCount and useComet flags for the APR 
implementation.
You don't need Comet unless you applications specifically are using it, most 
likely they are not.

Filip


- Original Message -
 From: Jeffrey Janner jeffrey.jan...@polydyne.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, July 13, 2012 9:53:14 AM
 Subject: Poller  CometPoller general questions




 I'm more curious here than there being a problem.

 Are the Poller  CometPoller threads necessary for Tomcat operation?
 If not, how to turn them off, and do I want to turn them off.

 Here's my scenario:

 Tomcat 6.0.33 with APR on Windows Server 2008 (regular and R2).

 Fairly normal server.xml, with generic connector implementation,
 i.e., not explicitly specifying the protocol:

 !--APR library loader. Documentation at /docs/apr.html --

 Listener className=org.apache.catalina.core.AprLifecycleListener
 SSLEngine=on /

 Connector address=172.16.1.1 port=80 maxHttpHeaderSize=8192

 maxThreads=10 enableLookups=false redirectPort=443
 acceptCount=100

 connectionTimeout=2 disableUploadTimeout=true /

 Connector address=172.16.1.1 port=443 maxHttpHeaderSize=8192

 maxThreads=100 enableLookups=false acceptCount=100

 connectionTimeout=2 disableUploadTimeout=true

 scheme=https secure=true SSLEnabled=true

 SSLCertificateFile=path to server.crt

 SSLCertificateKeyFile= path to server.key

 SSLCertificateChainFile= path to _chain.crt

 SSLPassword=password /

 Web.xml is set up to force everything to HTTPS:

 user-data-constraint

 transport-guaranteeCONFIDENTIAL/transport-guarantee

 /user-data-constraint



 So Tomcat starts up and creates, in my case, 32 poller threads, 8
 poller and 8 cometpoller for each connector.

 Now, I know these just sit around waiting on AprEndpoint$Poller,
 basically doing nothing and really causing no harm, other than
 taking up some threads out of my available threadpool.

 I pretty sure we don’t use Comet, so I'd like to turn those off, but
 it's not clear in the documentation that I can, only looks like
 there are controls for the NIO connector.

 What, if anything, would the standard Poller threads be used for?

 Since everything gets forwarded to HTTPS, the HTTP poller threads
 seam exceptionally useless.



 Jeffrey Janner

 Sr. Network Administrator

 jeffrey.jan...@polydyne.com

 PolyDyne Software Inc.

 Main: 512.343.9100

 Direct: 512.583.8930



 cid:image002.png@01CC0FB7.4FF43CE0



 Speed, Intelligence  Savings in Sourcing




 __

 Confidentiality Notice: This Transmission (including any attachments)
 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 you are hereby notified that any
 dissemination, distribution, or copying of this communication is
 strictly prohibited.

 If you have received this transmission in error, please immediately
 reply to the sender or telephone (512) 343-9100 and delete this
 transmission from your system.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Exception Message:org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to org.apache.tomcat.dbcp.dbcp.BasicDataSource

2012-07-09 Thread Filip Hanik
That's what's wrong. Remove them all from web-inf/lib

Sent from my iPad, pardon any brevity. 
Filip Hanik


On Jul 9, 2012, at 10:58, vijay.gan...@subk.co.in wrote:

 yes in both CATALINA_HOME/lib and app/WEB-INF/lib,
 tomcat-dbcp.jar,ojdbc14.jar and lasses12.jar files are available.
 
 
 
 - Original Message -
 Thanks for your reply,
 
 1. $CATALINA_HOME/lib
 
 2. conf/context.xml?
 
 3. In y application/lib also tomcat-dbcp.jar,ojdbc14.jar files are
 available. Please suggest how to debug any useful site.
 
 I'm not sure I fully understand this statement.  Are you saying that you
 have the tomcat-dbcp.jar and ojdbc14.jar files in both
 $CATALINA_HOME/lib and app/WEB-INF/lib?
 
 If so, you're asking for trouble.  Just leave them in $CATALINA_HOME/lib
 and remove them from your application.
 
 Dan
 
 
 
 
 
 Thanks,
 
 
 - Original Message -
 Hi All,
 
 I am getting class cast exception when casting DataSource to
 BasicDataSource.
 The same is executed when run on JDeveloper.
 
 Environment : Tomcat 7.X
 DB : Oracle
 
 Used : tomcat-dbcp.jar,ojdbc14.jar
 
 Where do you have these deployed?  WEB-INF/lib? $CATALINA_BASE/lib?
 $CATALINA_HOME/lib?
 
 
 context.xml
 
 What is the location of this context file?  conf/context.xml?
 META-INF/context.xml?
 
 
 
 Resource name=jdbc/ShipConsoleDS auth=Container
  type=javax.sql.DataSource
  driverClassName=oracle.jdbc.OracleDriver
  url=jdbc:oracle:thin:@sharp.appsahyd.com:1521:DEV01
  username=apps password=apps maxActive=-1 maxIdle=0
  maxWait=-1 initialSize=15
  accessToUnderlyingConnectionAllowed=true /
 
 Java Code to access Data Source :
 
 InitialContext initContext = new InitialContext();
 Context envContext = (Context)
 initContext.lookup(java:/comp/env);
 DataSource dataSource = (DataSource)
 envContext.lookup(jdbc/ShipConsoleDS);
 BasicDataSource bds = (BasicDataSource)dataSource;
 
 
 Exception :
 
 Exception Message:org.apache.tomcat.dbcp.dbcp.BasicDataSource
 cannot
 be cast to org.apache.tomcat.dbcp.dbcp.BasicDataSource
 
 I've seen similar exceptions before when the BasicDataSource class
 loaded
 by two different class loaders.  For example, from the common class
 loader
 and from the webapp class loader.  Check your class path to see if
 this
 might be occurring.
 
 Also, you might want to add the -verbose:class option to your JVM
 options.  This will print the classes that are loaded and the
 location
 from where they are loaded.  This is helpful if the class is
 unknowingly
 loaded twice.
 
 Dan
 
 
 
 java.lang.ClassCastException:
 org.apache.tomcat.dbcp.dbcp.BasicDataSource
 cannot
 be cast to org.apache.tomcat.dbcp.dbcp.BasicDataSource
at
 com.aasc.model.AascOracleDAOFactory.createConnection(AascOracleDAOFac
 tory.java:96)
at
com.aasc.model.AascDBAccess.getConnection(AascDBAccess.java:58)
at
com.aasc.model.AascDBAccess.getValues(AascDBAccess.java:84)
at
 org.apache.jsp.aascShipConsoleIndex_jsp._jspService(aascShipConsoleIn
 dex_jsp.java:296)
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:432)
at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
 90)
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(Appl
 icationFilterChain.java:305)
at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
 ilterChain.java:210)
at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
 alve.java:225)
at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
 alve.java:169)
at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
 torBase.java:472)
at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
 ava:168)
at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
 ava:98)
at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
 927)
at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
 ve.java:118)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
 a:407)
at
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
 11Processor.java:999)
at
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
 AbstractProtocol.java:565)
at
 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
 t.java:309)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
 Source
 )
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source

RE: Multicast fails when mcastBindAddress is explicitly set

2012-06-29 Thread Filip Hanik (mailing lists)
Sounds like you need to enable multicasting. This would be a VM/hypervisor 
configuration issue.

Filip

 -Original Message-
 From: Madhav Bhargava [mailto:unmarsh...@gmail.com]
 Sent: Friday, June 29, 2012 10:04 AM
 To: users@tomcat.apache.org
 Subject: Re: Multicast fails when mcastBindAddress is explicitly set
 
 Hi All,
 
 Ok we got resolution for the below exception. The problem was that both
 IPV4 and IPv6 addresses were enabled for the multihome machine. We
 switched
 to IPv6 addresses and the issue was no longer there. However there is
 still
 one issue:
 
 With machines on different hypervisors the multicast traffic seems to be
 blocked. VM's on different Hypervisors are not able to get presence or
 any
 other message from each other. So neither the discovery works nor inter
 node communication because there is no knowledge of the other VMs
 
 Best Regard,
 Madhav
 
 On Fri, Jun 29, 2012 at 5:58 PM, Madhav Bhargava
 unmarsh...@gmail.comwrote:
 
  Hi All,
 
  We are using Apache Tribes 7.0.2. We use it for node discovery and p2p
  communication.
  We are currently running into a problem where the discovery fails on
  multihomed machines (multiple IP's). We were not sure to which IP the
  multicast bind address was getting bound to, so we thought of
 explicitly
  binding the interface via mcastBindAddress property. However when we
 set
  this property then we get the following exception:
 
  Exception occured: java.io.IOException: Invalid argument; No faulty
  members identified.org.apache.catalina.tribes.ChannelException:
  java.io.IOException: Invalid argument; No faulty members identified.
 
  at
 
 org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(Channe
 lCoordinator.java:178)
 
  at
 
 org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordin
 ator.java:99)
 
  at
 
 org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInt
 erceptorBase.java:162)
 
  at
 
 org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
 .start(MessageDispatchInterceptor.java:153)
 
  at
 
 org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInt
 erceptorBase.java:162)
 
  at
 
 org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:41
 9)
 
  at
 
 com.sap.it.gizmos.diag.TribesConfigurator.run(TribesConfigurator.java:10
 9)
 
  at
 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 
  at
  java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 
  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 
  at
 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav
 a:1110)
 
  at
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
 va:603)
 
  at java.lang.Thread.run(Thread.java:782)
 
  Caused by: java.io.IOException: Invalid argument
 
  at java.net.PlainDatagramSocketImpl.send(Native Method)
 
  at java.net.DatagramSocket.send(DatagramSocket.java:675)
 
  at
 
 org.apache.catalina.tribes.membership.McastServiceImpl.send(McastService
 Impl.java:503)
 
  at
 
 org.apache.catalina.tribes.membership.McastServiceImpl.send(McastService
 Impl.java:480)
 
  at
 
 org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServic
 eImpl.java:269)
 
  at
 
 org.apache.catalina.tribes.membership.McastService.start(McastService.ja
 va:386)
 
  at
 
 org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(Channe
 lCoordinator.java:167)
 
  ... 12 more
 
  So we wrote a simple test program (attached) which fails on multi-home
  machines. We also wrote another test program where we just used simple
  java.net.MulticastSocket, set the multicast interface (using
 setInterface)
  to one of the interfaces and tried to send a Datagram packet and it
 was
  able to send.
 
  So now we wonder:
 
  1. How do you explicitly set the multicast interface on the group
 channel
  in apache tribes?
  2. I assume that tcpListenHost is the IP address that gets advertised
 when
  it joins the group and mcastBindAddress is the interface used to send
 out
  messages over a multicast socket. Is my assumption right?
 
  Any help/pointers would be greatly appreciated.
 
  Best Regards,
  Madhav
 
 
  --
  When I tell the truth, it is not for the sake of convincing those who
 do
  not know it, but for the sake of defending those that do
 
 
 
 
 --
 When I tell the truth, it is not for the sake of convincing those who do
 not know it, but for the sake of defending those that do


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Multicast fails when mcastBindAddress is explicitly set

2012-06-29 Thread Filip Hanik (mailing lists)
I'd write a simple test program to see.

 -Original Message-
 From: Madhav Bhargava [mailto:unmarsh...@gmail.com]
 Sent: Friday, June 29, 2012 10:16 AM
 To: Tomcat Users List
 Subject: Re: Multicast fails when mcastBindAddress is explicitly set
 
 Hi Filip,
 
 We as development teams do not have access to the production VM/HV's but
 it
 was told to us that multicast is enabled and they have explicitly
 checked
 the Xen virtual bridges/switch to check if the multicast is blocked but
 it
 does not seem to be.
 
 At this point in time we do not know if the issue is because of apache
 tribes or it is just related to HV configuration.
 
 Best Regards,
 Madhav
 
 On Fri, Jun 29, 2012 at 9:36 PM, Filip Hanik (mailing lists) 
 devli...@hanik.com wrote:
 
  Sounds like you need to enable multicasting. This would be a
 VM/hypervisor
  configuration issue.
 
  Filip
 
   -Original Message-
   From: Madhav Bhargava [mailto:unmarsh...@gmail.com]
   Sent: Friday, June 29, 2012 10:04 AM
   To: users@tomcat.apache.org
   Subject: Re: Multicast fails when mcastBindAddress is explicitly set
  
   Hi All,
  
   Ok we got resolution for the below exception. The problem was that
 both
   IPV4 and IPv6 addresses were enabled for the multihome machine. We
   switched
   to IPv6 addresses and the issue was no longer there. However there
 is
   still
   one issue:
  
   With machines on different hypervisors the multicast traffic seems
 to be
   blocked. VM's on different Hypervisors are not able to get presence
 or
   any
   other message from each other. So neither the discovery works nor
 inter
   node communication because there is no knowledge of the other VMs
  
   Best Regard,
   Madhav
  
   On Fri, Jun 29, 2012 at 5:58 PM, Madhav Bhargava
   unmarsh...@gmail.comwrote:
  
Hi All,
   
We are using Apache Tribes 7.0.2. We use it for node discovery and
 p2p
communication.
We are currently running into a problem where the discovery fails
 on
multihomed machines (multiple IP's). We were not sure to which IP
 the
multicast bind address was getting bound to, so we thought of
   explicitly
binding the interface via mcastBindAddress property. However
 when we
   set
this property then we get the following exception:
   
Exception occured: java.io.IOException: Invalid argument; No
 faulty
members identified.org.apache.catalina.tribes.ChannelException:
java.io.IOException: Invalid argument; No faulty members
 identified.
   
at
   
  
 org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(Channe
   lCoordinator.java:178)
   
at
   
  
 org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordin
   ator.java:99)
   
at
   
  
 org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInt
   erceptorBase.java:162)
   
at
   
  
 org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
   .start(MessageDispatchInterceptor.java:153)
   
at
   
  
 org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInt
   erceptorBase.java:162)
   
at
   
  
 org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:41
   9)
   
at
   
  
 com.sap.it.gizmos.diag.TribesConfigurator.run(TribesConfigurator.java:10
   9)
   
at
   
  
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
   
at
 java.util.concurrent.FutureTask.run(FutureTask.java:166)
   
at
   
  
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav
   a:1110)
   
at
   
  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
   va:603)
   
at java.lang.Thread.run(Thread.java:782)
   
Caused by: java.io.IOException: Invalid argument
   
at java.net.PlainDatagramSocketImpl.send(Native Method)
   
at java.net.DatagramSocket.send(DatagramSocket.java:675)
   
at
   
  
 org.apache.catalina.tribes.membership.McastServiceImpl.send(McastService
   Impl.java:503)
   
at
   
  
 org.apache.catalina.tribes.membership.McastServiceImpl.send(McastService
   Impl.java:480)
   
at
   
  
 org.apache.catalina.tribes.membership.McastServiceImpl.start(McastServic
   eImpl.java:269)
   
at
   
  
 org.apache.catalina.tribes.membership.McastService.start(McastService.ja
   va:386)
   
at
   
  
 org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(Channe
   lCoordinator.java:167)
   
... 12 more
   
So we wrote a simple test program (attached) which fails on multi-
 home
machines. We also wrote another test program where we just used
 simple
java.net.MulticastSocket, set the multicast interface (using
   setInterface)
to one of the interfaces and tried

RE: Tomcat 7.0.28 connection pool issue

2012-06-29 Thread Filip Hanik (mailing lists)
An update on this issue. Yassir tested with a JAR I built against trunk.
What this could mean is that the bug 
https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
somehow didn't make it into the build of 7.0.28

I will double check it. 

Filip

 -Original Message-
 From: Filip Hanik (mailing lists) [mailto:devli...@hanik.com]
 Sent: Thursday, June 28, 2012 2:42 PM
 To: 'Tomcat Users List'
 Subject: RE: Tomcat 7.0.28 connection pool issue
 
 Martin, generally I would run with fairQueue=false - this is the
 default.
 The only time I would change to fairQueue=true is if we see threads
 being
 starved, and not getting connections. However, this scenario is very
 unlikely unless there is extreme concurrency going on.
 
 Filip
 
  -Original Message-
  From: Martin Gainty [mailto:mgai...@hotmail.com]
  Sent: Thursday, June 28, 2012 1:38 PM
  To: Tomcat Users List
  Subject: RE: Tomcat 7.0.28 connection pool issue
 
 
  Hi Filip
 
  Is there an algorithm we can use to determine if the op should
 configure
  concurrent db connections (fairQueue=false)  vs config non-concurrent
 db
  connections (fairQueue=true)
  e.g. if 50%+ of database cursors are 'read-only' then concurrent
  connections *should be used* and TC attribute of fairQueue should be
 set
  to false
  Thanks!
  Martin
  __
  Place legal disclaimer here
 
From: devli...@hanik.com
   To: users@tomcat.apache.org
   Subject: RE: Tomcat 7.0.28 connection pool issue
   Date: Thu, 28 Jun 2012 11:36:49 -0600
  
   Then the issue you may be running into is that your Tomcat
  configuration
   supports a higher concurrency level than what your Resin
 configuration
  is
   setup to do.
   With higher concurrency, there will be a need for more data base
   connections. If you still want to run with a lower number of
  connections,
   what you can do is set
  
   fairQueue=true
   maxWait=time in milliseconds to wait for next available connection
  
   and what this effectively will do, is lower your concurrency.
  Recommended is
   of course to increase maxActive if the database supports it.
  
   Filip
  
  
-Original Message-
From: Yasser [mailto:yarafa...@gmail.com]
Sent: Thursday, June 28, 2012 11:33 AM
To: Tomcat Users List
Subject: Re: Tomcat 7.0.28 connection pool issue
   
That was the issue with Tomcat 7.0.26 and they fixed it in 7.0.28
   
   
On Thu, Jun 28, 2012 at 11:54 AM, Filip Hanik (mailing lists) 
devli...@hanik.com wrote:
   
 Could you have run into
 https://issues.apache.org/bugzilla/show_bug.cgi?id=53367

 ?

 You could try out
 http://people.apache.org/~fhanik/jdbc-pool/bz53367-jdbc-pool.jar


  -Original Message-
  From: Yasser [mailto:yarafa...@gmail.com]
  Sent: Thursday, June 28, 2012 9:39 AM
  To: Tomcat Users List
  Subject: Re: Tomcat 7.0.28 connection pool issue
 
  Yes. It does show that maxactive has reached 100. I also use
  splunk
to
  get
  the connection status at the oracle side.
  What I dont understand is that Resin needs just 50 connections
  to
handle
  the same load. I am in the process of increasing the count to
  300
and
  see
  if that makes a difference. Oracle has the capacity to handle
  that
many
  connections.
 
 
  On Thu, Jun 28, 2012 at 11:01 AM, Hedrick, Brooke - 43 
  brooke.hedr...@rainhail.com wrote:
 
  
-Original Message-
From: Yasser [mailto:yarafa...@gmail.com]
Sent: Thursday, June 28, 2012 9:44 AM
To: users@tomcat.apache.org
Subject: Tomcat 7.0.28 connection pool issue
   
   ...
What is the issue?
When we run a stress test on the same codebase deployed to
Tomcat
  7.0.28,
at about 2hr45min into the test with 530 virtual users
  logged in
(at
   peak load),
I get a lot of connection pool empty errors. The maxactive
attribute
   (using
tomcat connection pool) has been set to 100.
   
  
   Have you used jconsole to monitor the pool usage?
  
   -Brooke
  
Other information:
CAS runs on a different server with a dedicated tomcat
 home
  and
  base. I
dont see any errors on this box.
7.0.26 was found to have a bug in the way connection count
  is
  determined,
which got fixed in 7.0.28, hence we switched to the latest
version.
   
Here is one of the connection pool config from server.xml.
  We do
a
   resource
link to this pool in the context.xml
   
Resource name=jdbc/global-wl auth=Container
type=javax.sql.DataSource username=webconnect
password=xxx
driverClassName=oracle.jdbc.driver.OracleDriver
   
   
   
 url=jdbc:oracle:thin:@dbs.ip:oracle.db.port:dts.dbname

RE: Tomcat 7.0.28 connection pool issue

2012-06-28 Thread Filip Hanik (mailing lists)
Could you have run into 
https://issues.apache.org/bugzilla/show_bug.cgi?id=53367

?

You could try out
http://people.apache.org/~fhanik/jdbc-pool/bz53367-jdbc-pool.jar


 -Original Message-
 From: Yasser [mailto:yarafa...@gmail.com]
 Sent: Thursday, June 28, 2012 9:39 AM
 To: Tomcat Users List
 Subject: Re: Tomcat 7.0.28 connection pool issue
 
 Yes. It does show that maxactive has reached 100. I also use splunk to
 get
 the connection status at the oracle side.
 What I dont understand is that Resin needs just 50 connections to handle
 the same load. I am in the process of increasing the count to 300 and
 see
 if that makes a difference. Oracle has the capacity to handle that many
 connections.
 
 
 On Thu, Jun 28, 2012 at 11:01 AM, Hedrick, Brooke - 43 
 brooke.hedr...@rainhail.com wrote:
 
 
   -Original Message-
   From: Yasser [mailto:yarafa...@gmail.com]
   Sent: Thursday, June 28, 2012 9:44 AM
   To: users@tomcat.apache.org
   Subject: Tomcat 7.0.28 connection pool issue
  
  ...
   What is the issue?
   When we run a stress test on the same codebase deployed to Tomcat
 7.0.28,
   at about 2hr45min into the test with 530 virtual users logged in (at
  peak load),
   I get a lot of connection pool empty errors. The maxactive attribute
  (using
   tomcat connection pool) has been set to 100.
  
 
  Have you used jconsole to monitor the pool usage?
 
  -Brooke
 
   Other information:
   CAS runs on a different server with a dedicated tomcat home and
 base. I
   dont see any errors on this box.
   7.0.26 was found to have a bug in the way connection count is
 determined,
   which got fixed in 7.0.28, hence we switched to the latest version.
  
   Here is one of the connection pool config from server.xml. We do a
  resource
   link to this pool in the context.xml
  
   Resource name=jdbc/global-wl auth=Container
   type=javax.sql.DataSource username=webconnect
   password=xxx
   driverClassName=oracle.jdbc.driver.OracleDriver
  
   url=jdbc:oracle:thin:@dbs.ip:oracle.db.port:dts.dbname
   
 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
   maxActive=100 /
  
   Any help is appreciated. Please let me know if you need more
 information
  or
   code snippets.
  
   Thanks,
  
   Yasser
 
  -
  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 7.0.28 connection pool issue

2012-06-28 Thread Filip Hanik (mailing lists)
Then the issue you may be running into is that your Tomcat configuration
supports a higher concurrency level than what your Resin configuration is
setup to do.
With higher concurrency, there will be a need for more data base
connections. If you still want to run with a lower number of connections,
what you can do is set

fairQueue=true
maxWait=time in milliseconds to wait for next available connection

and what this effectively will do, is lower your concurrency. Recommended is
of course to increase maxActive if the database supports it.

Filip


 -Original Message-
 From: Yasser [mailto:yarafa...@gmail.com]
 Sent: Thursday, June 28, 2012 11:33 AM
 To: Tomcat Users List
 Subject: Re: Tomcat 7.0.28 connection pool issue
 
 That was the issue with Tomcat 7.0.26 and they fixed it in 7.0.28
 
 
 On Thu, Jun 28, 2012 at 11:54 AM, Filip Hanik (mailing lists) 
 devli...@hanik.com wrote:
 
  Could you have run into
  https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
 
  ?
 
  You could try out
  http://people.apache.org/~fhanik/jdbc-pool/bz53367-jdbc-pool.jar
 
 
   -Original Message-
   From: Yasser [mailto:yarafa...@gmail.com]
   Sent: Thursday, June 28, 2012 9:39 AM
   To: Tomcat Users List
   Subject: Re: Tomcat 7.0.28 connection pool issue
  
   Yes. It does show that maxactive has reached 100. I also use splunk
 to
   get
   the connection status at the oracle side.
   What I dont understand is that Resin needs just 50 connections to
 handle
   the same load. I am in the process of increasing the count to 300
 and
   see
   if that makes a difference. Oracle has the capacity to handle that
 many
   connections.
  
  
   On Thu, Jun 28, 2012 at 11:01 AM, Hedrick, Brooke - 43 
   brooke.hedr...@rainhail.com wrote:
  
   
 -Original Message-
 From: Yasser [mailto:yarafa...@gmail.com]
 Sent: Thursday, June 28, 2012 9:44 AM
 To: users@tomcat.apache.org
 Subject: Tomcat 7.0.28 connection pool issue

...
 What is the issue?
 When we run a stress test on the same codebase deployed to
 Tomcat
   7.0.28,
 at about 2hr45min into the test with 530 virtual users logged in
 (at
peak load),
 I get a lot of connection pool empty errors. The maxactive
 attribute
(using
 tomcat connection pool) has been set to 100.

   
Have you used jconsole to monitor the pool usage?
   
-Brooke
   
 Other information:
 CAS runs on a different server with a dedicated tomcat home and
   base. I
 dont see any errors on this box.
 7.0.26 was found to have a bug in the way connection count is
   determined,
 which got fixed in 7.0.28, hence we switched to the latest
 version.

 Here is one of the connection pool config from server.xml. We do
 a
resource
 link to this pool in the context.xml

 Resource name=jdbc/global-wl auth=Container
 type=javax.sql.DataSource username=webconnect
 password=xxx
 driverClassName=oracle.jdbc.driver.OracleDriver


 url=jdbc:oracle:thin:@dbs.ip:oracle.db.port:dts.dbname
 

 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
 maxActive=100 /

 Any help is appreciated. Please let me know if you need more
   information
or
 code snippets.

 Thanks,

 Yasser
   
--
 ---
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 7.0.28 connection pool issue

2012-06-28 Thread Filip Hanik (mailing lists)
Martin, generally I would run with fairQueue=false - this is the default.
The only time I would change to fairQueue=true is if we see threads being
starved, and not getting connections. However, this scenario is very
unlikely unless there is extreme concurrency going on.

Filip

 -Original Message-
 From: Martin Gainty [mailto:mgai...@hotmail.com]
 Sent: Thursday, June 28, 2012 1:38 PM
 To: Tomcat Users List
 Subject: RE: Tomcat 7.0.28 connection pool issue
 
 
 Hi Filip
 
 Is there an algorithm we can use to determine if the op should configure
 concurrent db connections (fairQueue=false)  vs config non-concurrent db
 connections (fairQueue=true)
 e.g. if 50%+ of database cursors are 'read-only' then concurrent
 connections *should be used* and TC attribute of fairQueue should be set
 to false
 Thanks!
 Martin
 __
 Place legal disclaimer here
 
   From: devli...@hanik.com
  To: users@tomcat.apache.org
  Subject: RE: Tomcat 7.0.28 connection pool issue
  Date: Thu, 28 Jun 2012 11:36:49 -0600
 
  Then the issue you may be running into is that your Tomcat
 configuration
  supports a higher concurrency level than what your Resin configuration
 is
  setup to do.
  With higher concurrency, there will be a need for more data base
  connections. If you still want to run with a lower number of
 connections,
  what you can do is set
 
  fairQueue=true
  maxWait=time in milliseconds to wait for next available connection
 
  and what this effectively will do, is lower your concurrency.
 Recommended is
  of course to increase maxActive if the database supports it.
 
  Filip
 
 
   -Original Message-
   From: Yasser [mailto:yarafa...@gmail.com]
   Sent: Thursday, June 28, 2012 11:33 AM
   To: Tomcat Users List
   Subject: Re: Tomcat 7.0.28 connection pool issue
  
   That was the issue with Tomcat 7.0.26 and they fixed it in 7.0.28
  
  
   On Thu, Jun 28, 2012 at 11:54 AM, Filip Hanik (mailing lists) 
   devli...@hanik.com wrote:
  
Could you have run into
https://issues.apache.org/bugzilla/show_bug.cgi?id=53367
   
?
   
You could try out
http://people.apache.org/~fhanik/jdbc-pool/bz53367-jdbc-pool.jar
   
   
 -Original Message-
 From: Yasser [mailto:yarafa...@gmail.com]
 Sent: Thursday, June 28, 2012 9:39 AM
 To: Tomcat Users List
 Subject: Re: Tomcat 7.0.28 connection pool issue

 Yes. It does show that maxactive has reached 100. I also use
 splunk
   to
 get
 the connection status at the oracle side.
 What I dont understand is that Resin needs just 50 connections
 to
   handle
 the same load. I am in the process of increasing the count to
 300
   and
 see
 if that makes a difference. Oracle has the capacity to handle
 that
   many
 connections.


 On Thu, Jun 28, 2012 at 11:01 AM, Hedrick, Brooke - 43 
 brooke.hedr...@rainhail.com wrote:

 
   -Original Message-
   From: Yasser [mailto:yarafa...@gmail.com]
   Sent: Thursday, June 28, 2012 9:44 AM
   To: users@tomcat.apache.org
   Subject: Tomcat 7.0.28 connection pool issue
  
  ...
   What is the issue?
   When we run a stress test on the same codebase deployed to
   Tomcat
 7.0.28,
   at about 2hr45min into the test with 530 virtual users
 logged in
   (at
  peak load),
   I get a lot of connection pool empty errors. The maxactive
   attribute
  (using
   tomcat connection pool) has been set to 100.
  
 
  Have you used jconsole to monitor the pool usage?
 
  -Brooke
 
   Other information:
   CAS runs on a different server with a dedicated tomcat home
 and
 base. I
   dont see any errors on this box.
   7.0.26 was found to have a bug in the way connection count
 is
 determined,
   which got fixed in 7.0.28, hence we switched to the latest
   version.
  
   Here is one of the connection pool config from server.xml.
 We do
   a
  resource
   link to this pool in the context.xml
  
   Resource name=jdbc/global-wl auth=Container
   type=javax.sql.DataSource username=webconnect
   password=xxx
   driverClassName=oracle.jdbc.driver.OracleDriver
  
  
   url=jdbc:oracle:thin:@dbs.ip:oracle.db.port:dts.dbname
   
  
   factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
   maxActive=100 /
  
   Any help is appreciated. Please let me know if you need more
 information
  or
   code snippets.
  
   Thanks,
  
   Yasser
 
  --
 
   ---
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
   
   
--
 ---
To unsubscribe, e-mail: users

RE: non blocking Websockets?

2012-05-31 Thread Filip Hanik (mailing lists)
You can achieve that right now. Use the NIO connector, And then set up the
write buffer:

Connector protocol=org.apache.coyote.http11.Http11NioProtocol
   socket.txBufSize=set socket buffer size in bytes here
   
The only blocking aspect the connector actually has is to put the data in
the OS TCP write buffer. After that, the OS delivers it asynchronously.
So if you size this buffer correctly, you will achieve complete non blocking
data

Filip


 -Original Message-
 From: Christian Finckler [mailto:christian.finck...@gmx.de]
 Sent: Thursday, May 31, 2012 11:45 AM
 To: Tomcat Users List
 Subject: Re: non blocking Websockets?
 
 
 
 Am 31.05.2012 11:09, schrieb Mark Thomas:
  On 31/05/2012 10:02, Christian Finckler wrote:
  Hello,
  as far I understood, the websocket implementation of tomcat is using
 one
  thread per client.
  Is there also a possibility to configure it to use non blocking IO?
  No. That has not yet been implemented. It shouldn't be too hard
 provided
  that non-blocking is used between messages and blocking is used during
  messages. Obviously, the BIO connector will always use blocking.
 
  Mark
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 Ok, if that is so easy, it should be done. I am developing an online
 game, in which the player dont send messages very often (max: ten
 messages per minute), but is is very important to get the messages of
 other players very fast. Thats why I want to use websockets. But now it
 would be sad, if I need multiple tomcat instances only for connection
 handling although the process handling itself is not very complicated
 (cpu and memory intensive).
 
 Thank you,
 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: encrypt the database password

2012-05-24 Thread Filip Hanik Mailing Lists
yes, there is, search http://tomcat.markmail.org for the same
org.apache.tomcat.util.digester.PROPERTY_SOURCE
is a system property where you can add the code that digests properties in 
server.xml
This code can 'decode' your encoded properties



- Original Message -
 From: Bill Wang bw57...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, May 23, 2012 11:34:10 PM
 Subject: encrypt the database password
 
 Hi All,
 
 There is a tomcat server with some database setup.
 
 cd apache-tomcat-6.0.29/conf
 cat server.xml
 
   Resource auth=Container
 driverClassName=oracle.jdbc.driver.OracleDriver
 
   factory=oracle.jdbc.pool.OracleDataSourceFactory
 maxActive=20
   maxIdle=10 maxWait=-1 name=jdbc/abc
   password=abcADMIN
   type=oracle.jdbc.pool.OracleDataSource
 
 url=jdbc:oracle:thin:@localhost:1521:mydb user=abc /
 
 
 So which the plain password, end user may get the password directly.
 
 
 How can create encrypted password within server.xml
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7. MX4J

2012-05-23 Thread Filip Hanik Mailing Lists
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html#JMX_Remote_Lifecycle_Listener_-_org.apache.catalina.mbeans.JmxRemoteLifecycleListener



- Original Message -
 From: Vadzim Mikhalenak vadzim.mikhale...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Tuesday, May 22, 2012 4:06:52 PM
 Subject: Re: Tomcat 7. MX4J
 
 On Wed, May 23, 2012 at 12:31 AM, Konstantin Kolinko
 knst.koli...@gmail.com
  wrote:
 
  2012/5/22 Vadzim Mikhalenak vadzim.mikhale...@gmail.com:
   Hello  Christopher,
   *
   *
   Thank you for the reply! Yes, link
   http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html is for
   version
  5.5
   but we are migrating from version 6 (sorry for the confusion) but
   the
   configuration above was valid for version 6
  
 
  It works (or at least tries to start, to my surprise) in Tomcat 6
  with
  this particular AJP/1.3 connector implementation, but it is not
  documented and not supported.  Other connectors do not support
  those
  attributes and this one was removed from Tomcat 7.
 
  Tomcat 6 and 7 use JMX support provided by JRE and if you need http
  access to it, the common way is to use JMXProxy servlet that is
  part
  of the manager webapp.
 
  It is all is documented
  http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html
 
  http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Using_the_JMX_Proxy_Servlet
 
  or see the same docs for Tomcat 7.
 
 
 
Connector port=${AJP.PORT}
  handler.list=mx
  mx.enabled=true
  mx.httpHost=${JMX.HOST}
  mx.httpPort=${JMX.PORT}
  protocol=AJP/1.3 /
  
  
   *
   *
   and gave us opportunity to manage JMX beans using  http://
   ${JMX.HOST}:${JMX.PORT} (please see
  
  http://logback.qos.ch/manual/images/chapters/jmxConfigurator/mx4j_jetty.gif
   )
   In version 7 I couldn't see any possibility to do it.
   I've noticed that in Connector class of version 6
   if (AJP/1.3.equals(protocol)) {
  setProtocolHandlerClassName
  (org.apache.jk.server.JkCoyoteHandler);
  
   org.apache.jk.server.JkCoyoteHandler used JkMain which used JkMX
   where
   HttpAdapter from mx4j-tool.jar was used.
  
   but in version 7
   else if (AJP/1.3.equals(protocol)) {
  setProtocolHandlerClassName
  (org.apache.coyote.ajp.AjpAprProtocol);
  
  
  
   So do we have possibility to manage JMX beans in version 7 as we
   could in
   version 6? (please see
  
  http://logback.qos.ch/manual/images/chapters/jmxConfigurator/mx4j_jetty.gif
)
  
 
  Please
  1. Post your response below the text that you are replying to (aka
  do
  not top-post)
  2. Do not cross-post questions between users@ and dev@ lists.
 
  This one belongs to users@.
 
  Best regards,
  Konstantin Kolinko
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
  Hi,
 
 Thanks for the reply.
 I know about JMX Proxy Servlet but it was more preferable to use MX4J
 page
 and I thought there is simple way to configure it (as it was
 configured in
 6 version).
 I'll be looking for solution to get mx4j page working.
 Thanks again for your help!
 Sorry for the trouble.
 
 Best regards,
 Vadim.
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: DefaultServlet socketWrite hang

2012-05-21 Thread Filip Hanik Mailing Lists
if you look deeper under the hood of Java NET/IO you will see that there is no 
configurable timeout for writing blocking IO.
The best thing you can do is upgrade to Tomcat 6, and use the NIO connector 
(protocol=org.apache.coyote.http11.Http11NioProtocol) as that has a 
configurable timeout for writing data.

best
Filip


- Original Message -
 From: Douglas Briere douglas.bri...@ca.com
 To: 'users@tomcat.apache.org'
 Sent: Tuesday, May 15, 2012 4:18:00 PM
 Subject: DefaultServlet socketWrite hang
 
 
 Hello,
 
 We are using tomcat 5.5.30. I saw the following 26 times at one of
 customers sites.  Our web server is used to launch JNLP
 applications, so I believe this was downloading the client jar
 files.  However, java webstart caches after the first occurrence so
 this is a bit odd.  Has anyone seen this before? It appears these
 threads are getting stalled out.  Could a socket timeout be
 configured?  Thanks.
 
 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:751)
 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:774)
 at
 
 org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)
 at
 
 org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:584)
 at
 org.apache.coyote.Response.doWrite(Response.java:560)
 at
 
 org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:365)
 at
 
 org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:352)
 at
 
 org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:396)
 at
 
 org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:385)
 at
 
 org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
 at
 
 org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1839)
 at
 
 org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:929)
 at
 
 org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:385)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
 at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 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.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
 at
 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
 at
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at
 
 org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:500)
 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:879)
 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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at
 
 

RE: Start Tomcat6 service with StartMode as java

2012-05-08 Thread Filip Hanik (mailing lists)
The Java Service Wrapper does this for you, if you want to try an
alternative
http://wrapper.tanukisoftware.com/doc/english/download.jsp


 -Original Message-
 From: Venkata R Madugundu [mailto:venkataraman...@in.ibm.com]
 Sent: Tuesday, May 08, 2012 8:07 AM
 To: Venkata R Madugundu
 Cc: users@tomcat.apache.org
 Subject: Re: Start Tomcat6 service with StartMode as java
 
 Hi,
 
 We have been trying to run Tomcat6 windows service to spawn java.exe
 instead of loading having JVM loaded in process.
 I have tried to follow through all the documentation of Tomcat6 and
 procrun
 to use StartMode as 'java'.
 
 But no matter how I tweak the arguments, the StartMode with 'java' does
 not
 seem to work. Do you know if there is a deterministic way to make it
 work.
 We are using Tomcat 6.0.20
 
 Here is the relevant content of the service install script.
 
 
 
 ---
 set INSTALL_DIR=%~dp0
 
 rem Tomcat 'catalina home' and 'catalina base' paths
 cd ..
 set CATALINA_HOME=%cd%
 set CATALINA_BASE=%CATALINA_HOME%
 cd .\bin
 
 rem Java path relative to ASBNode
 set ASBNODE_DIR=%INSTALL_DIR:\Clients\MetaBrokersAndBridges\web\bin\=%
 set ASBNODE_DIR=%ASBNODE_DIR%\ASBNode
 set
 JVM_OPTIONS=-Dcatalina.base=%CATALINA_BASE%;-
 Dcatalina.home=%CATALINA_HOME%;-
 Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-
 Djava.io.tmpdir=%CATALINA_BASE%\temp;-
 Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-
 Djava.util.logging.config.file=%CATALINA_BASE%\conf
 \logging.properties
 
 set SERVICE_NAME=MBB
 set SERVICE_EXECUTABLE=%CATALINA_HOME%\bin\tomcat6.exe
 
 set OPTIONS=--DisplayName IBM InfoSphere Metadata Integration Bridges
 set OPTIONS=%OPTIONS% --Description IBM InfoSphere Metadata Integration
 Bridges
 set OPTIONS=%OPTIONS% --Install %SERVICE_EXECUTABLE%
 set OPTIONS=%OPTIONS% --LogPath %CATALINA_BASE%\logs
 set OPTIONS=%OPTIONS% --Classpath %CATALINA_HOME%\bin
 \bootstrap.jar;%CATALINA_HOME%\bin\tomcat-juli.jar
 set OPTIONS=%OPTIONS% --StartMode Java
 set OPTIONS=%OPTIONS% --StopMode Java
 set OPTIONS=%OPTIONS% --JavaHome %ASBNODE_DIR%\apps\jre
 set OPTIONS=%OPTIONS% --StartClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StartParams start
 set OPTIONS=%OPTIONS% --StopClass org.apache.catalina.startup.Bootstrap
 set OPTIONS=%OPTIONS% --StopParams stop
 set OPTIONS=%OPTIONS% --JvmOptions %JVM_OPTIONS%
 set OPTIONS=%OPTIONS% --StdOutput auto
 set OPTIONS=%OPTIONS% --StdError auto
 set OPTIONS=%OPTIONS% --JvmMs 128
 set OPTIONS=%OPTIONS% --JvmMx 1024
 set OPTIONS=%OPTIONS% --LogLevel Debug
 
 %SERVICE_EXECUTABLE% //IS//%SERVICE_NAME% %OPTIONS%
 if not errorlevel 1 goto end
 echo Failed installing '%SERVICE_NAME%' service
 goto end
 
 echo The service '%SERVICE_NAME%' has been installed.
 :end
 cd %INSTALL_DIR%
 
 
 ---
 
 Thanks
 Venkat
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-05-03 Thread Filip Hanik Mailing Lists
reading this on my phone, but does your Resource element have a name 
attribute? 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-05-03 Thread Filip Hanik Mailing Lists
found it, check the logs at startup for the error and post it here. 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-05-02 Thread Filip Hanik (mailing lists)
http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

 -Original Message-
 From: zuxiong lin [mailto:linzuxiong1...@gmail.com]
 Sent: Wednesday, May 02, 2012 2:35 AM
 To: Tomcat Users List
 Subject: Re: How to config the Tomcat 7.x JNDI datasource by using
 BoneCP ??
 
 See appending mail.
 
 On Wed, May 2, 2012 at 4:23 PM, Pid p...@pidster.com wrote:
 
  On 02/05/2012 02:12, zuxiong lin wrote:
   Hi, All.
   Any help ?
  
   Thanks?
  
 
  Perhaps you could read the following:
 
   http://www.catb.org/~esr/faqs/smart-questions.html
 
  and then rephrase your question?
 
 
  p
 
  --
 
  [key:62590808]
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Web Socket Issue

2012-05-02 Thread Filip Hanik (mailing lists)
Have the client send a ping message every 10 seconds

 -Original Message-
 From: umar farooq [mailto:umarfarooq...@gmail.com]
 Sent: Tuesday, May 01, 2012 6:06 PM
 To: users@tomcat.apache.org
 Subject: Web Socket Issue
 
 Hi All,
I am trying to use Chat example of WebSocket given in  Tomcat
 version
  7.0.27. Problem I faced are here.
 
 1) After opening the web socket it closes the socket automatically after
 20
 sec. I want connection open until Guest (i.e. user) explicitly closes
 it.
 2) Second thing is that It broad casts the message to all users but what
 i
 want is to send message to a specific group of people.
 Is there any method to send message to specific group.?? I checked API
 for
 WebSocket but there is no method for multicast.
 
 Kindly help me I have very short time to implement it.
 
 Thanks..
 --
 *Regards,
 *
 *Muhammad Umar Farooq*
 *Student **BIT* | SEECS, NUST *
 *


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Web Socket Issue

2012-05-02 Thread Filip Hanik (mailing lists)
While the API call to set timeout is missing (it is present in Tomcat's
Comet implementation) a forever setting would not do you any good
Your application has to learn how to deal with disconnects, as they are very
common over WAN.
I expect that a future version will have that call, but it wont completely
solve your problem

Best
Filip

 -Original Message-
 From: umar farooq [mailto:umarfarooq...@gmail.com]
 Sent: Wednesday, May 02, 2012 12:45 PM
 To: Tomcat Users List
 Subject: Re: Web Socket Issue
 
 But it is not requirement. I want to send ping once to open the socket
 after that it should depend on user when he wants to close the
 connection.
 Cannot I explicitly call some method to set timeout forever on client or
 server side. Or any other mechanism..??
 
 On Wed, May 2, 2012 at 10:04 AM, Filip Hanik (mailing lists) 
 devli...@hanik.com wrote:
 
  Have the client send a ping message every 10 seconds
 
   -Original Message-
   From: umar farooq [mailto:umarfarooq...@gmail.com]
   Sent: Tuesday, May 01, 2012 6:06 PM
   To: users@tomcat.apache.org
   Subject: Web Socket Issue
  
   Hi All,
  I am trying to use Chat example of WebSocket given in  Tomcat
   version
7.0.27. Problem I faced are here.
  
   1) After opening the web socket it closes the socket automatically
 after
   20
   sec. I want connection open until Guest (i.e. user) explicitly
 closes
   it.
   2) Second thing is that It broad casts the message to all users but
 what
   i
   want is to send message to a specific group of people.
   Is there any method to send message to specific group.?? I checked
 API
   for
   WebSocket but there is no method for multicast.
  
   Kindly help me I have very short time to implement it.
  
   Thanks..
   --
   *Regards,
   *
   *Muhammad Umar Farooq*
   *Student **BIT* | SEECS, NUST *
   *
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 --
 *Regards,
 *
 *Muhammad Umar Farooq*
 *Student **BIT* | SEECS, NUST *
 *


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 7 NIO Socket accept failed - Too many open files

2012-05-02 Thread Filip Hanik (mailing lists)
Ok, lsof -p pid (IIRC) should do the trick, it will tell all the handles open 
for that process, and you can deduce where the problem stems from

 -Original Message-
 From: David Wall [mailto:d.w...@computer.org]
 Sent: Wednesday, May 02, 2012 2:48 PM
 To: users@tomcat.apache.org
 Subject: Re: Tomcat 7 NIO Socket accept failed - Too many open files
 
 
 
 On 5/2/2012 12:34 PM, Pid * wrote:
  It's an OS issue: google 'ulimit'.
 
 
  p
 
 Yes, I am familiar with ulimit -Sn (it's 1024), but I suspect this could
 be a Tomcat issue somehow opening too many files and/or not releasing
 them.  I had never seen this issue before we upgraded from Tomcat 5.5
 (all using BIO) to Tomcat 7.0 (all using NIO).  We run on lots of
 servers, and none have shown this error before (and they are all Linux
 servers all set to 1024 for open files).  But we will give it a try by
 setting to a higher number.
 
 The reason we suspect it's Tomcat is that we're getting other
 exceptions, too, those that indicate our session/request objects are not
 valid when our JSPs are running (and of course work fine when the loads
 are normal, but start to fail when we push lots of concurrent requests
 at Tomcat).
 
 David
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-05-02 Thread Filip Hanik (mailing lists)
BoneCP doesn't have a JNDI factory AFAICT, and it's also missing a lot of
critical features, like validation etc

Filip 

 -Original Message-
 From: zuxiong lin [mailto:linzuxiong1...@gmail.com]
 Sent: Wednesday, May 02, 2012 7:36 PM
 To: Tomcat Users List
 Subject: Re: How to config the Tomcat 7.x JNDI datasource by using
 BoneCP ??
 
  Don't do that: remove mysql-connector-j-5.1.9.jar from WEB-INF/lib.
  Also remove the JAR for BoneCP.
 
 I donot have a try now. This morning I received your mail ,UTC+8.
 Before I sent my mail for help , I just put the jar in both Tomcat/lib
 dir
 and webapp/WEB-INF/lib.
 And I found I am very confused in Tomcat- Reasource *factory*= /
 ...
 It seems that facotry doesnot work well.
 
 I found com.jolbox.bonecp.BoneCPDataSource have properties
 : driverClassName in javax.naming.spi.ObjectFactory#getObjectInstance
 and driverClass .
 
 
 
 Thanks!
 
 
 On Thu, May 3, 2012 at 9:19 AM, Christopher Schultz 
 ch...@christopherschultz.net wrote:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Zuxiong,
 
  On 5/2/12 9:13 PM, zuxiong lin wrote:
   When I use BoneCP in per-web-app,  it is OK with  partitionCount .
   partitionCount  is a property of BoneCP.
 
  Okay, that's fine then.
 
   MySQL Connector/J  5.1.19,  I put it into both Tomcat's lib/
   directory and my webapp's WEB-INF/lib directory.
 
  Don't do that: remove mysql-connector-j-5.1.9.jar from WEB-INF/lib.
  Also remove the JAR for BoneCP.
 
   I can have a try. I think it doesnot work :
 
  Did you try it or not?
 
   you'll need to have the JAR files for MySQL Connector/J *and*
   BoneCP in Tomcat's lib/ directory and *not* in your webapp's
   WEB-INF/lib directory.
 
  I thought it was clear: Tomcat needs these libraries. Your webapp does
  not. If you put those .jar files into WEB-INF/lib, things will ber
  seriously confused.
 
  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
  Comment: GPGTools - http://gpgtools.org
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
  iEYEARECAAYFAk+h3Q8ACgkQ9CaO5/Lv0PBItwCZAQ46/6hFozDCuQuzD6CzAsFg
  CRAAoKLTCLFSoswkgvreSBUBYeShxM1R
  =k9mT
  -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: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??

2012-05-02 Thread Filip Hanik (mailing lists)
Aah, yes you are right. The specify 

Resource name=jdbc/DB factory=com.jolbox.bonecp.BoneCPDataSource
type=javax.sql.DataSource .../

Filip

 -Original Message-
 From: zuxiong lin [mailto:linzuxiong1...@gmail.com]
 Sent: Wednesday, May 02, 2012 8:40 PM
 To: Tomcat Users List
 Subject: Re: How to config the Tomcat 7.x JNDI datasource by using
 BoneCP ??
 
 com.jolbox.bonecp.BoneCPDataSource  implements DataSource,
 *ObjectFactory ,
 *
 *isnot it a JNDI factory ?
 *
 On Thu, May 3, 2012 at 10:30 AM, Filip Hanik (mailing lists) 
 devli...@hanik.com wrote:
 
  BoneCP doesn't have a JNDI factory AFAICT, and it's also missing a lot
 of
  critical features, like validation etc
 
  Filip
 
   -Original Message-
   From: zuxiong lin [mailto:linzuxiong1...@gmail.com]
   Sent: Wednesday, May 02, 2012 7:36 PM
   To: Tomcat Users List
   Subject: Re: How to config the Tomcat 7.x JNDI datasource by using
   BoneCP ??
  
Don't do that: remove mysql-connector-j-5.1.9.jar from WEB-
 INF/lib.
Also remove the JAR for BoneCP.
  
   I donot have a try now. This morning I received your mail ,UTC+8.
   Before I sent my mail for help , I just put the jar in both
 Tomcat/lib
   dir
   and webapp/WEB-INF/lib.
   And I found I am very confused in Tomcat- Reasource *factory*=
 /
   ...
   It seems that facotry doesnot work well.
  
   I found com.jolbox.bonecp.BoneCPDataSource have properties
   : driverClassName in
 javax.naming.spi.ObjectFactory#getObjectInstance
   and driverClass .
  
  
  
   Thanks!
  
  
   On Thu, May 3, 2012 at 9:19 AM, Christopher Schultz 
   ch...@christopherschultz.net wrote:
  
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
   
Zuxiong,
   
On 5/2/12 9:13 PM, zuxiong lin wrote:
 When I use BoneCP in per-web-app,  it is OK with  partitionCount
 .
 partitionCount  is a property of BoneCP.
   
Okay, that's fine then.
   
 MySQL Connector/J  5.1.19,  I put it into both Tomcat's lib/
 directory and my webapp's WEB-INF/lib directory.
   
Don't do that: remove mysql-connector-j-5.1.9.jar from WEB-
 INF/lib.
Also remove the JAR for BoneCP.
   
 I can have a try. I think it doesnot work :
   
Did you try it or not?
   
 you'll need to have the JAR files for MySQL Connector/J *and*
 BoneCP in Tomcat's lib/ directory and *not* in your webapp's
 WEB-INF/lib directory.
   
I thought it was clear: Tomcat needs these libraries. Your webapp
 does
not. If you put those .jar files into WEB-INF/lib, things will ber
seriously confused.
   
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
   
iEYEARECAAYFAk+h3Q8ACgkQ9CaO5/Lv0PBItwCZAQ46/6hFozDCuQuzD6CzAsFg
CRAAoKLTCLFSoswkgvreSBUBYeShxM1R
=k9mT
-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: Signing and Encrypting messages using Apache tribes

2012-05-01 Thread Filip Hanik (mailing lists)


 -Original Message-
 From: Madhav Bhargava [mailto:unmarsh...@gmail.com]
 Sent: Monday, April 30, 2012 4:16 PM
 To: users@tomcat.apache.org
 Subject: Signing and Encrypting messages using Apache tribes
 
 Hi All,
 
 We use apache tribes for inter node communication via multicast. For
 securing inter node communication two things are required:
 
 1. Establishing the identity of a node as valid who is sending the
 message
 2. Encrypting selective messages which are sensitive in nature.
 
 This topic was raised some time back (
 http://tomcat.10.n6.nabble.com/Securing-Tomcat-cluster-communication-
 td1973779.html
  )
 
 It is recommended that encryption/decryption of messages be done using a
 custom interceptor or using a stunnel, the former approach being the
 preferred approach. 
[Filip Hanik] 
Correct, using an interceptor you can do that. That is the easiest way. You can 
also use it for membership as membership messages carry a payload.

It has also being mentioned that the option
 SEND_OPTIONS_SECURE has not been implemented. This was in 2011, how its
 2012 - Has this been implemented now?
[Filip Hanik]
No.
 
 
 What do you suggest is the best way using tribes to sign messages - via
 another interceptor 
[Filip Hanik] 
Yes, use an interceptor


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tribes coordinator

2012-05-01 Thread Filip Hanik (mailing lists)
 -Original Message-
 From: Afkham Azeez [mailto:afk...@gmail.com]
 Sent: Tuesday, April 24, 2012 2:39 AM
 To: Tomcat Users List
 Subject: Re: Tribes coordinator
 
 Hi Filip,
 I have integrated the NonBlockingCoordinator  committed to the Axis2
 trunk. One thing I noticed is that even if the current coordinator is
 alive, and a new member joins, it is possible for the new member to be
 made
 the coordinator while the existing coordinator transforms into a normal
 member. Is this the intended behavior? Is it possible to change the
 coordinator only if the existing coordinator fails?
[Filip Hanik] 
It was a while ago I wrote that. Non blocking coordinator means that 
Change of coordination can be happen while other activities take place.

I think the NonBlocking coordinator builds on the absolute order algorithm
for selecting a coordinator.
The absolute order is a stateless ranking system in tribes that let's you
order members with no chat/messages exchanged.
So, the answer to your question would be no, cause if a member joins with a
higher rank, it becomes coordinator.

Now, what you could do is change the criteria for the absolute order stuff,
instead of ranking it based on IP (IIRC) then rank on how long a member has
been alive. This way, the member with the largest uptime will always be
coordinator. Of course, instead of using uptime, use starttime, so you don't
use a value that changes with every membership message

Best
Filip

 
 Thanks
 Azeez
 
 On Tue, Apr 24, 2012 at 11:26 AM, Afkham Azeez afk...@gmail.com wrote:
 
  Thanks for the pointers Filip. I will take a look.
 
 
  On Mon, Apr 23, 2012 at 9:12 PM, Filip Hanik Mailing Lists 
  devli...@hanik.com wrote:
 
 
  http://tomcat.apache.org/tomcat-7.0-
 doc/api/org/apache/catalina/tribes/group/interceptors/package-
 summary.html
 
  Take a look at SimpleCoordinator and NonBlockingCoordinator
 
  Equally simple to implement your own based on the requirement you
 have
  for leader election.
 
  It does depend on what you need leader ship for, sometimes, like
 virtual
  synchrony, leaders are used to determine atomic delivery of a message
 to an
  entire group. Either the entire group gets it, or doesn't.
 
  Filip
 
  - Original Message -
   From: Afkham Azeez afk...@gmail.com
   To: Tomcat Users List users@tomcat.apache.org
   Sent: Monday, April 23, 2012 6:38:31 AM
   Subject: Tribes coordinator
  
   We are using Tribes in Axis2. In a cluster, we want to have leader
   election, and one member to be designated as the coordinator. How
 can
   this
   be achieved using Tribes?
  
   Thanks
   Azeez
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tribes coordinator

2012-04-23 Thread Filip Hanik Mailing Lists
http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/tribes/group/interceptors/package-summary.html

Take a look at SimpleCoordinator and NonBlockingCoordinator

Equally simple to implement your own based on the requirement you have for 
leader election.

It does depend on what you need leader ship for, sometimes, like virtual 
synchrony, leaders are used to determine atomic delivery of a message to an 
entire group. Either the entire group gets it, or doesn't.

Filip

- Original Message -
 From: Afkham Azeez afk...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, April 23, 2012 6:38:31 AM
 Subject: Tribes coordinator
 
 We are using Tribes in Axis2. In a cluster, we want to have leader
 election, and one member to be designated as the coordinator. How can
 this
 be achieved using Tribes?
 
 Thanks
 Azeez
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: dbcp datasource encryption

2012-04-23 Thread Filip Hanik Mailing Lists


- Original Message -

 
 http://wiki.apache.org/tomcat/FAQ/Password
 
 
 In short, no.
 
 Encrypting your database, database user, and database password buys
 you virtually (and most people would say actually) nothing.

virtually nothing is the opposite of what I would call it. What about 
compliance, this is HUGE for companies, and not to be discarded as an 
unimportant requirement

http://tomcat.markmail.org/thread/wmdu4e52y2msjzal

If you wish to implement password obfuscator/deobfuscator yourself, you can set 
the 
org.apache.tomcat.util.digester.PROPERTY_SOURCE system property to a class that 
deobfuscates your password for you

reference: http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Bug in Tomcat AJP Connector?

2012-04-05 Thread Filip Hanik (mailing lists)
 -Original Message-
 From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
 Sent: Thursday, April 05, 2012 10:18 AM
 To: Tomcat Users List
 Subject: Re: Bug in Tomcat AJP Connector?
 
 2012/4/5 Christopher Schultz ch...@christopherschultz.net:
 
  On 4/5/12 11:57 AM, Konstantin Kolinko wrote:
  1. Tomcat does not start JVM  thus it cannot restart it.
 
  You need some external tool or script or admin to perform
  monitoring and (re)starts.
 
  Asking Tomcat to restart itself after OOME would be like expecting you
  to defibrillate yourself. It works in theory, but not in practice.
 
 
 Yes.  It reminds me of that Bond movie
[Filip Hanik] 
I would not discard this as a joke, software is headed that way, there are
solutions for this today, and more of them will come tomorrow.
Self healing - it's gonna be fairly important in the new paradigm

 
 http://www.youtube.com/watch?v=Jhm5up5NQwk
 
 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: jdbc pool properties

2012-04-04 Thread Filip Hanik Mailing Lists
 There are some databases that do go in and periodically kill off
 connections, aside from the Tomcat settings.

you may want to explore the maxAge option for this, as we can disconnect and 
create new connections before the DB does kills it as long lived

- Original Message -
 From: Barry L Propes barry.l.pro...@citi.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 7:53:26 AM
 Subject: RE: jdbc pool properties
 
 There are some databases that do go in and periodically kill off
 connections, aside from the Tomcat settings.
 
 In addition to testOnBorrow=true, I also had two other attributes,
 but not sure if Tomcat 7.0 uses them or not, as I'm on 6.0.29.
 
 testOnBorrow=true
 timeBetweenEvictionRunsMillis=-1
 minEvictableIdleTimeMillis=28800
 
 
 
 -Original Message-
 From: Daniel Mikusa [mailto:dmik...@vmware.com]
 Sent: Wednesday, April 04, 2012 7:46 AM
 To: Tomcat Users List
 Subject: Re: jdbc pool properties
 
 
 
 - Original Message -
  My db connections seem to be lost after an extended period of
  inactivity
 
 There could be a number of reasons that this occurs.  Perhaps a
 network issue is causing them to be disconnected or the database may
 be timing them out.  At any rate, it's not likely that the problem
 would be caused by the removeAbandoned / abandonedTimeout
 settings, unless you application is not properly returning
 connections to the connection pool.
 
   
 https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Preventing_database_connection_pool_leaks
 
 
  (for a web application).  And the only way to get the connections
  to
  work again is to restart tomcat.
 
  My tomcat.jdbc.pool.Datasource settings have:
 
   property name=maxActive value=100/
  property name=maxIdle value=30/
  property name=maxWait value=1000/
  property name=defaultAutoCommit value=true/
  property name=removeAbandoned value=true/
  property name=removeAbandonedTimeout value=60/
 
 
 You probably want to add testOnBorrow=true and
 validationQuery=SELECT 1  (or some other valid query for your DB).
  See the following link for an explanation of those properties.
 
   https://commons.apache.org/dbcp/configuration.html
 
 This will cause your connections to be validated prior to their use
 by your application.  Stale connections will be removed and replaced
 with new, working connections.
 
 
  Is it the removedAbonded and abandonedTimeout?  Does it mean after
  60
  seconds, remove the connection from the pool?
 
 No.  See either of the links I've referenced above for an explanation
 of these settings.
 
 
  I guess what I need is a minActive setting then?
 
 
 There's no minActive setting.  You have minIdle, but I don't
 think that would help here.
 
 Dan
 
 
 
 
 
 -
 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: [JDBC Pool] PoolCleaner creates some sort of memory

2012-04-04 Thread Filip Hanik Mailing Lists
I'll take a look at the test failures, but yes you can ignore them. Tomcat 
7.0.27 will have the fix included, about to be released shortly
building it is easy, builds with both maven and ant

Filip

- Original Message -
 From: Michael Osipov michael.osi...@siemens.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, March 30, 2012 2:05:50 AM
 Subject: RE: [JDBC Pool] PoolCleaner creates some sort of memory
 
 Konstantin Kolinko wrote:
  2012/3/30 Osipov, Michael michael.osi...@siemens.com:
  Filip Hanik (mailing lists) wrote:
  http://svn.apache.org/viewvc?view=revisionrevision=1306946
  
  Thanks for the patch, I am having trouble to build from source. I
  do
  have some test failures, should I ignore them and go on?
  
  Please be more specific. In what tests?
 
 Have a look at this: http://pastebin.com/kiHLF6D9
 -
 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: Tomcat6 thread pool questions

2012-04-04 Thread Filip Hanik Mailing Lists
In Tomcat 6, the default thread pool ignores minSpareThreads, but if you use 
Executor name=threadpool... and then Connector executor=threadpool
it will respect that value and you will see the expected the results

Filip


- Original Message -
 From: llow...@oreillyauto.com
 To: users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 7:50:24 AM
 Subject: Tomcat6 thread pool questions


 Greetings,

 I was wondering if someone could help me understand how the
 threadpools are
 handled in tomcat6. I know that a lot of the functionality was moved
 to
 executors.

 I set one up and using psi-Probe I could see that it was indeed
 killing off
 threads as I expected. However, the minSpareThreads did not seem to
 be used
 at all.

 Is my understanding of that attribute correct, in that
 minSparethreads
 should be the minimum number of threads running at any point?

 For example, if I have minSpareThreads set to 30, I should see 30
 threads
 when the server is idle, and between 30 and maxThreads when it is
 under a
 load, right?

 That is not what I am seeing, as most of the time there are only 2-3
 threads with one busy thread while the server is idle or near idle.

 If anyone could let me know either what I am missing or what it is I
 do not
 understand correctly, I would appreciate it.

 Thank you.

 Lee Lowder

 This communication and any attachments are confidential, protected by
 Communications Privacy Act 18 USCS � 2510, solely for the use of the
 intended recipient, and may contain legally privileged material. If
 you are not the intended recipient, please return or destroy it
 immediately. Thank you.

 -
 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: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks

2012-04-04 Thread Filip Hanik Mailing Lists
just set minIdle=0 and enable the eviction process to take care of it.

Filip


- Original Message -
 From: Hermes Flying flyingher...@yahoo.com
 To: Daniel Mikusa dmik...@vmware.com
 Cc: users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 9:53:30 AM
 Subject: Re: Discrepancy between Tomcat's connection pool and tomcat's report 
 on memory leaks

 Which is indicating that the application deployed to
 /GeneralApplication is creating a thread named H2 Log Writer
 GENERICAPPLICATION and never stopping it.  I do not believe
 that this would be associated with the pool created by Tomcat as
 that would be created as a global resource available to all
 applications and not specific to /GeneralApplication.
 I can't really say a whole lot more about what is going on, just
 that this strikes me as odd.  If it were my app, I'd dig into this
 more and see what is creating that thread.  Possibly with a
 profiler or thread dumps.

 What is happening here (as I undestand it is the following):
 1) My application uses Tomcat's connection pool from the data source
 2) My application uses H2 as a file database. H2 starts back end(s)
 thread which is about logging (H2 logging) and possibly other tasks
  and that is the thread that catalina complaints about
 3) H2 remains open as long as there are open connections and is
 closed when the last connection is released
 4) My application uses Tomcat's connection pool and as a result
 Tomcat decides when the data source should be disposed or when
 connections are released (not my code).
 5) I shutdown Tomcat.
 6) The connection pool of Tomcat has still connections (e.g. idle)
 and so H2 does not shutdown. Hence it's lock file and related
 background threads are still running.
 7) Tomcat shuts down my application but does not dispose off the
 connection pool (yet). I believe this happens because of the way
 Tomcat is being shut down (as sequence of actions I mean).
 8) Since the connection pool has not been disposed, there are still
 connections and as a result H2 is still running
 9) Tomcat's memory leak detection mechanism detects H2 threads
 started from GenericApplication which uses H2 and gives the report
 in catalina.out. So Tomcat gives the report first and then proceeds
 with the shutdown (and this perhaps is not correct? I can't say)
 10) Tomcat eventually shuts down.
  
 Is this scenario as I describe it, wrong?
 Should I somehow have configured the datasource to be associated
 with my web application instead of a generic data source? Why?
 Should I have shut the data source myself? How?
 If all what I describe is reasonable this seems to me like a racing
 condition. How should I mediate this?

 Thank you for your time.
  

 
  From: Daniel Mikusa dmik...@vmware.com
 To: Hermes Flying flyingher...@yahoo.com
 Sent: Wednesday, April 4, 2012 5:14 PM
 Subject: Re: Discrepancy between Tomcat's connection pool and
 tomcat's report on memory leaks

 - Original Message -
 
 
  What I do is get the dataSource inside a ServletContextListener and
  save it in servlet context (as part of a DAO Factory):
 
  public void contextInitialized(ServletContextEvent sce) {
 
  ServletContext context = sce.getServletContext();
  DataSource dataSource = null;
  try {
  dataSource = (DataSource) new
  InitialContext().lookup(java:/comp/env/jdbc/GenericDataSource);
  context.setAttribute(daogenericfactory,
  DAOGenericFactory.getInstance(dataSource));
 
  } catch (NamingException e) {
  e.printStackTrace();
  }
 
  }
 
 
  The DAOGenericFactory just returns specific DAO objects passing in
  their constructor the data source.
  Each DAO instance has an member variable of DataSource and for
  action
  to the database I do in order to get a connection:
 
  public Connection getConnection() throws Exception{
  return dataSource.getConnection();
  }
 
 
  So I use the Connection this way and I always close the connections
  in order to be returned back to the pool.
  The only thing perhaps to mention is that I create new DAO objects
  passing this data source (I don't reuse instances of DAO).
  So I don't have a pool of my own. I just use DAO pattern .
  This is happening in my web application GeneralApplication
  Is this information adequate/clear?

 Definitely clear.  It just doesn't seem to match up with the output
 from the log files.  You're seeing

     SEVERE: The web application [/GeneralApplication] appears to have
     started a thread named [H2 Log Writer GENERICAPPLICATION] but has
     failed to stop it. This is very likely to create a memory leak.

 Which is indicating that the application deployed to
 /GeneralApplication is creating a thread named H2 Log Writer
 GENERICAPPLICATION and never stopping it.  I do not believe that
 this would be associated with the pool created by Tomcat as that
 would be created as a global resource available to all applications
 and not specific to /GeneralApplication.

 I can't really say a whole lot 

Re: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks

2012-04-04 Thread Filip Hanik Mailing Lists
no, that would happen if you set maxIdle=0, not minIdle

- Original Message -
 From: Hermes Flying flyingher...@yahoo.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 10:45:24 AM
 Subject: Re: Discrepancy between Tomcat's connection pool and tomcat's report 
 on memory leaks

 But if I set 'minIdle=0' all the connections would close imediatelly,
 right?
 So why would I need a connection pool in the first place if I do
 this?


 
  From: Filip Hanik Mailing Lists devli...@hanik.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 7:28 PM
 Subject: Re: Discrepancy between Tomcat's connection pool and
 tomcat's report on memory leaks

 just set minIdle=0 and enable the eviction process to take care of
 it.

 Filip


 - Original Message -
  From: Hermes Flying flyingher...@yahoo.com
  To: Daniel Mikusa dmik...@vmware.com
  Cc: users@tomcat.apache.org
  Sent: Wednesday, April 4, 2012 9:53:30 AM
  Subject: Re: Discrepancy between Tomcat's connection pool and
  tomcat's report on memory leaks
 
  Which is indicating that the application deployed to
  /GeneralApplication is creating a thread named H2 Log Writer
  GENERICAPPLICATION and never stopping it.  I do not believe
  that this would be associated with the pool created by Tomcat as
  that would be created as a global resource available to all
  applications and not specific to /GeneralApplication.
  I can't really say a whole lot more about what is going on, just
  that this strikes me as odd.  If it were my app, I'd dig into
  this
  more and see what is creating that thread.  Possibly with a
  profiler or thread dumps.
 
  What is happening here (as I undestand it is the following):
  1) My application uses Tomcat's connection pool from the data
  source
  2) My application uses H2 as a file database. H2 starts back end(s)
  thread which is about logging (H2 logging) and possibly other tasks
   and that is the thread that catalina complaints about
  3) H2 remains open as long as there are open connections and is
  closed when the last connection is released
  4) My application uses Tomcat's connection pool and as a result
  Tomcat decides when the data source should be disposed or when
  connections are released (not my code).
  5) I shutdown Tomcat.
  6) The connection pool of Tomcat has still connections (e.g. idle)
  and so H2 does not shutdown. Hence it's lock file and related
  background threads are still running.
  7) Tomcat shuts down my application but does not dispose off the
  connection pool (yet). I believe this happens because of the way
  Tomcat is being shut down (as sequence of actions I mean).
  8) Since the connection pool has not been disposed, there are still
  connections and as a result H2 is still running
  9) Tomcat's memory leak detection mechanism detects H2 threads
  started from GenericApplication which uses H2 and gives the report
  in catalina.out. So Tomcat gives the report first and then proceeds
  with the shutdown (and this perhaps is not correct? I can't say)
  10) Tomcat eventually shuts down.
   
  Is this scenario as I describe it, wrong?
  Should I somehow have configured the datasource to be associated
  with my web application instead of a generic data source? Why?
  Should I have shut the data source myself? How?
  If all what I describe is reasonable this seems to me like a
  racing
  condition. How should I mediate this?
 
  Thank you for your time.
   
 
  
   From: Daniel Mikusa dmik...@vmware.com
  To: Hermes Flying flyingher...@yahoo.com
  Sent: Wednesday, April 4, 2012 5:14 PM
  Subject: Re: Discrepancy between Tomcat's connection pool and
  tomcat's report on memory leaks
 
  - Original Message -
  
  
   What I do is get the dataSource inside a ServletContextListener
   and
   save it in servlet context (as part of a DAO Factory):
  
   public void contextInitialized(ServletContextEvent sce) {
  
   ServletContext context = sce.getServletContext();
   DataSource dataSource = null;
   try {
   dataSource = (DataSource) new
   InitialContext().lookup(java:/comp/env/jdbc/GenericDataSource);
   context.setAttribute(daogenericfactory,
   DAOGenericFactory.getInstance(dataSource));
  
   } catch (NamingException e) {
   e.printStackTrace();
   }
  
   }
  
  
   The DAOGenericFactory just returns specific DAO objects passing
   in
   their constructor the data source.
   Each DAO instance has an member variable of DataSource and for
   action
   to the database I do in order to get a connection:
  
   public Connection getConnection() throws Exception{
   return dataSource.getConnection();
   }
  
  
   So I use the Connection this way and I always close the
   connections
   in order to be returned back to the pool.
   The only thing perhaps to mention is that I create new DAO
   objects
   passing this data source (I don't reuse instances of DAO).
   So I

Re: Discrepancy between Tomcat's connection pool and tomcat's report on memory leaks

2012-04-04 Thread Filip Hanik Mailing Lists
The real fix to your problem should have been

Resource type=javax.sql.DataSource closeMethod=close .../ (available in 
Tomcat 7)

If I understand the problem you're having is two fold
1. you see reports about memory leaks
started a thread named [H2 File Lock Watchdog you should be able to fix this 
by setting initialSize0 so that the thread is started using the main class 
loader when tomcat starts, not when an app starts using the pool.
(Tomcat 7's jdbc-pool does this automatically from 7.0.27 onwards, regardless 
of configuration)

2. The connection pool is not closed properly, again, this is addressed in the 
top of this email.

letting the pool eventually shrink to 0, is merely a work around, but I realize 
it will NOT work. H2 is starting it's own thread, there is no way around this, 
unless there is way to shut down this thread. Maybe this shuts down if all 
connections are closed.

Filip

- Original Message -
 From: Hermes Flying flyingher...@yahoo.com
 To: Filip Hanik Mailing Lists devli...@hanik.com, Tomcat Users List 
 users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 10:56:10 AM
 Subject: Re: Discrepancy between Tomcat's connection pool and tomcat's report 
 on memory leaks
 
 
 
 Ok. So how is the configuration parameter fixing my problem? Would
 you please explain this to me to undestand how this works?
 
 
 
 
 
 From: Filip Hanik Mailing Lists devli...@hanik.com
 To: Tomcat Users List users@tomcat.apache.org; Hermes Flying
 flyingher...@yahoo.com
 Sent: Wednesday, April 4, 2012 7:50 PM
 Subject: Re: Discrepancy between Tomcat's connection pool and
 tomcat's report on memory leaks
 
 no, that would happen if you set maxIdle=0, not minIdle
 
 - Original Message -
  From: Hermes Flying  flyingher...@yahoo.com 
  To: Tomcat Users List  users@tomcat.apache.org 
  Sent: Wednesday, April 4, 2012 10:45:24 AM
  Subject: Re: Discrepancy between Tomcat's connection pool and
  tomcat's report on memory leaks
  
  But if I set 'minIdle=0' all the connections would close
  imediatelly,
  right?
  So why would I need a connection pool in the first place if I do
  this?
  
  
  
  From: Filip Hanik Mailing Lists  devli...@hanik.com 
  To: Tomcat Users List  users@tomcat.apache.org 
  Sent: Wednesday, April 4, 2012 7:28 PM
  Subject: Re: Discrepancy between Tomcat's connection pool and
  tomcat's report on memory leaks
  
  just set minIdle=0 and enable the eviction process to take care of
  it.
  
  Filip
  
  
  - Original Message -
   From: Hermes Flying  flyingher...@yahoo.com 
   To: Daniel Mikusa  dmik...@vmware.com 
   Cc: users@tomcat.apache.org
   Sent: Wednesday, April 4, 2012 9:53:30 AM
   Subject: Re: Discrepancy between Tomcat's connection pool and
   tomcat's report on memory leaks
   
   Which is indicating that the application deployed to
   /GeneralApplication is creating a thread named H2 Log Writer
   GENERICAPPLICATION and never stopping it. I do not believe
   that this would be associated with the pool created by Tomcat
   as
   that would be created as a global resource available to all
   applications and not specific to /GeneralApplication.
   I can't really say a whole lot more about what is going on,
   just
   that this strikes me as odd. If it were my app, I'd dig into
   this
   more and see what is creating that thread. Possibly with a
   profiler or thread dumps.
   
   What is happening here (as I undestand it is the following):
   1) My application uses Tomcat's connection pool from the data
   source
   2) My application uses H2 as a file database. H2 starts back
   end(s)
   thread which is about logging (H2 logging) and possibly other
   tasks
   and that is the thread that catalina complaints about
   3) H2 remains open as long as there are open connections and is
   closed when the last connection is released
   4) My application uses Tomcat's connection pool and as a result
   Tomcat decides when the data source should be disposed or when
   connections are released (not my code).
   5) I shutdown Tomcat.
   6) The connection pool of Tomcat has still connections (e.g.
   idle)
   and so H2 does not shutdown. Hence it's lock file and related
   background threads are still running.
   7) Tomcat shuts down my application but does not dispose off the
   connection pool (yet). I believe this happens because of the way
   Tomcat is being shut down (as sequence of actions I mean).
   8) Since the connection pool has not been disposed, there are
   still
   connections and as a result H2 is still running
   9) Tomcat's memory leak detection mechanism detects H2 threads
   started from GenericApplication which uses H2 and gives the
   report
   in catalina.out. So Tomcat gives the report first and then
   proceeds
   with the shutdown (and this perhaps is not correct? I can't say)
   10) Tomcat eventually shuts down.
   
   Is this scenario as I describe it, wrong?
   Should I somehow have configured

RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-29 Thread Filip Hanik (mailing lists)
http://svn.apache.org/viewvc?view=revisionrevision=1306946



 -Original Message-
 From: Osipov, Michael [mailto:michael.osi...@siemens.com]
 Sent: Thursday, March 29, 2012 1:36 AM
 To: Tomcat Users List
 Subject: RE: [JDBC Pool] PoolCleaner creates some sort of memory
 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Filip Hanik (mailing lists)
PoolCleaner is a static singleton. The pool cleaner thread will not be removed 
until all JDBC pools have been stopped.
So, yes, one application can be the one that starts the thread, but not 
necessarily the one that stops it

Filip

 -Original Message-
 From: Osipov, Michael [mailto:michael.osi...@siemens.com]
 Sent: Wednesday, March 28, 2012 8:29 AM
 To: users@tomcat.apache.org
 Subject: [JDBC Pool] PoolCleaner creates some sort of memory
 
 Hi folks,
 
 Recently this started to pop up in my logs:
 23.03.2012 14:12:28 org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SCHWERWIEGEND: The web application [/ket] appears to have started a
 thread named [PoolCleaner[18291494:1332172047553]] but has failed to stop
 it. This is very likely to create a memory leak.
 
 There is some similar thread [1] which had no real result.
 
 I am on Tomcat 6.0.35, all DataSources are created in the context.xml file. 
 All
 DataSources are cleaned up (closed) with a context.xml Listener. The JDBC
 Pool is version 7.0.26.
 
 As far as my debug sessions have revealed (with attached VisualVM), it does
 not matter how many apps you deploy the PoolCleanTimer thread is created
 only once and retained until all apps have been stopped or removed. This
 makes Tomcat think that this is a memory leak.
 
 Is there a way to associate this thread with another class loader in order to
 avoid this problem or create multiple threads or simple ignore this warning
 which is not a solution for those who face that issue too?
 
 Besides that, the numbers in the thread name are not very informative, the
 classloader hashcode and timestamp did not really help to to identify
 anything. Can this be improved?
 
 [1] http://www.mail-archive.com/users@tomcat.apache.org/msg87350.html
 
 With best regards,
 Michael Osipov
 -
 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 dbcp encryption

2012-03-28 Thread Filip Hanik (mailing lists)
Or pay a vendor to do it for you :)
http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.tc-server.2.6/admin/manual-encrypt-passwords.html



 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Sent: Wednesday, March 28, 2012 10:25 AM
 To: Tomcat Users List
 Subject: Re: tomcat dbcp encryption
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Ognjen,
 
 On 3/27/12 6:32 AM, Ognjen Blagojevic wrote:
  이재만,
 
  On 27.3.2012 9:54, 이재만 wrote:
  how do i encrypt my datasource's user and password  in server.xml
  ??
 
  Read this: http://wiki.apache.org/tomcat/FAQ/Password
 
 No, he didn't like that answer last time, so he asked again :(
 
 The answer, of course, is to use ZIP encryption or PGP/GPG. Good luck
 starting Tomcat after that, though.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk9zO2UACgkQ9CaO5/Lv0PDj0gCfY3mSJV/VYzhjk226RPeo617
 Q
 aGEAn2zXTsQayySY6txyRC16m9UOS2Id
 =+Tna
 -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: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Filip Hanik (mailing lists)
: SHA1
 
 Filip,
 
 On 3/28/12 12:00 PM, Filip Hanik (mailing lists) wrote:
  PoolCleaner is a static singleton. The pool cleaner thread will not
  be removed until all JDBC pools have been stopped. So, yes, one
  application can be the one that starts the thread, but not
  necessarily the one that stops it
 
 Is there any reason not to associate the thread with the
 WebappClassLoader's parent? Otherwise, this will pin the first webapp
 to use tomcat-pool in memory until all webapps have been undeployed,
 right?
[Filip Hanik] 

Correct, I can add in a fix for this to force the context classloader to be the 
same as the pool while it is starting the thread

 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk9zPQkACgkQ9CaO5/Lv0PD7wwCeOR3bVeJOk6fyWsTtzE3Fp
 bzm
 Bk8AnjrsNqyp3zsHexJhIuLumEgZ1fsj
 =pI1I
 -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: Accessing static resource during loading of webapp

2012-03-28 Thread Filip Hanik (mailing lists)
Are you trying to read a file in the same webapp or another?

 -Original Message-
 From: Farrukh Najmi [mailto:farr...@wellfleetsoftware.com]
 Sent: Wednesday, March 28, 2012 4:34 PM
 To: users@tomcat.apache.org
 Subject: Accessing static resource during loading of webapp
 
 
 I have a webapp that accesses some static resources during startup of
 the webapp. On Glassfish 3.1.2 this works fine. However on Tomcat 7.0.26
 the webapp ciode gets a read timeout when it tries to do an HTTP GET
 using a URLConnection to a static resource deployed in the same tomcat
 instance. Is there a way to fix this?
 
 --
 Regards,
 Farrukh Najmi
 
 Web: http://www.wellfleetsoftware.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: Operation has timed out(3000 ms.).;

2012-03-22 Thread Filip Hanik Mailing Lists
take a look at the Sender timeout=... .../ attribute

http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-sender.html



- Original Message -
 From: Dhaval Jaiswal dhaval.jais...@via.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, March 21, 2012 10:35:14 PM
 Subject: Operation has timed out(3000 ms.).;
 
 Receiving below errors in catalina log. I have changed the backup
 manager
 value of dropTime=3000 to 1 with restart of tomcats. However,
 still
 it is not taking effect  notifying that Operation has timed out(3000
 ms.)
 Please guide me where should i look to stop this messages.
 
 
 SEVERE: Unable to send message through cluster sender.
 org.apache.catalina.tribes.ChannelException: Operation has timed
 out(3000
 ms.).; Faulty members:tcp://{-64, -88, 3, 6}:4000;
 at
 org.apache.catalina.tribes.transport.nio.ParallelNioSender.sendMessage(ParallelNioSender.java:97)
 at
 org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessage(PooledParallelSender.java:53)
 at
 org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(ReplicationTransmitter.java:80)
 at
 org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelCoordinator.java:78)
 at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75)
 at
 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.sendMessage(TcpFailureDetector.java:87)
 
 
 
 
 --
 *
   Dhaval Jaiswal
 Database  System
  E: dhaval.jais...@via.com
 T: +91-80-4043 3000
 M: +91-8095397843
  www.via.com
  http://www.admin.viaworld.in/callcenter?action1=ADD_EPR_LOG
 
 
  *
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-22 Thread Filip Hanik Mailing Lists
 Ultimately tho I'd still like to see some debug logging from the pool
 itself.  Is there a simple way to turn it on?

not to the problem you are looking at. if a connection got taken out of the 
pool, and it passed validation, then everything is ok.
at this point the SQLException you get has all the data, and the problem is 
probably at the network level

the fact that you see that for 2 hours and problem goes away with restart, that 
can only be the app holding on to the flawed connection, cause there would have 
been several validations during the 2 hour period :) I think there is a loop 
somewhere that when it fails it just retries and retries, logAbandoned will 
show that though.

Filip




- Original Message -
 From: Colin Ingarfield colin...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, March 22, 2012 8:06:14 AM
 Subject: Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)
 
 Ah, Wireshark.  My friend calls it the universal debugger. :)
 
 I will set the validation interval to 1 and keep an eye on the
 network to
 see what's going on.  I may also install MySql locally so I can kill
 it
 easily to try and simulation connection timeouts.  I won't really
 feel this
 is resolved until I can recreate the original issue.
 

 
 Thanks,
 Colin
 
 On Wed, Mar 21, 2012 at 11:20 AM, Filip Hanik Mailing Lists 
 devli...@hanik.com wrote:
 
  it will take a while to see the abandoned log. I'm not implying
  every
  request hogs the connection, but that you could have ended up in a
  scenario
  where that did happen.
  otherwise, you would have not seen the problem for 2 hours and to
  go away
  when the system was restarted, as it should have failed on
  validation.
 
  You can enable validation every single time by doing
 
  validationInterval=1
 
  after that, if it was me, I'd start pulling in something like
  Wireshark to
  see what is going on
 
  Filip
 
  - Original Message -
   From: Colin Ingarfield colin...@gmail.com
   To: Tomcat Users List users@tomcat.apache.org
   Sent: Wednesday, March 21, 2012 10:11:43 AM
   Subject: Re: how to enable debug logging for Tomcat jdbc pool
   (Tomcat
  6.0.32)
  
   I added the 3 abandoned settings but I don't see any indication
   in
   the
   tomcat log that connections are being abandoned.  I also made the
   max
   pool
   size pretty small.. my application would have failed quickly if
   all
   the
   connections we're being incorrectly held up.
  
   Anything else I can try?  Thanks again for your  help.
  
   -- Colin
  
   On Wed, Mar 21, 2012 at 10:41 AM, Filip Hanik Mailing Lists 
   devli...@hanik.com wrote:
  
Got it, thank you.
The other way this can happen is if the application checks out
a
connection and then never returns it, and expects it to be
used.
For this you will want to enable
   
removeAbandonedTimeout=60
removeAbandoned=true
logAbandoned=true
   
this should tell you pretty quickly if you got a component that
is
hogging
the connection. So test that first. Now if that is the case,
there
is a way
to fix that:
   
1. remove the above settings
2. compile and configure the interceptor described in:
  https://issues.apache.org/bugzilla/show_bug.cgi?id=52024
In this interceptor, when a failure occurs, it automatically
reconnects
and retries the operation. And that is the only way to get
around
the
problem (assuming my assumption is correct)
   
   
Filip
- Original Message -
 From: Colin Ingarfield colin...@gmail.com
 To: users@tomcat.apache.org
 Sent: Wednesday, March 21, 2012 9:30:46 AM
 Subject: Re: how to enable debug logging for Tomcat jdbc pool
 (Tomcat
6.0.32)

 My configuration:

Resource auth=Container
 name=jdbc/cdb.mysql
 defaultAutoCommit=false
 driverClassName=com.mysql.jdbc.Driver
 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
 url=jdbc:mysql://X.com/_dev?sessionVariables=TRANSACTION
 ISOLATION LEVEL READ COMMITTED
 username=X
 password=X

 maxActive=100
 maxIdle=100
 minIdle=10
 initialSize=10
 maxWait=1
 testOnBorrow=true
 type=javax.sql.DataSource
 validationQuery=SELECT 1/


 I have testOnBorrow and validationQuery set as you suggest,
 so I
 do
 not
 think that is the issue.

 Thanks,
 Colin

   
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
   
   
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org

Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-22 Thread Filip Hanik Mailing Lists
Pretty much you're guaranteed to have a network problem at that point. You see 
Java caches DNS translations forever, and yanking VPN like that may change 
around IPs but the JVM is not aware of that. Wireshark would tell you that. Now 
relying in VPN is never a good thing, but maybe it's required. You could try
1. Use IP instead of host name in your jdbc URL
2. Configure the JRE to not cache dns lookups, (network.properties)


The error you see tells you that:
1. The pool doesn't have any idle established connections idle=0
2. The pool doesn't have any connections used by other threads busy=0
3. There is currently 1 thread trying to activate a connection size=1. The size 
is an atomic counter to protect against overuse in a lock free way. 


Filip



Hi Filip,

Today I have been trying to recreate the issue by disconnecting from the
vpn, as:
1.  Start app.  Pool creates some connections via the vpn.
2.  Test app a bit to execute sql queries.
3.  Shut down the vpn
4.  Force some more queries.  Predictably, connections fail and exceptions
show up in the logs.
5.  Restore vpn connection
6.  Check if pool creates new connections, which it does not.

I also upgraded to the latest pool available in maven
central: tomcat-jdbc-7.0.26.jar

I understand this could still be a connection leak in my application.  But
the new pool version logs an error I don't understand:
... stack trace ...
Caused by: java.sql.SQLException: [scheduler-low-1] Timeout: Pool empty.
Unable to fetch a connection in 10 seconds, none available[size:1; busy:0;
idle:0; lastwait:1].
... more trace ...

The relevant part of my current pool DataSource configuration:
removeAbandonedTimeout=10
removeAbandoned=true
logAbandoned=true

defaultAutoCommit=false
maxActive=1 maxIdle=1 minIdle=1 maxWait=1
testOnBorrow=true
validationQuery=SELECT 1

I also have yet to see any abandoned log messages.

Should the pool always have at least 1 busy or idle connection?  If not
would it create another?

Thanks,
Colin




On Thu, Mar 22, 2012 at 11:11 AM, Filip Hanik Mailing Lists 
devli...@hanik.com wrote:

  Ultimately tho I'd still like to see some debug logging from the pool
  itself.  Is there a simple way to turn it on?

 not to the problem you are looking at. if a connection got taken out of
 the pool, and it passed validation, then everything is ok.
 at this point the SQLException you get has all the data, and the problem
 is probably at the network level

 the fact that you see that for 2 hours and problem goes away with restart,
 that can only be the app holding on to the flawed connection, cause there
 would have been several validations during the 2 hour period :) I think
 there is a loop somewhere that when it fails it just retries and retries,
 logAbandoned will show that though.

 Filip




 - Original Message -
  From: Colin Ingarfield colin...@gmail.com
  To: Tomcat Users List users@tomcat.apache.org
  Sent: Thursday, March 22, 2012 8:06:14 AM
  Subject: Re: how to enable debug logging for Tomcat jdbc pool (Tomcat
 6.0.32)
 
  Ah, Wireshark.  My friend calls it the universal debugger. :)
 
  I will set the validation interval to 1 and keep an eye on the
  network to
  see what's going on.  I may also install MySql locally so I can kill
  it
  easily to try and simulation connection timeouts.  I won't really
  feel this
  is resolved until I can recreate the original issue.
 

 
  Thanks,
  Colin
 
  On Wed, Mar 21, 2012 at 11:20 AM, Filip Hanik Mailing Lists 
  devli...@hanik.com wrote:
 
   it will take a while to see the abandoned log. I'm not implying
   every
   request hogs the connection, but that you could have ended up in a
   scenario
   where that did happen.
   otherwise, you would have not seen the problem for 2 hours and to
   go away
   when the system was restarted, as it should have failed on
   validation.
  
   You can enable validation every single time by doing
  
   validationInterval=1
  
   after that, if it was me, I'd start pulling in something like
   Wireshark to
   see what is going on
  
   Filip
  
   - Original Message -
From: Colin Ingarfield colin...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, March 21, 2012 10:11:43 AM
Subject: Re: how to enable debug logging for Tomcat jdbc pool
(Tomcat
   6.0.32)
   
I added the 3 abandoned settings but I don't see any indication
in
the
tomcat log that connections are being abandoned.  I also made the
max
pool
size pretty small.. my application would have failed quickly if
all
the
connections we're being incorrectly held up.
   
Anything else I can try?  Thanks again for your  help.
   
-- Colin
   
On Wed, Mar 21, 2012 at 10:41 AM, Filip Hanik Mailing Lists 
devli...@hanik.com wrote:
   
 Got it, thank you.
 The other way this can happen is if the application checks out
 a
 connection and then never returns it, and expects

Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-21 Thread Filip Hanik Mailing Lists
.getConnection(Unknown Source) ~[na:na]
  at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
 ~[na:na]
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ~[na:1.6.0_29]
  at java.lang.reflect.Method.invoke(Method.java:597)
  ~[na:1.6.0_29]
  at
 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 ~[spring-aop-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  at
 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
 ~[spring-aop-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  at $Proxy13.getConnection(Unknown Source) ~[na:na]
  at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
 ~[na:na]
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ~[na:1.6.0_29]
  at java.lang.reflect.Method.invoke(Method.java:597)
  ~[na:1.6.0_29]
  at
  net.bull.javamelody.JdbcWrapper$4.invoke(JdbcWrapper.java:660)
 ~[javamelody-core-1.34.0.jar:1.34.0]
  at
 net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:232)
 ~[javamelody-core-1.34.0.jar:1.34.0]
  at $Proxy21.getConnection(Unknown Source) ~[na:na]
  at
 org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:403)
 ~[spring-jdbc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  at
 org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
 ~[spring-jdbc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  at $Proxy28.prepareStatement(Unknown Source) ~[na:na]
  at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
 ~[na:na]
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ~[na:1.6.0_29]
  at java.lang.reflect.Method.invoke(Method.java:597)
  ~[na:1.6.0_29]
  at
 net.bull.javamelody.JdbcWrapper$ConnectionInvocationHandler.invoke(JdbcWrapper.java:176)
 ~[javamelody-core-1.34.0.jar:1.34.0]
  at
 net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:232)
 ~[javamelody-core-1.34.0.jar:1.34.0]
  at $Proxy29.prepareStatement(Unknown Source) ~[na:na]
  at
 org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1375)
 ~[spring-jdbc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  at
 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:580)
 ~[spring-jdbc-3.0.5.RELEASE.jar:3.0.5.RELEASE]
  ... 22 common frames omitted
 Caused by: java.net.ConnectException: Connection timed out
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  ~[na:1.6.0_29]
  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
 ~[na:1.6.0_29]
  at
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
 ~[na:1.6.0_29]
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
 ~[na:1.6.0_29]
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 ~[na:1.6.0_29]
  at java.net.Socket.connect(Socket.java:529) ~[na:1.6.0_29]
  at java.net.Socket.connect(Socket.java:478) ~[na:1.6.0_29]
  at java.net.Socket.init(Socket.java:375) ~[na:1.6.0_29]
  at java.net.Socket.init(Socket.java:218) ~[na:1.6.0_29]
  at
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
 ~[mysql-connector-java-5.1.17-bin.jar:na]
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:294)
 ~[mysql-connector-java-5.1.17-bin.jar:na]
  ... 68 common frames omitted
 
 
 
 
 
 
 
 On 03/20/2012 10:29 AM, Filip Hanik (mailing lists) wrote:
 
 Define connection timeouts so that we can understand your problem
 to
 suggest for how to trace it down.
 What are you trying to search for. Errors would be logged as errors,
 and
 should show up with the standard configuration
 
 Filip
 
 
 -Original Message-
 From: Colin Ingarfield [mailto:colin...@gmail.com
 colin...@gmail.com]
 Sent: Monday, March 19, 2012 1:51 PM
 To: users@tomcat.apache.org
 Subject: how to enable debug logging for Tomcat jdbc pool (Tomcat
 6.0.32)
 
 Hello,
 
 I'm using the new Tomcat jdbc pool (1.1.0.1) with Tomcat 6.0.32,
 Ubuntu
 x86_64.  I would like to increase the logging from the pool to try
 and
 chase down connection timeouts.
 
 I added the following line to $CATALINA_BASE/conf/logging.properties:
 org.apache.tomcat.jdbc.pool.level=FINE
 
 (the rest of the logging.properties file is unchanged.)
 
 But I don't see any pool debug logging output on the console.  I
 thought
 this setting would enable debug logging for all classes in that
 package.
 Is there something else I need to do?
 
 Thank you,
 Colin
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h

Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-21 Thread Filip Hanik Mailing Lists


- Original Message -
 From: Colin Ingarfield colin...@gmail.com
 To: users@tomcat.apache.org
 Sent: Wednesday, March 21, 2012 6:25:54 AM
 Subject: Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

 
 iirc I copied the version number from the
 tomcat-jdbc.jar/META-INF/MANIFEST.MF file and renamed the jar myself.
 (Looking in the manifest now I see Bundle-Version: 1.1.0.1).  I
 prefer
 to avoid unversioned jar files in my project as it can cause
 confusion.
 
 But I don't recall which version of Tomcat 7 I got the jar from.  Is
 the
 best policy to always use the tomcat-jdbc jar from the latest version
 of
 Tomcat 7?

yes, as of now it is. As tomcat-jdbc got included in Tomcat 7 it gets published 
as an individual JAR in the Maven repo as well.

Filip

 
 Thank you,
 Colin
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-21 Thread Filip Hanik Mailing Lists
Got it, thank you.
The other way this can happen is if the application checks out a connection and 
then never returns it, and expects it to be used.
For this you will want to enable 

removeAbandonedTimeout=60
removeAbandoned=true
logAbandoned=true

this should tell you pretty quickly if you got a component that is hogging the 
connection. So test that first. Now if that is the case, there is a way to fix 
that:

1. remove the above settings
2. compile and configure the interceptor described in:
   https://issues.apache.org/bugzilla/show_bug.cgi?id=52024
In this interceptor, when a failure occurs, it automatically reconnects and 
retries the operation. And that is the only way to get around the problem 
(assuming my assumption is correct)


Filip
- Original Message -
 From: Colin Ingarfield colin...@gmail.com
 To: users@tomcat.apache.org
 Sent: Wednesday, March 21, 2012 9:30:46 AM
 Subject: Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)
 
 My configuration:
 
Resource auth=Container
 name=jdbc/cdb.mysql
 defaultAutoCommit=false
 driverClassName=com.mysql.jdbc.Driver
 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
 url=jdbc:mysql://X.com/_dev?sessionVariables=TRANSACTION
 ISOLATION LEVEL READ COMMITTED
 username=X
 password=X
 
 maxActive=100
 maxIdle=100
 minIdle=10
 initialSize=10
 maxWait=1
 testOnBorrow=true
 type=javax.sql.DataSource
 validationQuery=SELECT 1/
 
 
 I have testOnBorrow and validationQuery set as you suggest, so I do
 not
 think that is the issue.
 
 Thanks,
 Colin
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-21 Thread Filip Hanik Mailing Lists
it will take a while to see the abandoned log. I'm not implying every request 
hogs the connection, but that you could have ended up in a scenario where that 
did happen.
otherwise, you would have not seen the problem for 2 hours and to go away when 
the system was restarted, as it should have failed on validation.

You can enable validation every single time by doing 

validationInterval=1

after that, if it was me, I'd start pulling in something like Wireshark to see 
what is going on

Filip

- Original Message -
 From: Colin Ingarfield colin...@gmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, March 21, 2012 10:11:43 AM
 Subject: Re: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)
 
 I added the 3 abandoned settings but I don't see any indication in
 the
 tomcat log that connections are being abandoned.  I also made the max
 pool
 size pretty small.. my application would have failed quickly if all
 the
 connections we're being incorrectly held up.
 
 Anything else I can try?  Thanks again for your  help.
 
 -- Colin
 
 On Wed, Mar 21, 2012 at 10:41 AM, Filip Hanik Mailing Lists 
 devli...@hanik.com wrote:
 
  Got it, thank you.
  The other way this can happen is if the application checks out a
  connection and then never returns it, and expects it to be used.
  For this you will want to enable
 
  removeAbandonedTimeout=60
  removeAbandoned=true
  logAbandoned=true
 
  this should tell you pretty quickly if you got a component that is
  hogging
  the connection. So test that first. Now if that is the case, there
  is a way
  to fix that:
 
  1. remove the above settings
  2. compile and configure the interceptor described in:
https://issues.apache.org/bugzilla/show_bug.cgi?id=52024
  In this interceptor, when a failure occurs, it automatically
  reconnects
  and retries the operation. And that is the only way to get around
  the
  problem (assuming my assumption is correct)
 
 
  Filip
  - Original Message -
   From: Colin Ingarfield colin...@gmail.com
   To: users@tomcat.apache.org
   Sent: Wednesday, March 21, 2012 9:30:46 AM
   Subject: Re: how to enable debug logging for Tomcat jdbc pool
   (Tomcat
  6.0.32)
  
   My configuration:
  
  Resource auth=Container
   name=jdbc/cdb.mysql
   defaultAutoCommit=false
   driverClassName=com.mysql.jdbc.Driver
   factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
   url=jdbc:mysql://X.com/_dev?sessionVariables=TRANSACTION
   ISOLATION LEVEL READ COMMITTED
   username=X
   password=X
  
   maxActive=100
   maxIdle=100
   minIdle=10
   initialSize=10
   maxWait=1
   testOnBorrow=true
   type=javax.sql.DataSource
   validationQuery=SELECT 1/
  
  
   I have testOnBorrow and validationQuery set as you suggest, so I
   do
   not
   think that is the issue.
  
   Thanks,
   Colin
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)

2012-03-20 Thread Filip Hanik (mailing lists)
Define connection timeouts so that we can understand your problem to
suggest for how to trace it down.
What are you trying to search for. Errors would be logged as errors, and
should show up with the standard configuration

Filip

 -Original Message-
 From: Colin Ingarfield [mailto:colin...@gmail.com]
 Sent: Monday, March 19, 2012 1:51 PM
 To: users@tomcat.apache.org
 Subject: how to enable debug logging for Tomcat jdbc pool (Tomcat 6.0.32)
 
 Hello,
 
 I'm using the new Tomcat jdbc pool (1.1.0.1) with Tomcat 6.0.32, Ubuntu
 x86_64.  I would like to increase the logging from the pool to try and
 chase down connection timeouts.
 
 I added the following line to $CATALINA_BASE/conf/logging.properties:
 org.apache.tomcat.jdbc.pool.level=FINE
 
 (the rest of the logging.properties file is unchanged.)
 
 But I don't see any pool debug logging output on the console.  I thought
 this setting would enable debug logging for all classes in that package.
 Is there something else I need to do?
 
 Thank you,
 Colin


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Need a sample server.xml file for the session replication using backup manager

2012-03-20 Thread Filip Hanik (mailing lists)
Take the sample from the tomcat site, change DeltaManager to BackupManager

 -Original Message-
 From: Dhaval Jaiswal [mailto:dhaval.jais...@via.com]
 Sent: Monday, March 19, 2012 4:32 AM
 To: users@tomcat.apache.org
 Cc: Shrinivas Devarkonda
 Subject: Need a sample server.xml file for the session replication using
 backup manager
 
 Hi List,
 
 I am planning to implement  the session replication using backup manager
 mode.
 
 We have 10 tomcats. we need in place where one node can work as a backup
 manager; on which we want to send all jsessions information from rest of
 the tomcats.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Configure SSL under Tomcat 7

2012-03-19 Thread Filip Hanik Mailing Lists
ok, keystore is for Java connectors. but you have chosen to use the APR 
connector. so you should use the certificate format that is used for that 
connector

- Original Message -
 From: ayouB __ ayb-2...@hotmail.fr
 To: users@tomcat.apache.org
 Sent: Monday, March 19, 2012 11:00:59 AM
 Subject: RE: Configure SSL under Tomcat 7
 
 
 Still not working !!
 I downloaded Apache Tomcat 7.0.26 (again), i added the tcnative-1.dll
 in my : apache-tomcat-7.0.26\bin, i created a keystore file with
 this command :
 keytool -genkeypair -alias tomcat -keyalg RSA -keystore C:\mykeystore
 i put the file named mykeystore in my : apache-tomcat-7.0.26\conf
 i modified my Tomcat's server.xml to be able to support HTTPS as it
 has been said in apache tomcat's documentation from the official
 website and as it had been said in the e-book : Apache Tomcat 7
 (Aleska Vukotic and James Goodwill) in the chapter 7 : Securing
 tomcat with SSL ! (Step by step)
 Here's my conf/server.xml :
 ===server.xml=
 ?xml version='1.0' encoding='utf-8'?
 !--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed
   with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version
   2.0
   (the License); you may not use this file except in compliance
   with
   the License.  You may obtain a copy of the License at
   http://www.apache.org/licenses/LICENSE-2.0
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an AS IS BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 --
 !-- Note:  A Server is not itself a Container, so you may not
  define subcomponents such as Valves at this level.
  Documentation at /docs/config/server.html
  --
 Server port=8005 shutdown=SHUTDOWN
   !-- Security listener. Documentation at
   /docs/config/listeners.html
   Listener className=org.apache.catalina.security.SecurityListener
   /
   --
   !--APR library loader. Documentation at /docs/apr.html --
   Listener className=org.apache.catalina.core.AprLifecycleListener
   SSLEngine=on /
   !--Initialize Jasper prior to webapps are loaded. Documentation at
   /docs/jasper-howto.html --
   Listener className=org.apache.catalina.core.JasperListener /
   !-- Prevent memory leaks due to use of particular java/javax
   APIs--
   Listener
   className=org.apache.catalina.core.JreMemoryLeakPreventionListener
   /
   Listener
   className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
   /
   Listener
   className=org.apache.catalina.core.ThreadLocalLeakPreventionListener
   /
   !-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
   --
   GlobalNamingResources
 !-- Editable user database that can also be used by
  UserDatabaseRealm to authenticate users
 --
 Resource name=UserDatabase auth=Container
   type=org.apache.catalina.UserDatabase
   description=User database that can be updated and
   saved
   factory=org.apache.catalina.users.MemoryUserDatabaseFactory
   pathname=conf/tomcat-users.xml /
   /GlobalNamingResources
   !-- A Service is a collection of one or more Connectors that
   share
a single Container Note:  A Service is not itself a
Container,
so you may not define subcomponents such as Valves at this
level.
Documentation at /docs/config/service.html
--
   Service name=Catalina
 !--The connectors can use a shared executor, you can define one
 or more named thread pools--
 !--
 Executor name=tomcatThreadPool namePrefix=catalina-exec-
 maxThreads=150 minSpareThreads=4/
 --
 
 !-- A Connector represents an endpoint by which requests are
 received
  and responses are returned. Documentation at :
  Java HTTP Connector: /docs/config/http.html (blocking 
  non-blocking)
  Java AJP  Connector: /docs/config/ajp.html
  APR (HTTP/AJP) Connector: /docs/apr.html
  Define a non-SSL HTTP/1.1 Connector on port 8080
 --
 Connector port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443 /
 !-- A Connector using the shared thread pool--
 !--
 Connector executor=tomcatThreadPool
port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443 /
 --
 !-- Define a SSL HTTP/1.1 Connector on port 8443
  This connector uses the JSSE configuration, when using APR,
  the
  connector should be using the OpenSSL style configuration

Re: Configure SSL under Tomcat 7

2012-03-16 Thread Filip Hanik Mailing Lists
set SSLEnabled=true in your Connector element, that turns on SSL.
After that, if you don't have keystoreFile or keystorePass set, it will throw 
errors

Filip


- Original Message -
 From: ayouB __ ayb-2...@hotmail.fr
 To: users@tomcat.apache.org
 Sent: Friday, March 16, 2012 9:58:49 AM
 Subject: Configure SSL under Tomcat 7
 
 
 Hi every one,
  
 I'm ayoub and i'm a new member of this mailing list :)
 Well, i want to configure SSL under Tomcat 7 so i have followed steps
 said in http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html, but
 when i deploy my project in tomcat server i don't get :
 https://loclhost:8080/ i still working with the native http !! what
 should i do, what configuration should i make on my server.xml file.
 PS : I want to use the APR implementation not the JSSE one, and BTW
 the : SSLCertificateFile  SSLCertificateKeyFile don't exist in the
 connector ... / element (usinf eclipse Ctrl+space auto-complish)
 !!
  
 Thanks.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Configure SSL under Tomcat 7

2012-03-16 Thread Filip Hanik Mailing Lists
ok, check your logs for errors. You must have APR libraries with OpenSSL 
installed, and you must specify the 
SSLCertificateFile  SSLCertificateKeyFile attributes.
All errors will be in the logs

Filip

- Original Message -
 From: ayouB __ ayb-2...@hotmail.fr
 To: users@tomcat.apache.org
 Sent: Friday, March 16, 2012 10:52:13 AM
 Subject: RE: Configure SSL under Tomcat 7
 
 
 Sorry :D i want say server.xml
  
 
  From: ayb-2...@hotmail.fr
  To: users@tomcat.apache.org
  Subject: RE: Configure SSL under Tomcat 7
  Date: Fri, 16 Mar 2012 16:50:14 +
  
  
  Here's My service.xml file :
  ?xml version='1.0' encoding='utf-8'?
  !--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements. See the NOTICE file distributed
  with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version
  2.0
  (the License); you may not use this file except in compliance
  with
  the License. You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an AS IS BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  --
  !-- Note: A Server is not itself a Container, so you may not
  define subcomponents such as Valves at this level.
  Documentation at /docs/config/server.html
  --
  Server port=8005 shutdown=SHUTDOWN
  !-- Security listener. Documentation at
  /docs/config/listeners.html
  Listener className=org.apache.catalina.security.SecurityListener
  /
  --
  !--APR library loader. Documentation at /docs/apr.html --
  Listener className=org.apache.catalina.core.AprLifecycleListener
  SSLEngine=on /
  !--Initialize Jasper prior to webapps are loaded. Documentation at
  /docs/jasper-howto.html --
  Listener className=org.apache.catalina.core.JasperListener /
  !-- Prevent memory leaks due to use of particular java/javax
  APIs--
  Listener
  className=org.apache.catalina.core.JreMemoryLeakPreventionListener
  /
  Listener
  className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
  /
  Listener
  className=org.apache.catalina.core.ThreadLocalLeakPreventionListener
  /
  
  !-- Global JNDI resources
  Documentation at /docs/jndi-resources-howto.html
  --
  GlobalNamingResources
  !-- Editable user database that can also be used by
  UserDatabaseRealm to authenticate users
  --
  Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources
  
  !-- A Service is a collection of one or more Connectors that
  share
  a single Container Note: A Service is not itself a Container,
  so you may not define subcomponents such as Valves at this level.
  Documentation at /docs/config/service.html
  --
  Service name=Catalina
  
  !--The connectors can use a shared executor, you can define one or
  more named thread pools--
  !--
  Executor name=tomcatThreadPool namePrefix=catalina-exec-
  maxThreads=150 minSpareThreads=4/
  --
  
  
  !-- A Connector represents an endpoint by which requests are
  received
  and responses are returned. Documentation at :
  Java HTTP Connector: /docs/config/http.html (blocking 
  non-blocking)
  Java AJP Connector: /docs/config/ajp.html
  APR (HTTP/AJP) Connector: /docs/apr.html
  Define a non-SSL HTTP/1.1 Connector on port 8080
  --
  !--
  Connector port=8080
  protocol=org.apache.coyote.http11.Http11AprProtocol
  connectionTimeout=2
  redirectPort=8080 /
  --
  !-- A Connector using the shared thread pool--
  !--
  Connector executor=tomcatThreadPool
  port=8080 protocol=HTTP/1.1
  connectionTimeout=2
  redirectPort=8443 /
  --
  !-- Define a SSL HTTP/1.1 Connector on port 8443
  This connector uses the JSSE configuration, when using APR, the
  connector should be using the OpenSSL style configuration
  described in the APR documentation --
  
  Connector port=8080
  protocol=org.apache.coyote.http11.Http11AprProtocol
  SSLEnabled=true
  maxThreads=150 scheme=https secure=true
  clientAuth=optional sslProtocol=TLS/
  
  
  !-- Define an AJP 1.3 Connector on port 8009 --
  Connector port=8009 protocol=AJP/1.3 redirectPort=8443/
  
  
  !-- An Engine represents the entry point (within Catalina) that
  processes
  every request. The Engine implementation for Tomcat stand alone
  analyzes the HTTP headers included with the request, and passes
  them
  on to the appropriate Host (virtual host).
  Documentation at /docs/config/engine.html --
  
  !-- You should set jvmRoute to support load-balancing via AJP ie :
  Engine name=Catalina defaultHost=localhost jvmRoute=jvm1
  --
  

RE: Configure SSL under Tomcat 7

2012-03-16 Thread Filip Hanik Mailing Lists
The logs show that you don't have Tcnative installed

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



  1   2   3   4   5   6   7   8   9   10   >