RE: Connector Setting Problem in tomcat 6.0.29

2010-11-04 Thread Caldarale, Charles R
> From: rujin raj [mailto:rujin...@gmail.com] 
> Subject: Re: Connector Setting Problem in tomcat 6.0.29

> I added the attributes in connector executer. even though 
> it is not working

> Executer setting:
> port="8080" protocol="HTTP/1.1"
>minSpareThreads="50"
>connectionTimeout="2"
>redirectPort="8443" />
> I need to specify both miSpareThreads and maxSparethreads

Try actually reading the doc:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html

Place the attributes where the doc says.  (Hint: they don't go in the 
 element - as you're already been told.)  There's even a 
commented-out  example in the standard server.xml.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Connector Setting Problem in tomcat 6.0.29

2010-11-04 Thread rujin raj
I added the attributes in connector executer. even though it is not working

Executer setting:

I need to specify both miSpareThreads and maxSparethreads

Please help

--rujinraj

On 3 November 2010 14:32, Rainer Jung  wrote:

> On 02.11.2010 14:20, Caldarale, Charles R wrote:
>
>> From: rujin raj [mailto:rujin...@gmail.com]
>>> Subject: Connector Setting Problem in tomcat 6.0.29
>>>
>>
>>  I am using tomcat 6.0.29 64 bit and java 64 1.6.0 64 bit edition.I
>>> configured the http connector minSpareThreads and MaxSpareThreads.
>>>
>>
>> There are no such settings for the  element; read the doc for
>> the level of Tomcat you're using:
>> http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
>>
>> If you want more control over the thread pool, specify an:
>> http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html
>>
>
> I hope I don't add to much confusion: AFAIK the settings do still exist for
> the AJP connectors in TC 6 even though they are removed from the docs. And
> yes, I think they are gone for HTTP.
>
> Regards,
>
> Rainer
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: mod_jk makes ajp connector run out of free connections

2010-11-04 Thread Marc Wilmots
Forget about my math question.
Obviously, connection_pool_size of 15, would mean there are 60 (4 tomcats)
in total per server process.
Then the math works out

Sorry, it's 1:08am over here :-)

2010/11/5 Marc Wilmots 

> Honestlyno, I didn't.
> The mod_jk scared the hell out of mewouldn't you? :-)
>
> "Using this option will have a strong performance penalty for Apache and
> Tomcat. Use this only as a last resort in case of unfixable network
> problems."
>
> I'll give it a try tomorrow and see what it gives.
>
> By the way, my last calculation about connection_pool_size was wrong. I
> forgot to include the second Apache server. The math would look like this
> then:
>
> Apache1 -> 10 server processes x 15 x 4 (tomcats) = 600
> Apache2 -> 10 server processes x 15 x 4 (tomcats) = 600, which makes 1200
> in total
>
> Each Tomcat would receive a maximum of 300 connections, which would leave
> 100 free connections per Tomcat. This would solve the problem that Tomcat
> runs out of connections. The thing is...not all of my available Apache
> connections can be used:
>
> Apache has 60 threads per server process (10) -> 600 connections.
> connection_pool_size per server process: 15. This would mean only 15 of 60
> possible connections per server process can actually establish a connection
> to Tomcat.
>
> In order to be able to server all Apache connections simultaneously, I
> would need 4 more Tomcats?
>
>
>
>
>
>
> 2010/11/5 Mark Thomas 
>
> On 04/11/2010 19:27, Marc Wilmots wrote:
>> > The best solution would be to enable DisableReuse as Mark stated,
>> although
>> > I'm afraid that would be too big of a performance hit.
>>
>> Have you tried it?
>>
>> The cost of the required CPING/CPONG isn't that different to the cost of
>> creating a TCP/IP connection. On a fast local area network I doubt you'd
>> notice it. The time taken to establish a TCP/IP connection is usually
>> (YMMV so test it) << the time taken to process a request.
>>
>> Mark
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: mod_jk makes ajp connector run out of free connections

2010-11-04 Thread Marc Wilmots
Honestlyno, I didn't.
The mod_jk scared the hell out of mewouldn't you? :-)

"Using this option will have a strong performance penalty for Apache and
Tomcat. Use this only as a last resort in case of unfixable network
problems."

I'll give it a try tomorrow and see what it gives.

By the way, my last calculation about connection_pool_size was wrong. I
forgot to include the second Apache server. The math would look like this
then:

Apache1 -> 10 server processes x 15 x 4 (tomcats) = 600
Apache2 -> 10 server processes x 15 x 4 (tomcats) = 600, which makes 1200 in
total

Each Tomcat would receive a maximum of 300 connections, which would leave
100 free connections per Tomcat. This would solve the problem that Tomcat
runs out of connections. The thing is...not all of my available Apache
connections can be used:

Apache has 60 threads per server process (10) -> 600 connections.
connection_pool_size per server process: 15. This would mean only 15 of 60
possible connections per server process can actually establish a connection
to Tomcat.

In order to be able to server all Apache connections simultaneously, I would
need 4 more Tomcats?






2010/11/5 Mark Thomas 

> On 04/11/2010 19:27, Marc Wilmots wrote:
> > The best solution would be to enable DisableReuse as Mark stated,
> although
> > I'm afraid that would be too big of a performance hit.
>
> Have you tried it?
>
> The cost of the required CPING/CPONG isn't that different to the cost of
> creating a TCP/IP connection. On a fast local area network I doubt you'd
> notice it. The time taken to establish a TCP/IP connection is usually
> (YMMV so test it) << the time taken to process a request.
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: mod_jk makes ajp connector run out of free connections

2010-11-04 Thread Mark Thomas
On 04/11/2010 19:27, Marc Wilmots wrote:
> The best solution would be to enable DisableReuse as Mark stated, although
> I'm afraid that would be too big of a performance hit.

Have you tried it?

The cost of the required CPING/CPONG isn't that different to the cost of
creating a TCP/IP connection. On a fast local area network I doubt you'd
notice it. The time taken to establish a TCP/IP connection is usually
(YMMV so test it) << the time taken to process a request.

Mark



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



Re: mod_jk makes ajp connector run out of free connections

2010-11-04 Thread Marc Wilmots
I just got my own question answered whether connection_pool_size sets a pool
per server process.

"This defines the number of connections made to the AJP backend that are
maintained as a connection pool. It will limit the number of those
connection that each web server child process can made."

This still leaves me with the question; 1200 (apache connections) is still
bigger than 600 (15 x 10 server processes x 4 tomcat nodes)

2010/11/5 Marc Wilmots 

> Rainer, that's very true.
> So I am wondering...If 1200 > 200 (Tomcat maxThreads), then what would be
> the right way to solve this? Imagine that 2 Tomcats would crash, that would
> leave me with 1200 > 400. I can't just raise the maxThreads to 600 for each
> Tomcat, as that would probably perform even worse (I'm thinking about
> excessive context switching, etc).
>
> The best solution would be to enable DisableReuse as Mark stated, although
> I'm afraid that would be too big of a performance hit.
> The other option would be to configure the connection_pool_size, according
> to Mladen's link. Although, this last one isn't very clear to me either. I
> state from the URL Mladen passed:
>
> *"There are 4 JBoss servers each containing 1 JBoss instance(s) giving a
> total of 4 mod_jk workers*
>
> *Given the ThreadsPerChild of 60 and the MaxClients (600) /
> ThreadsPerChild (60) = Processes (10) and with 2 Apache instance(s) then
> the connection_pool_size has been best determined to be 15*
>
> *The total Jboss threads 1600 are > the total Apache threads 1200. The
> mod_jk connection_pool_size was determined to be 15 via the math 600Apache 
> MaxClients /
> 4 total Jboss instances 150 threads per JBoss which will be equal to or
> less than the maxThreads 400 150 / 10 Apache server processes to get the
> connection_pool_size of 15. in Jboss. Take this number"*
>
> I'm wondering, setting connection_pool_size 15, wouldn't this mean that the
> maximum number of connections being handled by tomcat at one time is limited
> to 15?? Or would there be a pool per Apache server process? Which would mean
> 150 connections (10 server processes) per Tomcat. If so, then this would
> total 600 connections (4 Tomcats).
>
> 1200 > 600. Same problem, right?
>
> 2010/10/28 Rainer Jung 
>
> On 26.10.2010 20:36, Marc Wilmots wrote:
>>
>>> 2010/10/26 Mladen Turk
>>>
>>>  On 10/26/2010 02:47 PM, Marc Wilmots wrote:

  Hi Experts,
>
> I have the following setup:
>
> Apache1
> / \
>   Apache2   Apache3
>\  /
>Tomcat1
>
> All Apaches are version 2.2.3 (RedHat)
> Apache2 and Apache3 loadbalance Tomcat1 (6.0.18) with mod_jk (2.2.28).
>
> In idle state the AJP connector of Tomcat1 only has 7 active
> connections.
> After launching a stress test of Tomcat1, it's AJP connector has
> reached
> maxThreads (200). After the stress test has finished, there are still
> 200
> active connections in the AJP connector.
>
> Because of this, apache2 and apache2 cannot receive any heartbeat
> message
> anymore from the AJP connector and mark Tomcat1 as dead. I can access
> perfectly through port 8080, so Tomcat1 isn't dead at all!
>
>
>  You have a usual setup problem where the number of connections
 in httpd fronting tomcat is too high for a tomcat.
 And you don't have any mechanism for limiting those connections.

 Sorry, I realize I had to mention I have a total of 4 Tomcats, which in

>>> total make up a maxThreads of 800 (200 each).
>>> The Apaches have a maxClients of each 600 (1200 total).
>>>
>>> 1200>  1000, thus your theory is probably right. However, I'm just
>>> wondering... I read that when Tomcat reaches the max number of
>>> connections,
>>> just rejects new connections (I'm omitting the backlog on purpose).
>>>
>>
>> Yes.
>>
>> But your calculation above is not right. Each Apache will connect to each
>> Tomcat. So from the point of view of one Tomcat, it has 200 threads, but
>> 1200 posible incoming connections from the Apache Servers. So it is not 1200
>> > 800 but 1200 > 200!
>>
>> Regards,
>>
>> Rainer
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: mod_jk makes ajp connector run out of free connections

2010-11-04 Thread Marc Wilmots
Rainer, that's very true.
So I am wondering...If 1200 > 200 (Tomcat maxThreads), then what would be
the right way to solve this? Imagine that 2 Tomcats would crash, that would
leave me with 1200 > 400. I can't just raise the maxThreads to 600 for each
Tomcat, as that would probably perform even worse (I'm thinking about
excessive context switching, etc).

The best solution would be to enable DisableReuse as Mark stated, although
I'm afraid that would be too big of a performance hit.
The other option would be to configure the connection_pool_size, according
to Mladen's link. Although, this last one isn't very clear to me either. I
state from the URL Mladen passed:

*"There are 4 JBoss servers each containing 1 JBoss instance(s) giving a
total of 4 mod_jk workers*

*Given the ThreadsPerChild of 60 and the MaxClients (600) / ThreadsPerChild
(60) = Processes (10) and with 2 Apache instance(s) then the
connection_pool_size has been best determined to be 15*

*The total Jboss threads 1600 are > the total Apache threads 1200. The
mod_jk connection_pool_size was determined to be 15 via the math 600 Apache
MaxClients / 4 total Jboss instances 150 threads per JBoss which will be
equal to or less than the maxThreads 400 150 / 10 Apache server processes to
get the connection_pool_size of 15. in Jboss. Take this number"*

I'm wondering, setting connection_pool_size 15, wouldn't this mean that the
maximum number of connections being handled by tomcat at one time is limited
to 15?? Or would there be a pool per Apache server process? Which would mean
150 connections (10 server processes) per Tomcat. If so, then this would
total 600 connections (4 Tomcats).

1200 > 600. Same problem, right?

2010/10/28 Rainer Jung 

> On 26.10.2010 20:36, Marc Wilmots wrote:
>
>> 2010/10/26 Mladen Turk
>>
>>  On 10/26/2010 02:47 PM, Marc Wilmots wrote:
>>>
>>>  Hi Experts,

 I have the following setup:

 Apache1
 / \
   Apache2   Apache3
\  /
Tomcat1

 All Apaches are version 2.2.3 (RedHat)
 Apache2 and Apache3 loadbalance Tomcat1 (6.0.18) with mod_jk (2.2.28).

 In idle state the AJP connector of Tomcat1 only has 7 active
 connections.
 After launching a stress test of Tomcat1, it's AJP connector has reached
 maxThreads (200). After the stress test has finished, there are still
 200
 active connections in the AJP connector.

 Because of this, apache2 and apache2 cannot receive any heartbeat
 message
 anymore from the AJP connector and mark Tomcat1 as dead. I can access
 perfectly through port 8080, so Tomcat1 isn't dead at all!


  You have a usual setup problem where the number of connections
>>> in httpd fronting tomcat is too high for a tomcat.
>>> And you don't have any mechanism for limiting those connections.
>>>
>>> Sorry, I realize I had to mention I have a total of 4 Tomcats, which in
>>>
>> total make up a maxThreads of 800 (200 each).
>> The Apaches have a maxClients of each 600 (1200 total).
>>
>> 1200>  1000, thus your theory is probably right. However, I'm just
>> wondering... I read that when Tomcat reaches the max number of
>> connections,
>> just rejects new connections (I'm omitting the backlog on purpose).
>>
>
> Yes.
>
> But your calculation above is not right. Each Apache will connect to each
> Tomcat. So from the point of view of one Tomcat, it has 200 threads, but
> 1200 posible incoming connections from the Apache Servers. So it is not 1200
> > 800 but 1200 > 200!
>
> Regards,
>
> Rainer
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Konstantin Kolinko
2010/11/5 Nagulapalli, Srinivas :
> Many thanks for the tip. Didn't realize how much context file changed. 
> Changed context.xml like below and it deploys fine now in 6.0.20.
> Going to check and test more. Please tell if I am missing out on limb still.
>
> Changed contents of MYPROJECT.xml that deploys fine:
> ==
> 

"debug" attribute is not used anymore

>                        prefix="MYPROJECT_log." suffix=".txt"
>                timestamp="true"/>

Logger element is not supported.

>                        type="javax.sql.DataSource"
>                description="MYPROJECT Application Database"/>

OK, but you will want to add other properties (such as driver,
connection url, username, password), see docs.

You may add back the AccessLogValve. It was OK.

> 
>

Best regards,
Konstantin Kolinko

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



RE: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Nagulapalli, Srinivas
Many thanks for the tip. Didn't realize how much context file changed. Changed 
context.xml like below and it deploys fine now in 6.0.20. 
Going to check and test more. Please tell if I am missing out on limb still.

Changed contents of MYPROJECT.xml that deploys fine:
==


  




-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Thursday, November 04, 2010 5:19 PM
To: Tomcat Users List
Subject: Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010/11/4 Nagulapalli, Srinivas :
> Forgot to put contents of application's context.xml. Still no difference
> in contents between 6.0.18 and 6.0.20- same file listed under
> %TOMCAT_HOME%\conf\Catalina\localhost\MYPROJECT.xml for both versions
>

A lot is wrong with your context file. Please read the docs,
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html


> Contents of MYPROJECT.XML :
> 
> 
> 

The root element must be 

>
>                        prefix="MYPROJECT_log." suffix=".txt"
>                timestamp="true"/>
>
>                        type="javax.sql.DataSource"
>                description="MYPROJECT Application Database"/>
>
>        

There is no  tag in Tomcat 6.0, nor in 5.5.

>                
>                        factory
>
> org.apache.commons.dbcp.BasicDataSourceFactory
>                
>
>                
>                        removeAbandoned
>                                true
>                
>
>                
>                        removeAbandonedTimeout
>                                60
>                
>        
>
>                 prefix="MYPROJECT_access_log." suffix=".txt"
>         pattern="common"/>
> 
>

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



This electronic message transmission contains information from the Company that 
may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or entity 
named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the contents of 
this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender immediately by 
replying to the address listed in the "From:" field. 


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



Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Konstantin Kolinko
2010/11/4 Nagulapalli, Srinivas :
> Forgot to put contents of application's context.xml. Still no difference
> in contents between 6.0.18 and 6.0.20- same file listed under
> %TOMCAT_HOME%\conf\Catalina\localhost\MYPROJECT.xml for both versions
>

A lot is wrong with your context file. Please read the docs,
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html


> Contents of MYPROJECT.XML :
> 
> 
> 

The root element must be 

>
>                        prefix="MYPROJECT_log." suffix=".txt"
>                timestamp="true"/>
>
>                        type="javax.sql.DataSource"
>                description="MYPROJECT Application Database"/>
>
>        

There is no  tag in Tomcat 6.0, nor in 5.5.

>                
>                        factory
>
> org.apache.commons.dbcp.BasicDataSourceFactory
>                
>
>                
>                        removeAbandoned
>                                true
>                
>
>                
>                        removeAbandonedTimeout
>                                60
>                
>        
>
>                 prefix="MYPROJECT_access_log." suffix=".txt"
>         pattern="common"/>
> 
>

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



RE: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Nagulapalli, Srinivas
Forgot to put contents of application's context.xml. Still no difference
in contents between 6.0.18 and 6.0.20- same file listed under
%TOMCAT_HOME%\conf\Catalina\localhost\MYPROJECT.xml for both versions

Contents of MYPROJECT.XML :










factory

org.apache.commons.dbcp.BasicDataSourceFactory



removeAbandoned
true



removeAbandonedTimeout
60







-Original Message-
From: Nagulapalli, Srinivas [mailto:srinivas.nagulapa...@starwoodvo.com]

Sent: Thursday, November 04, 2010 4:48 PM
To: Tomcat Users List
Subject: RE: Difference in behavior between Tomcat 6.0.18 and 6.0.20

No difference in context.xml file for Tomcat-6.0.18 and 6.0.20-both have
following:


WEB-INF/web.xml


Thanks for any pointers.
-Srini


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, November 04, 2010 4:41 PM
To: Tomcat Users List
Subject: Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

On 04/11/2010 16:35, Nagulapalli, Srinivas wrote:
> Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig
deployWAR
> SEVERE: Error deploying configuration descriptor MYPROJECT.war

And the contexts of your context.xml file is what?

Mark



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



This electronic message transmission contains information from the
Company that may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or
entity named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the
contents of this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender
immediately by replying to the address listed in the "From:" field. 


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



This electronic message transmission contains information from the Company that 
may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or entity 
named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the contents of 
this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender immediately by 
replying to the address listed in the "From:" field. 


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



RE: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Nagulapalli, Srinivas
No difference in context.xml file for Tomcat-6.0.18 and 6.0.20-both have
following:


WEB-INF/web.xml


Thanks for any pointers.
-Srini


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, November 04, 2010 4:41 PM
To: Tomcat Users List
Subject: Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

On 04/11/2010 16:35, Nagulapalli, Srinivas wrote:
> Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig
deployWAR
> SEVERE: Error deploying configuration descriptor MYPROJECT.war

And the contexts of your context.xml file is what?

Mark



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



This electronic message transmission contains information from the Company that 
may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or entity 
named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the contents of 
this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender immediately by 
replying to the address listed in the "From:" field. 


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



Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Mark Thomas
On 04/11/2010 16:35, Nagulapalli, Srinivas wrote:
> Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig deployWAR
> SEVERE: Error deploying configuration descriptor MYPROJECT.war

And the contexts of your context.xml file is what?

Mark



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



RE: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Nagulapalli, Srinivas
I am stumped. I see in Catalina.log only the cryptic error message like
below. No error in localhost.log file.Don't know what I might be
missing. 
What is baffling is, same application gets deployed fine in Tomcat
6.0.18 and earlier.

Thanks for any pointers.
-Srini

Contents of Catalina.log:
Nov 4, 2010 4:28:04 PM org.apache.catalina.core.AprLifecycleListener
init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\WINDOWS\system32;(sniped for brevity)
Nov 4, 2010 4:28:04 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 4, 2010 4:28:04 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 706 ms
Nov 4, 2010 4:28:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 4, 2010 4:28:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig
deployDescriptor
SEVERE: Error deploying configuration descriptor MYPROJECT.xml
Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive MYPROJECT.war
Nov 4, 2010 4:28:05 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying configuration descriptor MYPROJECT.war


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, November 04, 2010 3:23 PM
To: Tomcat Users List
Subject: Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

On 04/11/2010 14:52, Nagulapalli, Srinivas wrote:
>  I appreciate any insights/pointers or help.

Look at the logs.

Mark

This electronic message transmission contains information from the Company that 
may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or entity 
named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the contents of 
this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender immediately by 
replying to the address listed in the "From:" field. 


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



Re: Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Mark Eggers
Interesting.

I'll have to try something similar for my situation.

What I'm trying to do is a bit of the reverse. I want 
hostname:80/tomcat-host/manager to end up at (tomcat-host) /manager for four 
different tomcat hosts. The forward stuff works fine, but the URLs coming back 
all drop the tomcat-host part.

I guess reading some more documentation is in order.

Glad you got it working without the reversproxy stuff.

/mde/


- Original Message 
From: Jeffrey Janner 
To: Tomcat Users List 
Sent: Thu, November 4, 2010 1:12:07 PM
Subject: RE: Is there a GOOD AJP-based cluster reference?

In looking at the JSPs, the dev team is coding all the paths inside a
 construct, which is why the context string is getting prepended
to every path in the document.  What was throwing me off a bit was the
default doc was just a redirect as:
--
<%...@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("login"); %>
--
The browser would show this as http://hostname/context/login. My
interpretation of the docs had me thinking that the context would get
stripped as well, but it wasn't.  Thus the confusion.

I have managed to get it working with the following:

BalancerMember ajp://prtltest01:8009/Portal route=tomcat1
loadfactor=50
BalancerMember ajp://prtltest02:8009/Portal route=tomcat2
loadfactor=50


ProxyPass /Portal/static !
ProxyPass /Portal balancer://mycluster
stickysession=JSESSIONID|jsessionid scolonpathdelim=On
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid
scolonpathdelim=On

Notice I don't have any ProxyPassReverse lines.  From reading the docs,
I'm not sure they are needed for AJP proxying.

I'm trying to keep the Tomcat side of things fairly simple -- pretty
much deploy the war direct from dev -- to keep there from being too many
steps that could get screwed up when I'm not around and someone else
needs to deploy.  The process will be documented, but some people refuse
to read directions correctly.

Plus, the apache server will someday host multiple apps under one host,
so having it work with the context as non-root now means less work
later.  Then again, I bf'ed and didn't put the static stuff in the
proper tree structure under the htdocs dir.  I just put them there as I
got them. (There is no "static" directory on the Tomcat side, it's
virtual.  The dev team is doing weird stuff with this new product.) 

Let me know if you see any problems with the above config.

Jeff

> -Original Message-
> From: Mark Eggers [mailto:its_toas...@yahoo.com]
> Sent: Thursday, November 04, 2010 11:56 AM
> To: Tomcat Users List
> Subject: Re: Is there a GOOD AJP-based cluster reference?
> 
> At the risk of violating your request (not to point you to the
> documentation),
> I'm going to point you at the documentation.
> 
> In particular: manual/mod/mod_proxy.html#proxypassreverse (from the
> Apache httpd
> docs)
> 
> This will rewrite response URLs. However, there is a caveat. It will
> not rewrite
> any absolute URLs within the documents served. So if you have
> /context/somewhere/someplace inside a particular page, this link will
> be
> returned intact and the user will not be able to reach it. Again
> according to
> the document, you'll need to look at Nick Kew's mod_proxy_html
> (http://apache.webthing.com/mod_proxy_html/). There appears to be a
> tutorial on
> reverse proxying at that location as well.
> 
> You may find it far easier to just rename the war file to ROOT.war and
> be done
> with it.
> 
> . . . . just my two cents
> 
> /mde/
> 
> 
> - Original Message 
> From: Jeffrey Janner 
> To: Tomcat Users List 
> Sent: Thu, November 4, 2010 6:56:20 AM
> Subject: Is there a GOOD AJP-based cluster reference?
> 
> I've googled and not found anything very helpful, particularly nothing
> recent.
> 
> 
> 
> I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat
> 6.0.29.
> 
> I'd like to route root to the Tomcat named context (not root).  From
> the
> docs I've read so far, I should be able to, but all the references in
> the returned html have the context name stuck at the beginning of the
> path, and I can't seem to get it to go away.
> 
> 
> 
> I know I can just rename the context as ROOT, but I thought I'd try
> deploying it the way the dev team gives it to me.
> 
> 
> 
> I've tried:
> 
>  ProxyPass / balancer://mycluster/context
> 
> 
> 
>  BalancerMember ajp://hostname:8009
> 
> 
> 
> and
> 
>  ProxyPass / balancer://mycluster
> 
> 
> 
>  BalancerMember ajp://hostname:8009/context
> 
> 
> 
> 
> 
> Nothing seems to be working.  Obviously, I'm not clear on some
concept.
> 
> Any help would be appreciated.
> 
> Jeff
> 
> 
> 
> p.s. Don't send me to the Tomcat & Apache docs, I've read them.
> 
> =
> Jeffrey W. Jannere-

RE: Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Jeffrey Janner
In looking at the JSPs, the dev team is coding all the paths inside a
 construct, which is why the context string is getting prepended
to every path in the document.  What was throwing me off a bit was the
default doc was just a redirect as:
--
<%...@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("login"); %>
--
The browser would show this as http://hostname/context/login. My
interpretation of the docs had me thinking that the context would get
stripped as well, but it wasn't.  Thus the confusion.

I have managed to get it working with the following:

BalancerMember ajp://prtltest01:8009/Portal route=tomcat1
loadfactor=50
BalancerMember ajp://prtltest02:8009/Portal route=tomcat2
loadfactor=50


ProxyPass /Portal/static !
ProxyPass /Portal balancer://mycluster
stickysession=JSESSIONID|jsessionid scolonpathdelim=On
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid
scolonpathdelim=On

Notice I don't have any ProxyPassReverse lines.  From reading the docs,
I'm not sure they are needed for AJP proxying.

I'm trying to keep the Tomcat side of things fairly simple -- pretty
much deploy the war direct from dev -- to keep there from being too many
steps that could get screwed up when I'm not around and someone else
needs to deploy.  The process will be documented, but some people refuse
to read directions correctly.

Plus, the apache server will someday host multiple apps under one host,
so having it work with the context as non-root now means less work
later.  Then again, I bf'ed and didn't put the static stuff in the
proper tree structure under the htdocs dir.  I just put them there as I
got them. (There is no "static" directory on the Tomcat side, it's
virtual.  The dev team is doing weird stuff with this new product.) 

Let me know if you see any problems with the above config.

Jeff

> -Original Message-
> From: Mark Eggers [mailto:its_toas...@yahoo.com]
> Sent: Thursday, November 04, 2010 11:56 AM
> To: Tomcat Users List
> Subject: Re: Is there a GOOD AJP-based cluster reference?
> 
> At the risk of violating your request (not to point you to the
> documentation),
> I'm going to point you at the documentation.
> 
> In particular: manual/mod/mod_proxy.html#proxypassreverse (from the
> Apache httpd
> docs)
> 
> This will rewrite response URLs. However, there is a caveat. It will
> not rewrite
> any absolute URLs within the documents served. So if you have
> /context/somewhere/someplace inside a particular page, this link will
> be
> returned intact and the user will not be able to reach it. Again
> according to
> the document, you'll need to look at Nick Kew's mod_proxy_html
> (http://apache.webthing.com/mod_proxy_html/). There appears to be a
> tutorial on
> reverse proxying at that location as well.
> 
> You may find it far easier to just rename the war file to ROOT.war and
> be done
> with it.
> 
> . . . . just my two cents
> 
> /mde/
> 
> 
> - Original Message 
> From: Jeffrey Janner 
> To: Tomcat Users List 
> Sent: Thu, November 4, 2010 6:56:20 AM
> Subject: Is there a GOOD AJP-based cluster reference?
> 
> I've googled and not found anything very helpful, particularly nothing
> recent.
> 
> 
> 
> I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat
> 6.0.29.
> 
> I'd like to route root to the Tomcat named context (not root).  From
> the
> docs I've read so far, I should be able to, but all the references in
> the returned html have the context name stuck at the beginning of the
> path, and I can't seem to get it to go away.
> 
> 
> 
> I know I can just rename the context as ROOT, but I thought I'd try
> deploying it the way the dev team gives it to me.
> 
> 
> 
> I've tried:
> 
>  ProxyPass / balancer://mycluster/context
> 
> 
> 
>  BalancerMember ajp://hostname:8009
> 
> 
> 
> and
> 
>  ProxyPass / balancer://mycluster
> 
> 
> 
>  BalancerMember ajp://hostname:8009/context
> 
> 
> 
> 
> 
> Nothing seems to be working.  Obviously, I'm not clear on some
concept.
> 
> Any help would be appreciated.
> 
> Jeff
> 
> 
> 
> p.s. Don't send me to the Tomcat & Apache docs, I've read them.
> 
> =
> Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
> 
> PolyDyne Software Inc.  web: http://www.polydyne.com/
> 
> 9390 Research Blvd.   phone: (512) 343-9100 x8930
> Building 1, Suite 400   fax: (512) 343-9297
> Austin, TX 78759
> =
> 
> 
> 
>
___
> ___
> 
> Confidentiality Notice:  This Transmission (including any attachments)
> may
> contain information that is privileged, confidential, 

RE: Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Jeffrey Janner
That's what I'm doing now Pid.
Not sure if that's helping much since it seemed to work the other way
round also.  Switching the order still showed the same apparent
behavior.
See my response to Mark Eggers about how I've got it working right now.
I'd love to get any more input from you if there is an issue on that
configuration.
Jeff

> -Original Message-
> From: Pid [mailto:p...@pidster.com]
> Sent: Thursday, November 04, 2010 1:25 PM
> To: Tomcat Users List
> Subject: Re: Is there a GOOD AJP-based cluster reference?
> 
> On 04/11/2010 14:56, Jeffrey Janner wrote:
> > p.s. Don't send me to the Tomcat & Apache docs, I've read them.
> 
> What happens if you define the balancer before you try to use it?
> 
> 
> 
> p
__

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: Secondary instance of Tomcat on single server does not process requests

2010-11-04 Thread Mark Eggers
>From the RUNNING.txt you will need tomcat-juli.jar in $CATALINA_BASE/bin.

That being said, I start up and shut down 4 Tomcat instances when I'm working 
on 
cluster issues. Here's a typical directory structure I use for each Tomcat 
that's a part of the cluster:

deimos-host/
├── bin
│   ├── setenv.sh
│   ├── shutdown.sh
│   ├── startup.sh
│   └── tomcat-juli.jar
├── conf
│   ├── Catalina
│   │   └── localhost
│   │   ├── host-manager.xml
│   │   ├── manager.xml
│   ├── catalina.policy
│   ├── catalina.properties
│   ├── context.xml
│   ├── logging.properties
│   ├── server.xml
│   ├── tomcat-users.xml
│   └── web.xml
├── lib
├── logs
├── temp
├── temp-dir
├── watch-dir
├── webapps
│   ├── docs
│   ├── manager
│   ├── ROOT
└── work

I've left out the actual web applications and permissions.

Here's my startup.sh script for the above host.

#!/bin/bash
export CATALINA_BASE=/someplace/deimos-host
export CATALINA_HOME=/reference-place/apache-tomcat-6.0.29
$CATALINA_HOME/bin/startup.sh

The shutdown.sh script is similar.

I have a bunch of environment variables in setenv.sh. They reference where 
log4j 
logs should go and enables JMX. Those aren't really important.

Finally, I start the entire cluster with the following script.

#!/bin/bash
( phobos-host/bin/startup.sh )
sleep 5
( deimos-host/bin/startup.sh )
sleep 5
( mars-host/bin/startup.sh )
sleep 5
( xerxes-host/bin/startup.sh )

The cluster shutdown script is similar.

There are a few things to note in the above script. The parentheses are 
necessary around each startup script. If you take a look at the stock 
startup.sh 
script in $CATALINA_HOME/bin, you'll find that the last line is:

exec "$PRGDIR"/"$EXECUTABLE" start "$@"

exec replaces the current shell. So if you write a script that tries to start 
multiple Tomcats, the first time you run the stock startup.sh script, your 
shell 
gets replaced.

I have sleep statements in my script since this is for a cluster and I don't 
define a port in the Receiver element of the cluster. This allows Tomcat to 
find 
open ports for cluster communication.

. . . . just my two cents

/mde/

- Original Message 
From: Ari King 
To: Tomcat Users List 
Sent: Thu, November 4, 2010 11:21:58 AM
Subject: Re: Secondary instance of Tomcat on single server does not process 
requests

On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
wrote:

> 2010/11/4 Ari King :
> > |-- conf
> > |-- server.xml
> > |-- web.xml
>
> Those two files are not sufficient.
>
> Note, that the conf folder is read only from the second instance.
> (The files in CATALINA_HOME\conf are never read).
>
>
Which other files are needed? I tried copying all the files from the conf
directory of the base configuration, but that didn't resolve the issue
either.

Also, I have changed the shutdown port from 8005 to 8006. Any other
ideas/suggestions? Thanks.





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



Re: Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Mark Thomas
On 04/11/2010 14:52, Nagulapalli, Srinivas wrote:
>  I appreciate any insights/pointers or help.

Look at the logs.

Mark



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



Difference in behavior between Tomcat 6.0.18 and 6.0.20

2010-11-04 Thread Nagulapalli, Srinivas
I can deploy an old Java web application to Tomcat 6.0.18 using (Java
JDK 1.5.0.22) fine.

However, get error deploying same application to Tomcat 6.0.20. Cannot
deploy to any Tomcat later either, like
all Tomcat 6.0.24, 6.0.26, 6.0.28 and 6.0.29 versions give me same error
message:

 "Error deploying configuration descriptor MyProject.xml"

 

 The application's web.xml uses web-app_2.3.dtd with following:

http://java.sun.com/dtd/web-app_2_3.dtd'>

 

 I noticed all sixteen jar files in %TOMCAT_HOME%\lib folder are
different between 6.0.18 and 6.0.20

 Not sure what change might be causing this.

 

 I appreciate any insights/pointers or help.

 

 Thanks much

 -Srini

 



This electronic message transmission contains information from the Company that 
may be proprietary, confidential and/or privileged. 
The information is intended only for the use of the individual(s) or entity 
named above.  If you are not the intended recipient, be 
aware that any disclosure, copying or distribution or use of the contents of 
this information is prohibited.  If you have received 
this electronic transmission in error, please notify the sender immediately by 
replying to the address listed in the "From:" field. 


Re: Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Pid
On 04/11/2010 14:56, Jeffrey Janner wrote:
> p.s. Don't send me to the Tomcat & Apache docs, I've read them.

What happens if you define the balancer before you try to use it?



p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Secondary instance of Tomcat on single server does not process requests

2010-11-04 Thread Ari King
On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
wrote:

> 2010/11/4 Ari King :
> > |-- conf
> > |-- server.xml
> > |-- web.xml
>
> Those two files are not sufficient.
>
> Note, that the conf folder is read only from the second instance.
> (The files in CATALINA_HOME\conf are never read).
>
>
Which other files are needed? I tried copying all the files from the conf
directory of the base configuration, but that didn't resolve the issue
either.

Also, I have changed the shutdown port from 8005 to 8006. Any other
ideas/suggestions? Thanks.


Re: connection Pooling in tomcat 6

2010-11-04 Thread Pid
On 04/11/2010 05:50, mike houston wrote:
> Hi..
> 
> Is there a framework for implementing database connection pooling in tomcat
> 6?
> I am migrating my application from tomcat 4 to 6. There is already a
> connection pooling implemented for the sql2000 server using the MS pool.exe
> framework. But now thats not quite compatible.
> 
> Please suggest.
> 
> Thanks,
> Mike
> 

http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html


Tomcat has Commons DBCP available out-of-the-box, configure a DataSource
and it just works.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: web.xml cant load because of

2010-11-04 Thread Pid
On 04/11/2010 16:06, Will Sumekar wrote:
> AFAIK if you dont specify contextConfigLocation system looks for default
> filename applicationContext.xml at default location of ./WEB-INF/. But it
> doesnt  matter cos even if I put context-param the error still comes.
> 
> So far it looks like the error is caused by . Once I remove it,
> it's OK. Which is really, really strange.
> 
> You can set tomcat to use log4j by putting log4j jar in /common/lib and
> log4j.properties in /common/classes. In case you want to try, also put
> commons logging jar in lib dir.

Make a simple test ServletContextListener impl and try to deploy with
just that in this Tomcat, see if it works.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


RE: filter order question

2010-11-04 Thread Aggarwal, Ajay
Thank you so much Konstantin for pointing to these specs!

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Thursday, November 04, 2010 12:35 PM
To: Tomcat Users List
Subject: Re: filter order question

2010/11/4 Aggarwal, Ajay :
> From reading the doc, it seems the filters are invoked in the order in
> which they appear in filter-mapping in web.xml. However I have a
> situation where I have 2 filters one mapped using  and
> other one mapped using  and they are not being invoked in
> the right order.
>

The spec specifies the order. Read chapter
 SRV.6.2.4 Configuration of Filters in a Web Application
of servlet-2_5-mrel2-spec.pdf

http://wiki.apache.org/tomcat/Specifications#Java_Servlet_Specifications

The spec says that the filters mapped with  are called
first. The ones mapped with  are called second.

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: Secondary instance of Tomcat on single server does not process requests

2010-11-04 Thread David kerber

On 11/4/2010 12:56 PM, Ari King wrote:

Hi all,

My secondary instance of Tomcat 6 does not process requests -- it simply
times out for everything. The only log is catalina.out and there are not
errors in it. Anyone know what could be wrong? I'm using Tomcat 6, Java
1.6.0_20, on Centos 5.5 Final.

I've set the secondary instance to use port 8081 for http and 8010 for AJP,
both have redirect ports of 8444.


...

What about the shutdown port?  POssible conflict there?


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



Re: Secondary instance of Tomcat on single server does not process requests

2010-11-04 Thread Konstantin Kolinko
2010/11/4 Ari King :
> |-- conf
>     |-- server.xml
>     |-- web.xml

Those two files are not sufficient.

Note, that the conf folder is read only from the second instance.
(The files in CATALINA_HOME\conf are never read).

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



Re: Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Mark Eggers
At the risk of violating your request (not to point you to the documentation), 
I'm going to point you at the documentation.

In particular: manual/mod/mod_proxy.html#proxypassreverse (from the Apache 
httpd 
docs)

This will rewrite response URLs. However, there is a caveat. It will not 
rewrite 
any absolute URLs within the documents served. So if you have 
/context/somewhere/someplace inside a particular page, this link will be 
returned intact and the user will not be able to reach it. Again according to 
the document, you'll need to look at Nick Kew's mod_proxy_html 
(http://apache.webthing.com/mod_proxy_html/). There appears to be a tutorial on 
reverse proxying at that location as well.

You may find it far easier to just rename the war file to ROOT.war and be done 
with it.

. . . . just my two cents

/mde/


- Original Message 
From: Jeffrey Janner 
To: Tomcat Users List 
Sent: Thu, November 4, 2010 6:56:20 AM
Subject: Is there a GOOD AJP-based cluster reference?

I've googled and not found anything very helpful, particularly nothing
recent.



I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat
6.0.29.

I'd like to route root to the Tomcat named context (not root).  From the
docs I've read so far, I should be able to, but all the references in
the returned html have the context name stuck at the beginning of the
path, and I can't seem to get it to go away.



I know I can just rename the context as ROOT, but I thought I'd try
deploying it the way the dev team gives it to me.



I've tried:

 ProxyPass / balancer://mycluster/context



 BalancerMember ajp://hostname:8009



and

 ProxyPass / balancer://mycluster



 BalancerMember ajp://hostname:8009/context





Nothing seems to be working.  Obviously, I'm not clear on some concept.

Any help would be appreciated.

Jeff



p.s. Don't send me to the Tomcat & Apache docs, I've read them.

=
Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
 
PolyDyne Software Inc.  web: http://www.polydyne.com/ 
 
9390 Research Blvd.   phone: (512) 343-9100 x8930
Building 1, Suite 400   fax: (512) 343-9297
Austin, TX 78759
=



__

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



Secondary instance of Tomcat on single server does not process requests

2010-11-04 Thread Ari King
Hi all,

My secondary instance of Tomcat 6 does not process requests -- it simply
times out for everything. The only log is catalina.out and there are not
errors in it. Anyone know what could be wrong? I'm using Tomcat 6, Java
1.6.0_20, on Centos 5.5 Final.

I've set the secondary instance to use port 8081 for http and 8010 for AJP,
both have redirect ports of 8444.

Below is the directory structure of the secondary instance:

/data/tomcat2
|-- bin
 |-- setenv.sh
 |-- catalina.sh
|-- conf
 |-- server.xml
 |-- web.xml
|-- logs
|-- temp
|-- webapps
|-- ROOT
|-- manager
|-- host-manager
|-- work

Following is the startup/shutdown/restart script I'm using:

#!/bin/sh

if [ "$CATALINA_BASE" = "" ]; then
export CATALINA_BASE=/data/tomcat2
fi

case "$1" in
'start')
. /data/tomcat2/bin/catalina.sh start
;;
'stop')
. /data/tomcat2/bin/catalina.sh stop
;;
'restart')
. /data/tomcat2/bin/catalina.sh stop
sleep 10
. /data/tomcat2/bin/catalina.sh start
;;
*)
echo "Usage: {start|stop|restart}"
;;
esac


Re: ISAPI-Problem

2010-11-04 Thread Jost Richstein

And here is whole response I receive, if I run into that error:

HTTP/1.1 500 Internal Server Error
Date: Thu, 04 Nov 2010 16:26:36 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Type: text/html

http://www.w3c.org/TR/REC-html40/loose.dtd";>

  ...deleted some Comments and style information...
Internal Server Error!

Internal Server Error!

The server encountered an internal error and was unable to complete your 
request.



Jakarta/ISAPI/isapi_redirector/1.2.30
 


Copyright © 1999-2010 Apache Software Foundation
All Rights Reserved

HTTP/1.1 200 OK
Date: Thu, 04 Nov 2010 16:21:59 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 4

true

The html-body contains the response I would expect. Because there is no 
"Content-Length"-Header or
"chunked encoding" or "Connection: close" or what ever, a browser is not able 
to determine when
the response has to be closed. I looks like the browser hangs - until a timeout 
is triggered.
Like I said before: the request before was a request with a "Content-Length: 
0"-Header (and no content)
and I suppose it has to do with the error afterwards.


 Original-Nachricht 
Betreff: Re: ISAPI-Problem
Von: Jost Richstein 
An: Tomcat Users List 
Datum: 03.11.2010 12:34




On 29.10.2010 09:18, Jost Richstein wrote:

On 27.10.2010 15:24, Jost Richstein wrote:

that is the log output with log level "info":


Double check: no other message betwen about 09:00 and the following line which is marked 
with "3076:4308]"?


No, I copied it directly from the log file. I have always these 5 lines of 
output grouped together.
However I have the same lines in that case at 09:04:05.


Rainer,

I checked the complete log file. There are no other messages for hours, except 
these group of entries.
IIS was restarted at 01:30. However it sometimes says "closing socket -1". 
Looks strange, because I
think "-1" is not a valid socket number:

jk_ajp_common.c (1490): (ajp13_internet) did not receive END_RESPONSE, closing 
socket -1

Could the problem be related to 
http://issues.apache.org/bugzilla/show_bug.cgi?id=49413 that
was fixed in version 1.2.31? Or other AJP fixes in Tomcat since version 5.5.27?

I see some responses to earlier requests just before the error occurs with 
"content-length=0",
what is correct in that situation, but could that cause the error afterwards?



[Fri Oct 29 09:04:15.312 2010] [3076:4308] [info]
ajp_service::jk_ajp_common.c (2540): (ajp13_internet) sending request to
tomcat failed (recoverable), because of server error (attempt=1)
[Fri Oct 29 09:04:15.483 2010] [3076:4308] [info]
ajp_send_request::jk_ajp_common.c (1490): (ajp13_internet) did not
receive END_RESPONSE, closing socket 1628
[Fri Oct 29 09:04:15.546 2010] [3076:4308] [info]
ajp_service::jk_ajp_common.c (2540): (ajp13_internet) sending request to
tomcat failed (recoverable), because of server error (attempt=2)
[Fri Oct 29 09:04:15.593 2010] [3076:4308] [error]
ajp_service::jk_ajp_common.c (2559): (ajp13_internet) connecting to
tomcat failed.
[Fri Oct 29 09:04:15.655 2010] [3076:4308] [error]
HttpExtensionProc::jk_isapi_plugin.c (2195): service() failed with http
error 500

I still have no other info, in particular no log entry in Tomcat or my
applications indicating an error in Tomcat or my apps.
The problem came in after we switched from Version 1.2.14 to 1.2.30 of
the redirector dll.


Regards,

Rainer


--
Jost Richstein
SoftDeCC Software GmbH
Email: jrichst...@softdecc.com
Tel.: +49 89 89 06 78 47
Fax.: +49 89 89 06 78 33

SoftDeCC Software GmbH; Gesellschaft mit beschränkter Haftung; Sitz der Gesellschaft: München; Registergericht: München, HRB 123667; 
Geschäftsführer: Ralf Malis, Georg Nüssel, Jost Richstein, Gerd Wilts



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



Re: filter order question

2010-11-04 Thread Konstantin Kolinko
2010/11/4 Aggarwal, Ajay :
> From reading the doc, it seems the filters are invoked in the order in
> which they appear in filter-mapping in web.xml. However I have a
> situation where I have 2 filters one mapped using  and
> other one mapped using  and they are not being invoked in
> the right order.
>

The spec specifies the order. Read chapter
 SRV.6.2.4 Configuration of Filters in a Web Application
of servlet-2_5-mrel2-spec.pdf

http://wiki.apache.org/tomcat/Specifications#Java_Servlet_Specifications

The spec says that the filters mapped with  are called
first. The ones mapped with  are called second.

Best regards,
Konstantin Kolinko

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



RE: filter order question

2010-11-04 Thread Rob Gregory
What was the URL of your request?


> -Original Message-
> From: Aggarwal, Ajay [mailto:ajay.aggar...@stratus.com]
> Sent: 04 November 2010 16:09
> To: Tomcat Users List
> Subject: filter order question
> 
> From reading the doc, it seems the filters are invoked in the order in
> which they appear in filter-mapping in web.xml. However I have a
> situation where I have 2 filters one mapped using  and
> other one mapped using  and they are not being invoked in
> the right order.
> 
> 
> 
> Below is how my filter mappings look
> 
>   
> 
>   
> 
> F1
> 
> MyServlet
> 
>   
> 
>   
> 
> F2
> 
> /foo/*
> 
>   
> 
> 
> 
> For my request, they both match and I would have expected the order as
> F1 --> F2. However they are being invoked in order F2 --> F1.
> 
> 
> 
> What am I doing wrong?
> 
> 
> 
> -Ajay
> 
> 


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



filter order question

2010-11-04 Thread Aggarwal, Ajay
>From reading the doc, it seems the filters are invoked in the order in
which they appear in filter-mapping in web.xml. However I have a
situation where I have 2 filters one mapped using  and
other one mapped using  and they are not being invoked in
the right order.

 

Below is how my filter mappings look

  

  

F1

MyServlet

  

  

F2

/foo/*

  

 

For my request, they both match and I would have expected the order as
F1 --> F2. However they are being invoked in order F2 --> F1.

 

What am I doing wrong?

 

-Ajay

 



RE: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Mikolaj Rydzewski


On Thu, 4 Nov 2010 10:37:25 -0500, "Propes, Barry L " 
 wrote:

Not sure if it matters or not, but in your   SponserSummaryDAO
method, it appears you establish the rs as null, but don't ever close
it? You might specifically try that.

And is it necessary to reassign all those variables (connection, rs,
pstmt) to null again in those catch blocks?


One more reason to use well designed utilities like commons-dbutils or 
jdbc-template.


--
Mikolaj Rydzewski 

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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sasidhar,

On 11/4/2010 8:34 AM, sasidhar prabhakar wrote:
> The class is fine but in log it is showing this one. Here everything closed
> fine.
> Then why it is showing like this
> 
> DBCP object created 2010-11-04 11:07:59 by the following code was never
> closed:

I have found that these exceptions can occur even when there is no leak.

Specifically, if your SQL query takes a long time to run (that is, more
than the ababdonedTimeout), another request to the connection pool
complains about the connection and calls it abandoned.

Technically speaking, the connection hasn't been leaked, but the
connection pool can't really guess the reason why the connection hasn't
been returned.

Can you time your queries to see how long they take? Could you post your
 configuration for your DataSource?

Another note: I notice that you are using a DataSource object that
survives for the life of the DAO object, and is even created by the
object in its constructor. I usually recommend that your code obtain the
DataSource from the JNDI context each time it needs it to improve
flexibility. You could also use dependency injection if that it your
preferred mechanism for obtaining (or being provided with) a DataSource.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzS09gACgkQ9CaO5/Lv0PCxQACdFcCek6dGip51q06YtaY6tJSF
PT8An32Xxfy+d63TkjEs5tPr8a+KT0BZ
=4smp
-END PGP SIGNATURE-

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



RE: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Propes, Barry L
Not sure if it matters or not, but in your   SponserSummaryDAO method, it 
appears you establish the rs as null, but don't ever close it? You might 
specifically try that.

And is it necessary to reassign all those variables (connection, rs, pstmt) to 
null again in those catch blocks?


-Original Message-
From: sasidhar prabhakar [mailto:sasidhar1...@gmail.com]
Sent: Thursday, November 04, 2010 7:05 AM
To: Tomcat Users List
Subject: Re: DBCP abandoned trace - unable to understand the leak

*
* @author oracle
*/
public class SponserSummaryDAO {
...


public SponserSummaryDAO(){
log.info("^Cretion of SponserSummaryDAO :
"+Calendar.getInstance().getTime().toString());
dataSource = ConnectionUtil.getDataSource(); }

public void updateClicks(int sid){
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try{
connection = dataSource.getConnection();

pstmt = connection.prepareStatement(updateClicksQuery);
pstmt.setInt(1, sid );
int updated = pstmt.executeUpdate();
log.info(" sponser clicks updated val : "+updated); }catch(Exception ex){ 
ex.printStackTrace(); log.error(ex.getMessage()); }finally{ try {if( pstmt != 
null)pstmt.close();} catch (SQLException ex) {ex.printStackTrace();} try {if( 
connection != null)connection.close();} catch (SQLException ex) 
{ex.printStackTrace();} connection = null; pstmt = null; } }

}

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



Re: web.xml cant load because of

2010-11-04 Thread Will Sumekar
AFAIK if you dont specify contextConfigLocation system looks for default
filename applicationContext.xml at default location of ./WEB-INF/. But it
doesnt  matter cos even if I put context-param the error still comes.

So far it looks like the error is caused by . Once I remove it,
it's OK. Which is really, really strange.

You can set tomcat to use log4j by putting log4j jar in /common/lib and
log4j.properties in /common/classes. In case you want to try, also put
commons logging jar in lib dir.


Cheers
Will

On Thu, Nov 4, 2010 at 8:19 PM, Konstantin Kolinko
wrote:

>
>
> AFAIK, you have to specify contextConfigLocation context parameter
> with location of your application context xml file.
>
> BTW, the log that you cited looks like generated by Log4j. That is not
> the default configuration.
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Is there a GOOD AJP-based cluster reference?

2010-11-04 Thread Jeffrey Janner
I've googled and not found anything very helpful, particularly nothing
recent.

 

I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat
6.0.29.

I'd like to route root to the Tomcat named context (not root).  From the
docs I've read so far, I should be able to, but all the references in
the returned html have the context name stuck at the beginning of the
path, and I can't seem to get it to go away.

 

I know I can just rename the context as ROOT, but I thought I'd try
deploying it the way the dev team gives it to me.

 

I've tried:

 ProxyPass / balancer://mycluster/context



 BalancerMember ajp://hostname:8009



and

 ProxyPass / balancer://mycluster



 BalancerMember ajp://hostname:8009/context



 

Nothing seems to be working.  Obviously, I'm not clear on some concept.

Any help would be appreciated.

Jeff

 

p.s. Don't send me to the Tomcat & Apache docs, I've read them.

=
Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com
 
PolyDyne Software Inc.  web: http://www.polydyne.com/
 
9390 Research Blvd.   phone: (512) 343-9100 x8930
Building 1, Suite 400   fax: (512) 343-9297
Austin, TX 78759
=

 

__

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.


RE: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Rob Gregory
Are you sure it is running against the code you think it is running
against. Try changing something that is output to the log files and make
sure you see this change before the abandoned  stack trace is thrown.

> -Original Message-
> From: sasidhar prabhakar [mailto:sasidhar1...@gmail.com]
> Sent: 04 November 2010 12:35
> To: Tomcat Users List
> Subject: Re: DBCP abandoned trace - unable to understand the leak
> 
> The class is fine but in log it is showing this one. Here everything
closed
> fine.
> Then why it is showing like this
> 
> DBCP object created 2010-11-04 11:07:59 by the following code was
never
> closed:
> java.lang.Exception
> at
>
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.
java:1
> 60)
> at
>
org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedOb
jectPo
> ol.java:86)
> at
>
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataS
ource.
> java:96)
> at
>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
e.java
> :880)
> *at SponserSummaryDAO.getCountryName(SponserSummaryDAO.java:304)
> at SponserSummaryBO.getCountryName(SponserSummaryBO.java:61)
> at SignUpAction.execute(SignUpAction.java:52)*
> at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocesso
> r.java:425)
> at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
228)
> at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
> at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFi
> lterChain.java:290)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChai
> n.java:206)
> at RedirectFilter.doFilter(RedirectFilter.java:56)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFi
> lterChain.java:235)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChai
> n.java:206)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java
> :233)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java
> :191)
> at
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.j
> ava:433)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:128)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:1
> 09)
> at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
93)
> at
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
9)
> at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11
> Protocol.java:583)
> at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
> at java.lang.Thread.run(Thread.java:595)
> 
> If anything else, what are the possible connection leaks may occur in
java.

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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread sasidhar prabhakar
The class is fine but in log it is showing this one. Here everything closed
fine.
Then why it is showing like this

DBCP object created 2010-11-04 11:07:59 by the following code was never
closed:
java.lang.Exception
at
org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:160)
at
org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:86)
at
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
*at SponserSummaryDAO.getCountryName(SponserSummaryDAO.java:304)
at SponserSummaryBO.getCountryName(SponserSummaryBO.java:61)
at SignUpAction.execute(SignUpAction.java:52)*
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at RedirectFilter.doFilter(RedirectFilter.java:56)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:595)

If anything else, what are the possible connection leaks may occur in java.


RE: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Rob Gregory
The full class looks ok to me. Your issues must be elsewhere.


> -Original Message-
> From: sasidhar prabhakar [mailto:sasidhar1...@gmail.com]
> Sent: 04 November 2010 12:05
> To: Tomcat Users List
> Subject: Re: DBCP abandoned trace - unable to understand the leak
> 
> The complete class has only two methods. And class is
> 
> 
> import connection.ConnectionUtil;
> import java.sql.Connection;
> import java.sql.PreparedStatement;
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.util.Calendar;
> import javax.sql.DataSource;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> 
> /**
> *
> * @author oracle
> */
> public class SponserSummaryDAO {
> 
> private Log log = LogFactory.getLog(SponserSummaryDAO.class);
> 
> private static final String updateClicksQuery = "update
sponser_summary set
> sp_sum_clicks = sp_sum_clicks + 1 where sp_sum_sid = ? and sp_sum_date
=
> trunc(sysdate)";
> private static final String getCityIdQuery = "select c_id from cities
where
> lower(c_name) like lower(?)";
> private static final String updateImpByCityQuery = " update
> sponser_summ_by_cities set sp_sum_c_imp = sp_sum_c_imp + 1 where
> sp_sum_c_sid = ? and lower(sp_sum_c_city) = ?";
> 
> private DataSource dataSource;
> 
> 
> public SponserSummaryDAO(){
> log.info("^Cretion of SponserSummaryDAO :
> "+Calendar.getInstance().getTime().toString());
> dataSource = ConnectionUtil.getDataSource();
> }
> 
> public void updateClicks(int sid){
> Connection connection = null;
> PreparedStatement pstmt = null;
> ResultSet rs = null;
> try{
> connection = dataSource.getConnection();
> 
> pstmt = connection.prepareStatement(updateClicksQuery);
> pstmt.setInt(1, sid );
> int updated = pstmt.executeUpdate();
> log.info(" sponser clicks updated val : "+updated);
> }catch(Exception ex){
> ex.printStackTrace();
> log.error(ex.getMessage());
> }finally{
> try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
> {ex.printStackTrace();}
> try {if( connection != null)connection.close();} catch (SQLException
ex)
> {ex.printStackTrace();}
> connection = null;
> pstmt = null;
> }
> }
> 
> public void updateImpByCity(int sid, String city){
> Connection connection = null;
> PreparedStatement pstmt = null;
> ResultSet rs = null;
> try{
> connection = dataSource.getConnection();
> 
> pstmt = connection.prepareStatement(updateImpByCityQuery);
> pstmt.setInt(1, sid );
> pstmt.setString(2, city.toLowerCase());
> int updated = pstmt.executeUpdate();
> log.info(" sponser imp by city updated val : "+updated);
> }catch(Exception ex){
> ex.printStackTrace();
> log.error(ex.getMessage());
> }finally{
> try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
> {ex.printStackTrace();}
> try {if( connection != null)connection.close();} catch (SQLException
ex)
> {ex.printStackTrace();}
> connection = null;
> pstmt = null;
> }
> }
> 
> 
> public String getCityId(String city){
> String cityID = null;
> Connection connection = null;
> PreparedStatement pstmt = null;
> ResultSet rs = null;
> try{
> connection = dataSource.getConnection();
> 
> pstmt = connection.prepareStatement(getCityIdQuery);
> pstmt.setString(1, "%"+city+"%");
> rs = pstmt.executeQuery();
> if( rs.next() ){
> cityID = rs.getString(1);
> }else{
> cityID = "-1";
> }
> log.info(" city ID : "+cityID);
> }catch(Exception ex){
> ex.printStackTrace();
> log.error(ex.getMessage());
> }finally{
> try{if( rs!=null)rs.close();}catch(SQLException
ex){ex.printStackTrace();}
> try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
> {ex.printStackTrace();}
> try {if( connection != null)connection.close();} catch (SQLException
ex)
> {ex.printStackTrace();}
> connection = null;
> pstmt = null;
> rs = null;
> }
> return cityID;
> }
> 
> public String getCountryName(long ipSum){
> String name = null;
> Connection connection = null;
> PreparedStatement pstmt = null;
> ResultSet rs = null;
> 
> try{
> connection = dataSource.getConnection();
> pstmt = connection.prepareStatement("select country_name from
ip_to_geo
> where ? between ip_from and ip_to");
> pstmt.setString(1, ""+ipSum);
> rs = pstmt.executeQuery();
> if( rs.next() ){
> name = rs.getString(1);
> }
> 
> }catch(Exception ex){
> ex.printStackTrace();
> }finally{
> try{if( rs!=null)rs.close();}catch(SQLException
ex){ex.printStackTrace();}
> try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
> {ex.printStackTrace();}
> try {if( connection != null)connection.close();} catch (SQLException
ex)
> {ex.printStackTrace();}
> connection = null;
> pstmt = null;
> rs = null;
> }
> 
> return name;
> 
> }
> 
> protected void finalize() throws Throwable {
> log.info("^Finalize of SponserSummaryDAO :
> "+Calendar.getInstance().getTime().toString());
> }
> 
> 
> }

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



Re: web.xml cant load because of

2010-11-04 Thread Konstantin Kolinko
2010/11/4 Will Sumekar :
> 
>
> org.springframework.web.context.ContextLoaderListener
>
> 

AFAIK, you have to specify contextConfigLocation context parameter
with location of your application context xml file.

BTW, the log that you cited looks like generated by Log4j. That is not
the default configuration.

Best regards,
Konstantin Kolinko

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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread sasidhar prabhakar
The complete class has only two methods. And class is


import connection.ConnectionUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
*
* @author oracle
*/
public class SponserSummaryDAO {

private Log log = LogFactory.getLog(SponserSummaryDAO.class);

private static final String updateClicksQuery = "update sponser_summary set
sp_sum_clicks = sp_sum_clicks + 1 where sp_sum_sid = ? and sp_sum_date =
trunc(sysdate)";
private static final String getCityIdQuery = "select c_id from cities where
lower(c_name) like lower(?)";
private static final String updateImpByCityQuery = " update
sponser_summ_by_cities set sp_sum_c_imp = sp_sum_c_imp + 1 where
sp_sum_c_sid = ? and lower(sp_sum_c_city) = ?";

private DataSource dataSource;


public SponserSummaryDAO(){
log.info("^Cretion of SponserSummaryDAO :
"+Calendar.getInstance().getTime().toString());
dataSource = ConnectionUtil.getDataSource();
}

public void updateClicks(int sid){
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try{
connection = dataSource.getConnection();

pstmt = connection.prepareStatement(updateClicksQuery);
pstmt.setInt(1, sid );
int updated = pstmt.executeUpdate();
log.info(" sponser clicks updated val : "+updated);
}catch(Exception ex){
ex.printStackTrace();
log.error(ex.getMessage());
}finally{
try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
{ex.printStackTrace();}
try {if( connection != null)connection.close();} catch (SQLException ex)
{ex.printStackTrace();}
connection = null;
pstmt = null;
}
}

public void updateImpByCity(int sid, String city){
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try{
connection = dataSource.getConnection();

pstmt = connection.prepareStatement(updateImpByCityQuery);
pstmt.setInt(1, sid );
pstmt.setString(2, city.toLowerCase());
int updated = pstmt.executeUpdate();
log.info(" sponser imp by city updated val : "+updated);
}catch(Exception ex){
ex.printStackTrace();
log.error(ex.getMessage());
}finally{
try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
{ex.printStackTrace();}
try {if( connection != null)connection.close();} catch (SQLException ex)
{ex.printStackTrace();}
connection = null;
pstmt = null;
}
}


public String getCityId(String city){
String cityID = null;
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try{
connection = dataSource.getConnection();

pstmt = connection.prepareStatement(getCityIdQuery);
pstmt.setString(1, "%"+city+"%");
rs = pstmt.executeQuery();
if( rs.next() ){
cityID = rs.getString(1);
}else{
cityID = "-1";
}
log.info(" city ID : "+cityID);
}catch(Exception ex){
ex.printStackTrace();
log.error(ex.getMessage());
}finally{
try{if( rs!=null)rs.close();}catch(SQLException ex){ex.printStackTrace();}
try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
{ex.printStackTrace();}
try {if( connection != null)connection.close();} catch (SQLException ex)
{ex.printStackTrace();}
connection = null;
pstmt = null;
rs = null;
}
return cityID;
}

public String getCountryName(long ipSum){
String name = null;
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;

try{
connection = dataSource.getConnection();
pstmt = connection.prepareStatement("select country_name from ip_to_geo
where ? between ip_from and ip_to");
pstmt.setString(1, ""+ipSum);
rs = pstmt.executeQuery();
if( rs.next() ){
name = rs.getString(1);
}

}catch(Exception ex){
ex.printStackTrace();
}finally{
try{if( rs!=null)rs.close();}catch(SQLException ex){ex.printStackTrace();}
try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
{ex.printStackTrace();}
try {if( connection != null)connection.close();} catch (SQLException ex)
{ex.printStackTrace();}
connection = null;
pstmt = null;
rs = null;
}

return name;

}

protected void finalize() throws Throwable {
log.info("^Finalize of SponserSummaryDAO :
"+Calendar.getInstance().getTime().toString());
}


}


RE: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Rob Gregory
The code you posted looks fine but without the complete class it is hard
to say 100% your class is fine. 

> -Original Message-
> From: sasidhar prabhakar [mailto:sasidhar1...@gmail.com]
> Sent: 04 November 2010 11:36
> To: Tomcat Users List
> Subject: Re: DBCP abandoned trace - unable to understand the leak
> 
> On Thu, Nov 4, 2010 at 4:24 PM, Mark Thomas  wrote:
> 
> > On 04/11/2010 05:01, sasidhar prabhakar wrote:
> > > Is abandoned trace really shows the code where the
> > > connection established and did not close it.
> > >>Yes.
> >
> 
>   The code I posted above is clean and properly closed all of
> resources.
> Is there any problem with the code shown above.
> 
> anybody help me to solve this problem.

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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread sasidhar prabhakar
On Thu, Nov 4, 2010 at 4:24 PM, Mark Thomas  wrote:

> On 04/11/2010 05:01, sasidhar prabhakar wrote:
> > Is abandoned trace really shows the code where the
> > connection established and did not close it.
> >>Yes.
>

  The code I posted above is clean and properly closed all of
resources.
Is there any problem with the code shown above.

anybody help me to solve this problem.


[OT] Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Peter Crowther
On 4 November 2010 10:54, Mark Thomas  wrote:

> On 04/11/2010 05:01, sasidhar prabhakar wrote:
> > I have one doubt.
> You have a question not a doubt
>
> I see this on many forums, and have come to realise it's associated with
speakers of at least one of the widely-used languages in India.  I've just
come to accept that "doubt" is the most obvious English translation of the
concept - though I agree with you that "question" is more understandable to
most English speakers.

To sasidhar prabhakar: if you don't mind me asking, what's your native
language and what's the word or phrase that you're translating as "doubt"?
When this comes up in forums, I'd like to be able to tell the poster that
"question" is probably a better English translation than "doubt", and I
would be able to do that more easily if I knew the original word or phrase
that you're translating.

- Peter


Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Mark Thomas
On 04/11/2010 05:01, sasidhar prabhakar wrote:
> Yes it is.
> 
> I have one doubt.
You have a question not a doubt and you have more than one of them.

> Is abandoned trace really shows the code where the
> connection established and did not close it.
Yes.

> Is remove abandoned, will close the connection after time out
Yes.

> and places it back to pool.
No. A brand new connection is created to replace the abandoned one.

> Is it really closes the connection?
Yes. Really.

> for example I configured pool with 200 connections. If 50 connections are
> leaked, now remove abandoned will places these 50 connections back to pool
> or pool left with 150 connections.
Neither. You will have a pool with 150 of the original connections plus
50 new connections to replace the ones that were abandoned.

Mark



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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread sasidhar prabhakar
Yes it is.

I have one doubt. Is abandoned trace really shows the code where the
connection established and did not close it.

Is remove abandoned, will close the connection after time out and places it
back to pool. Is it really closes the connection?

for example I configured pool with 200 connections. If 50 connections are
leaked, now remove abandoned will places these 50 connections back to pool
or pool left with 150 connections.

please clarify my doubts.


Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Mikolaj Rydzewski


On Thu, 4 Nov 2010 13:20:48 +0530, sasidhar prabhakar 
 wrote:

We are using struts and following DAO pattern.


Looks fine. Does the problem occur everytime?

--
Mikolaj Rydzewski 

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



Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread sasidhar prabhakar
We are using struts and following DAO pattern.

This is the code


public String getCountryName(long ipSum){
String name = null;
   Connection connection = null;
   PreparedStatement pstmt = null;
   ResultSet rs = null;

   try{
 connection = dataSource.getConnection();
 pstmt = connection.prepareStatement("select country_name from
ip_to_geo where ? between ip_from and ip_to");
 pstmt.setString(1, ""+ipSum);
 rs = pstmt.executeQuery();
 if( rs.next() ){
name = rs.getString(1);
 }

}catch(Exception ex){
   ex.printStackTrace();
}finally{
   try{if( rs!=null)rs.close();}catch(SQLException
ex){ex.printStackTrace();}
   try {if( pstmt != null)pstmt.close();} catch (SQLException ex)
{ex.printStackTrace();}
   try {if( connection != null)connection.close();} catch
(SQLException ex) {ex.printStackTrace();}
 connection = null;
 pstmt = null;
  rs = null;
 }

return name;

}


Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Mikolaj Rydzewski


On Thu, 4 Nov 2010 11:08:07 +0530, sasidhar prabhakar 
 wrote:



I didn't understand below, in DAO class everything fine.
Connection,PreparedStatement,ResultSet are all declared method local, 
and

closed properly.


Within finally clause?


Please guide me to solve the problem.


Please show us your code.

For small projects I found commons-dbutil very convenient. For larger 
ones, spring's JdbcTemplate is my choice.


--
Mikolaj Rydzewski 

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