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: 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



Re: Server crash for memory limit

2011-11-29 Thread Filip Hanik Mailing Lists
that's a restriction of 32 bit systems. upgrade to 64 bit for more memory 
requirements
depending on the kernel, you can go to 3.7gb for a 32 bit system
- Original Message -
From: hi tanin hi_ta...@yahoo.com
To: users@tomcat.apache.org
Sent: Tuesday, November 29, 2011 8:05:51 AM
Subject: Server crash for memory limit

Hi,
I am using Tomcat 5.0.27. I cannot use more then 2GB for Tomcat 5.0.27. Our OS 
is 32-bit Linux. Can ane one tell me why this happening? And is there any way 
to get rid of this problem and use lot of memory?

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