Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 13 Mar 2013 18:19:57 -0000 Issue 11292

users-digest-help

2013-03-13


Author LoginPost Reply

users Digest 13 Mar 2013 18:19:57 -0000 Issue 11292

Topics (messages 240318 through 240338)

Re: Tomcat as a service: system tray?
 240318 by: Howard W. Smith, Jr.

Embedded Tomcat JavaDoc Not Complete
 240319 by: Nick Williams
 240320 by: Nick Williams
 240332 by: Christopher Schultz
 240338 by: Nick Williams

Re: Tomcat jdbc pool connection failover
 240321 by: Rainer Frey
 240322 by: André Warnier

No validationQueryTimeout in Tomcat7 tomcat-jdbc
 240323 by: Dunn, Rob
 240327 by: Daniel Mikusa
 240333 by: Christopher Schultz
 240337 by: Daniel Mikusa

Re: AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open
 240324 by: David Kumar
 240325 by: André Warnier
 240326 by: David Kumar

Re: tomcat 6.0.35 in production maintaince
 240328 by: fachhoch
 240329 by: Daniel Mikusa
 240330 by: fachhoch
 240331 by: Caldarale, Charles R
 240335 by: Christopher Schultz

Re: How to allow only TLS 1.1 connections to Tomcat (6.0) server with https ?
 240334 by: Ognjen Blagojevic

Re: Tomcat7 EL(proprietary evaluate) error
 240336 by: Christopher Schultz

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_240318.eml (zipped)
On Tue, Mar 12, 2013 at 12:42 PM, Sam Takoy <sam.takoy@(protected):

> Actually, I download the .zip version of Tomcat. I installed the service
> using the "service install" command. So now I'm wondering, given my current
> situation, how to activate the system tray option.
>
>
Since I'm running Windows Server 2008 (64 bit) as my development server and
Windows Server 2008 R2 (64 bit) as my production server, I decided to give
this a go.

1. Searched google for the following:

tomcat windows service system tray

2. The first search result in the list of search results was the following:

http://tomcat.apache.org/tomcat-7.0-doc/setup.html

3. Went to that page and read the following:


 - *Tray icon*: When Tomcat is run as a service, there will not be any
 tray icon present when Tomcat is running. Note that when choosing to run
 Tomcat at the end of installation, the tray icon will be used even if
 Tomcat was installed as a service.
 - Refer to the Windows Service
HOW-TO<http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html>
for
 information on how to manage Tomcat as a Windows service.


4. I didn't quite understand the first bulleted item above (at all; i'll be
waiting for someone to respond about my lack of understanding about that
first bulleted item above), so I proceeded to the Windows Service HOW-TO
page, since it was referenced in the second bulleted item

5. On the Windows Service HOW-TO page, it stated the following:

*Tomcat7w monitor application*

*Tomcat7w* is a GUI application for monitoring and configuring Tomcat
services.

The available command line options are:

//ES//Edit service configurationThis is the default operation. It is called
if the no option is provided but the executable is renamed to*
servicenameW.exe*//MS//Monitor servicePut the icon in the system try


6. All of that was so very understandable, that I decided to give it a try,
even though i have 'no' need for a system tray option, since I created a
shortcut to tomcat7w.exe and dragged the shortcut to the Start menu, and
that surely/definitely meets my requirements/needs! :)

7. Opened up a Command Prompt window, did a 'cd' (change directory) to
tomcat7/bin folder, and then did 'tomcat7w.exe //MS//', and immediately,
tomcat7w.exe shortcut/icon showed up in System Tray.

8. I've seen this mentioned on the list so many times, so it was very easy
to refer to documentation while having in mind, what others have
mentioned/recommended on this/tomcat user list. And the little typo 'try'
(instead of 'tray') did not 'prevent' me from following these instructions
in tomcat7 documentation and completing this very simple task to 'put the
icon in the system tray'.

9. Last but not least, I only download and use/install .zip file, too, and
install service via service install tomcat7.

10. please forgive my copy and pasting above from tomcat7 documentation
pages. this email was not sent as plain text, so i don't know how it will
be formatted after i click the Send button. :)

Attachment: users_240319.eml (zipped)
The JavaDoc for o.a.c.startup.Tomcat [1] is not complete. Importantly, it is lacking complete information about all three addWebapp classes. Ultimately, I want to create one giant JAR file with my classes, Tomcat classes, servlet classes, etc., with a com.mycompany.Bootstrap specified as the Main class in MANIFEST.MF. Here's (roughly) what I expect it to look like (though, if it should be different to make something work correctly, please correct me):

- MyEmbeddedWebApp.jar
  - com
    - mycompany
       - ...
  - javax
    - ...
  - META-INF
    - MANIFEST.MF
  - org
    - apache
       - ...
  - web
    - index.html
    - WEB-INF
       - web.xml

How do I correctly start up Tomcat so that my (lone) web app (MyEmbeddedWebApp.jar!/web/WEB-INF/web.xml) is correctly deployed to the root context (/) with index.html and etc. resources available?

[1] http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html

Attachment: users_240320.eml (zipped)

On Mar 12, 2013, at 10:47 PM, Nick Williams wrote:

> The JavaDoc for o.a.c.startup.Tomcat [1] is not complete. Importantly, it is lacking complete information about all three addWebapp classes. Ultimately, I want to create one giant JAR file with my classes, Tomcat classes, servlet classes, etc., with a com.mycompany.Bootstrap specified as the Main class in MANIFEST.MF. Here's (roughly) what I expect it to look like (though, if it should be different to make something work correctly, please correct me):
>
> - MyEmbeddedWebApp.jar
>   - com
>     - mycompany
>        - ...
>   - javax
>     - ...
>   - META-INF
>     - MANIFEST.MF
>   - org
>     - apache
>        - ...
>   - web
>     - index.html
>     - WEB-INF
>        - web.xml
>
> How do I correctly start up Tomcat so that my (lone) web app (MyEmbeddedWebApp.jar!/web/WEB-INF/web.xml) is correctly deployed to the root context (/) with index.html and etc. resources available?
>
> [1] http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html

By the way, com.mycompany.Bootstrap currently looks like the code below. It's the webAppDirLocation variable and addWebapp method call that I'm struggling with.

public class Bootstrap
{
  public static void main(String... arguments) throws Exception
  {
    String webAppDirLocation = "web/";
    Tomcat tomcat = new Tomcat();
    tomcat.setPort(8973);
    tomcat.addWebapp("/", new File(webAppDirLocation).getAbsolutePath());

    tomcat.start();
    tomcat.getServer().await();
  }
}

Attachment: users_240332.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Nick,

On 3/12/13 11:50 PM, Nick Williams wrote:
>
> On Mar 12, 2013, at 10:47 PM, Nick Williams wrote:
>
>> The JavaDoc for o.a.c.startup.Tomcat [1] is not complete.
>> Importantly, it is lacking complete information about all three
>> addWebapp classes.

You mean addWebapp methods? They seem fairly self-explanatory.

>> Ultimately, I want to create one giant JAR file with my classes,
>> Tomcat classes, servlet classes, etc., with a
>> com.mycompany.Bootstrap specified as the Main class in
>> MANIFEST.MF.

I think is called OSGi, right? I think this has been done before...

>> Here's (roughly) what I expect it to look like (though, if it
>> should be different to make something work correctly, please
>> correct me):
>>
>> - MyEmbeddedWebApp.jar - com - mycompany - ... - javax - ... -
>> META-INF - MANIFEST.MF - org - apache - ... - web - index.html -
>> WEB-INF - web.xml
>>
>> How do I correctly start up Tomcat so that my (lone) web app
>> (MyEmbeddedWebApp.jar!/web/WEB-INF/web.xml) is correctly deployed
>> to the root context (/) with index.html and etc. resources
>> available?
>>
>> [1]
>> http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html
>
>>
> By the way, com.mycompany.Bootstrap currently looks like the code
> below. It's the webAppDirLocation variable and addWebapp method
> call that I'm struggling with.
>
> public class Bootstrap { public static void main(String...
> arguments) throws Exception { String webAppDirLocation = "web/";
> Tomcat tomcat = new Tomcat(); tomcat.setPort(8973);
> tomcat.addWebapp("/", new
> File(webAppDirLocation).getAbsolutePath());

Tomcat.addWebapp(String,String) says that the first argument is the
context path. The context path for the ROOT webapp is "", not "/". The
second argument is a "baseDir" which says (via Context.setDocBase) it
can be an absolute pathname, a relative pathname (to the cwd I
suppose, or maybe relative to the hosts's appbase), or a URL. You are
passing a relative path name which probably won't resolve to a
resource "inside" the JAR file you are using. Try fetching a resource
URL for the "web/" path from the ClassLoader and pass that instead of
just "web/".

You didn't say what actually happens: just stated your requirements
and showed your code. Does Tomcat fail to start? Does it fail to
listen on your port? Does it fail to respond to requests?

> tomcat.start();

You should probably call tomcat.init() first, though some of the
Tomcat test cases don't do it so you're probably okay.

> tomcat.getServer().await(); } }

I don't think you configured any logging. You might want to set up
something to at least dump to the console, and crank-up the log level
to DEBUG or something like that. Then you might be able to see what
Tomcat is actually doing.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlFAsxUACgkQ9CaO5/Lv0PBWTgCgol+RqJweJQ9VOiyAVcpJsxDg
UoUAoI0AlgMh8IcJ2zm2lwDmzEDbovku
=Prjq
-----END PGP SIGNATURE-----


Attachment: users_240338.eml (zipped)
On Wed, Mar 13, 2013 at 12:10 PM, Christopher Schultz
<chris@(protected):
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Nick,
>
> On 3/12/13 11:50 PM, Nick Williams wrote:
>>
>> On Mar 12, 2013, at 10:47 PM, Nick Williams wrote:
>>
>>> The JavaDoc for o.a.c.startup.Tomcat [1] is not complete.
>>> Importantly, it is lacking complete information about all three
>>> addWebapp classes.
>
> You mean addWebapp methods? They seem fairly self-explanatory.

Yes. I meant addWebapp methods. That was a typo.

There are three of them. Only one is documented. Unfortunately, the
other two are not "self explanatory." I have no idea what the "url,"
"path," and "name" parameters are (although "host" makes sense). The
documentation for the lone method that IS documented only has
"contextPath" and "baseDir" ... that doesn't line up with the other
two methods.

>
>>> Ultimately, I want to create one giant JAR file with my classes,
>>> Tomcat classes, servlet classes, etc., with a
>>> com.mycompany.Bootstrap specified as the Main class in
>>> MANIFEST.MF.
>
> I think is called OSGi, right? I think this has been done before...

I don't know. Unfortunately, OSGi is kind of a new thing to me.

>
>>> Here's (roughly) what I expect it to look like (though, if it
>>> should be different to make something work correctly, please
>>> correct me):
>>>
>>> - MyEmbeddedWebApp.jar - com - mycompany - ... - javax - ... -
>>> META-INF - MANIFEST.MF - org - apache - ... - web - index.html -
>>> WEB-INF - web.xml
>>>
>>> How do I correctly start up Tomcat so that my (lone) web app
>>> (MyEmbeddedWebApp.jar!/web/WEB-INF/web.xml) is correctly deployed
>>> to the root context (/) with index.html and etc. resources
>>> available?
>>>
>>> [1]
>>> http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/startup/Tomcat.html
>>
>>>
>> By the way, com.mycompany.Bootstrap currently looks like the code
>> below. It's the webAppDirLocation variable and addWebapp method
>> call that I'm struggling with.
>>
>> public class Bootstrap { public static void main(String...
>> arguments) throws Exception { String webAppDirLocation = "web/";
>> Tomcat tomcat = new Tomcat(); tomcat.setPort(8973);
>> tomcat.addWebapp("/", new
>> File(webAppDirLocation).getAbsolutePath());
>
> Tomcat.addWebapp(String,String) says that the first argument is the
> context path. The context path for the ROOT webapp is "", not "/".

I didn't know this. I will change it. By the way, I got this code from
the tutorial at
https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat.

> The
> second argument is a "baseDir" which says (via Context.setDocBase) it
> can be an absolute pathname, a relative pathname (to the cwd I
> suppose, or maybe relative to the hosts's appbase), or a URL.

Well there's part of the problem with the documentation. The
documentation for the method says "Add a webapp using normal
WEB-INF/web.xml if found." and the documentation for the "baseDir"
parameter says nothing. There's no information here that would have
led me to look at the Context#setDocBase() method. Nada. I will try
out making it a URL.

> You are
> passing a relative path name which probably won't resolve to a
> resource "inside" the JAR file you are using. Try fetching a resource
> URL for the "web/" path from the ClassLoader and pass that instead of
> just "web/".

I will give this a try.

>
> You didn't say what actually happens: just stated your requirements
> and showed your code. Does Tomcat fail to start? Does it fail to
> listen on your port? Does it fail to respond to requests?

My bad. I'm always seeing y'all tell people to explain the problem,
and here I go not explaining the problem just like all the rest of
them. :-P ... When I ran the application using the batch file
generated by the mojo plugin, almost everything was good (Tomcat
started up, started listening on the right port, found all the classes
it was supposed to find, etc.). However, I got a "severe" error that
the web application directory (webAppDirLocation) did not exist and
the application could not be deployed. Understandable, since I didn't
know what to use for this.

>
>> tomcat.start();
>
> You should probably call tomcat.init() first, though some of the
> Tomcat test cases don't do it so you're probably okay.

Yea, the tutorial I was using didn't say anything about that.
Interesting that "init" and "start" are separate. If "init" was
required and "start" didn't call "init" I would think that "start"
would throw an IllegalStateException. Since it doesn't, my guess is
that calling "start" is sufficient, though I will certainly add
"init." I would love to now the semantic difference between "init" and
"start." The documentation just says "Initialize the server" and
"Start the server."

>
>> tomcat.getServer().await(); } }
>
> I don't think you configured any logging. You might want to set up
> something to at least dump to the console, and crank-up the log level
> to DEBUG or something like that. Then you might be able to see what
> Tomcat is actually doing.

It does seem to automatically dump to the console automatically. I got
plenty of messages, most of them good (listening on 8973, etc.). I
will look into logging more, of course. This was just a first pass at
proof-of-concept.

Since sending this email, I've discovered the "Executable WAR" [2]
capability of the Tomcat Maven plugin. I'm kind of confused about the
difference between Embedded Tomcat and Executable WAR. Which one do I
need? Will they both do what I need, but one might be better than the
other based on more exact requirements?

This may be premature (getting it working is my priority), but I
should mention that performance is important to what I'm doing here.
I'd like to enable the native code. Some applications and libraries
include native DLLs/SOs/JNILIBs in their JAR files, copy them to a
temporary directory at runtime and load them from the temporary
location (to avoid having to actually "install" the native libraries
in the OS or JVM directory structure). Is there a way to do this with
an embedded/executable Tomcat application so that the Tomcat classes
can take advantage of the native library?

[2] http://tomcat.apache.org/maven-plugin-2.1/executable-war-jar.html


Attachment: users_240321.eml (zipped)
On 12.03.2013, at 17:14, Christopher Schultz <chris@(protected):
> On 3/12/13 7:54 AM, amit shah wrote:
>> I am using Oracle. Oracle JDBC Driver provides the Oracle
>> Universal Connection Pool (UCP) which includes this
>> feature<http://docs.oracle.com/cd/E11882_01/java.112/e16548/fstconfo.htm>of
>>
>>
> connection failover but since we use tomcat jdbc connection pool we
>> cannot use UCP.
>
> Why not?

Because it would be two-level pooling?

>> Also UCP has lot of synchronized code which leads to blocking
>> threads and less concurrency support.
>>
>> Let me know your suggestions/thoughts.
>
> I'm thinking that a low-performance fail-over is preferable to a
> zero-performance non-fail-over.

Well, low overall performance, but possibility of failover in the hopefully rare case,
may not be acceptable compared to high(er) overall performance and a search for other ways
to perform failover.

Rainer

Attachment: users_240322.eml (zipped)
Rainer Frey wrote:
> On 12.03.2013, at 17:14, Christopher Schultz <chris@(protected):
>> On 3/12/13 7:54 AM, amit shah wrote:
>>> I am using Oracle. Oracle JDBC Driver provides the Oracle
>>> Universal Connection Pool (UCP) which includes this
>>> feature<http://docs.oracle.com/cd/E11882_01/java.112/e16548/fstconfo.htm>of
>>>
>>>
>> connection failover but since we use tomcat jdbc connection pool we
>>> cannot use UCP.
>> Why not?
>
> Because it would be two-level pooling?
>
>>> Also UCP has lot of synchronized code which leads to blocking
>>> threads and less concurrency support.
>>>
>>> Let me know your suggestions/thoughts.
>> I'm thinking that a low-performance fail-over is preferable to a
>> zero-performance non-fail-over.
>
> Well, low overall performance, but possibility of failover in the hopefully rare case,
> may not be acceptable compared to high(er) overall performance and a search for other ways
> to perform failover.
>

I am not sure that I totally follow the arguments here, but it seems that there exist
- a JDBC pool with good performance, but no fail-over
- a JDBC pool with failover, but bad performance
Why not move the problem one level higher, and instead of using one tomcat with several
pools, use several tomcats each with their own pool ?
Several tomcats can be configured as a "failover pool" of tomcats, no ?



Attachment: users_240323.eml (zipped)
Commons-dbcp 1.4 supports a validationQueryTimeout property.
The tomcat7 tomcat-jdbc connection pool (http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html) does not support this.
Has anyone found a way to configure a validation query timeout or achieve similar functionality to commons-dbcp-1.4 in tomcat 7's tomcat-jdbc connection pool?

I note that there is a QueryTimeoutInterceptor, which appears to apply to all query timeouts, but I'd like to have the validationQueryTimeout much shorter than the normal query timeout.

Many thanks

Rob Dunn | Senior Software Engineer - Australia | Transaction Network Services
Level 21, 300 Adelaide Street | Brisbane QLD 4000 | Australia
Office +61.7.3224.9731 | Fax +61.7.3224.1785 | Mobile +61.415.860.282
e-mail rdunn@tnsi.com<mailto:rdunn@(protected)/>
This message and any attachments are for the sole use of each intended recipient and may contain copyright, confidential and/or privileged information of Transaction Network Services Inc or its related companies ("TNS"). Any unauthorised review, use, disclosure or distribution is prohibited. If you are not an intended recipient, please immediately destroy all copies of the original message and let the sender know by reply e-mail. Unless otherwise expressly specified all views are those of the sender and not TNS.


Attachment: users_240327.eml (zipped)
On Mar 13, 2013, at 3:49 AM, Dunn, Rob wrote:

> Commons-dbcp 1.4 supports a validationQueryTimeout property.
> The tomcat7 tomcat-jdbc connection pool (https://urldefense.proofpoint.com/v1/url?u=http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=88a37d5288d99be5827fb4f5996596f17c7c19d4b190a18d1cfd1f891ad3ec57) does not support this.

Funny, I was just looking at the same thing yesterday.

> Has anyone found a way to configure a validation query timeout or achieve similar functionality to commons-dbcp-1.4 in tomcat 7's tomcat-jdbc connection pool?

I couldn't find an option, like with DBCP, to do this. My thought was to write a custom connection validator and use "validatorClassName" instead. Not the cleanest approach since I have to re-implement the validation logic, but it'll let me set the timeout.

>
> I note that there is a QueryTimeoutInterceptor, which appears to apply to all query timeouts, but I'd like to have the validationQueryTimeout much shorter than the normal query timeout.

I agree with you here. A separate timeout configuration would be nice. I suppose you could subclass the QueryTimeoutInterceptor and add some logic to set different timeouts for different queries, but that seems like a hack.

Dan


>
> Many thanks
>
> Rob Dunn | Senior Software Engineer - Australia | Transaction Network Services
> Level 21, 300 Adelaide Street | Brisbane QLD 4000 | Australia
> Office +61.7.3224.9731 | Fax +61.7.3224.1785 | Mobile +61.415.860.282
> e-mail rdunn@tnsi.com<mailto:rdunn@(protected)>
> This message and any attachments are for the sole use of each intended recipient and may contain copyright, confidential and/or privileged information of Transaction Network Services Inc or its related companies ("TNS"). Any unauthorised review, use, disclosure or distribution is prohibited. If you are not an intended recipient, please immediately destroy all copies of the original message and let the sender know by reply e-mail. Unless otherwise expressly specified all views are those of the sender and not TNS.
>


Attachment: users_240333.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dan,

On 3/13/13 10:12 AM, Daniel Mikusa wrote:
> On Mar 13, 2013, at 3:49 AM, Dunn, Rob wrote:
>
>> Commons-dbcp 1.4 supports a validationQueryTimeout property. The
>> tomcat7 tomcat-jdbc connection pool
>> (https://urldefense.proofpoint.com/v1/url?u=http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=88a37d5288d99be5827fb4f5996596f17c7c19d4b190a18d1cfd1f891ad3ec57)
>>
>>
does not support this.
>
> Funny, I was just looking at the same thing yesterday.
>
>> Has anyone found a way to configure a validation query timeout
>> or achieve similar functionality to commons-dbcp-1.4 in tomcat
>> 7's tomcat-jdbc connection pool?
>
> I couldn't find an option, like with DBCP, to do this. My thought
> was to write a custom connection validator and use
> "validatorClassName" instead. Not the cleanest approach since I
> have to re-implement the validation logic, but it'll let me set
> the timeout.

Seems like patching tomcat-pool would be a much easier solution. Care
to try your hand at a patch?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlFAtBAACgkQ9CaO5/Lv0PB4/wCfWfGXlEdAFXRRZpTEtGpVwMkF
gD0AoIeQB6z6ZsaS2YTpR5pqnve3cQ14
=GF1a
-----END PGP SIGNATURE-----


Attachment: users_240337.eml (zipped)
On Mar 13, 2013, at 1:14 PM, Christopher Schultz wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Dan,
>
> On 3/13/13 10:12 AM, Daniel Mikusa wrote:
>> On Mar 13, 2013, at 3:49 AM, Dunn, Rob wrote:
>>
>>> Commons-dbcp 1.4 supports a validationQueryTimeout property. The
>>> tomcat7 tomcat-jdbc connection pool
>>> (https://urldefense.proofpoint.com/v1/url?u=http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=8LKtd%2FtAZDTpwjGeWvVQiUwkyBqCv2FEneWpUZu8YLo%3D%0A&m=GVZLVYWRq7pdCsaexj2BhgF4WD6a2XE7cPmp2QLZqV8%3D%0A&s=88a37d5288d99be5827fb4f5996596f17c7c19d4b190a18d1cfd1f891ad3ec57)
>>>
>>>
> does not support this.
>>
>> Funny, I was just looking at the same thing yesterday.
>>
>>> Has anyone found a way to configure a validation query timeout
>>> or achieve similar functionality to commons-dbcp-1.4 in tomcat
>>> 7's tomcat-jdbc connection pool?
>>
>> I couldn't find an option, like with DBCP, to do this. My thought
>> was to write a custom connection validator and use
>> "validatorClassName" instead. Not the cleanest approach since I
>> have to re-implement the validation logic, but it'll let me set
>> the timeout.
>
> Seems like patching tomcat-pool would be a much easier solution. Care
> to try your hand at a patch?

Agreed. I'll give it a shot, seems simple enough.

Dan


>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEAREIAAYFAlFAtBAACgkQ9CaO5/Lv0PB4/wCfWfGXlEdAFXRRZpTEtGpVwMkF
> gD0AoIeQB6z6ZsaS2YTpR5pqnve3cQ14
> =GF1a
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)


Attachment: users_240324.eml (zipped)
Hey,

we just had that problem again. I did that GC trick, it didn't work out well.
I used:

set hosts [list]
lappend hosts {localhost:7008}
lappend hosts {localhost:9008}
# ...add as many as you want...

foreach {host} $hosts {
set parts [split $host ":"]
set hostname [lindex $parts 0]
set port [lindex $parts 1]

# for each host...

# Connect to it.
jmx_connect -h $hostname -p $port

# Invoke the garbage collector.
jmx_invoke -n -m java.lang:type=Memory gc

# Close this connection
jmx_close
}

I found that while googleing.
But it doesn't have any effect. Any other ideas?


Thanks....


Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

http://www.telestar.de/




-----Ursprüngliche Nachricht-----
Von: André Warnier [mailto:aw@(protected)]
Gesendet: Dienstag, 12. März 2013 09:54
An: Tomcat Users List
Betreff: Re: AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open

David Kumar wrote:
> Hey,
>
> we are still having that issue.
> But we could manage to figure out some more stuff.
> We made a Tomcat and Java update since that time we had our problem a few times again, also we did some reconfiguration with connectors etc.
> The last 2 times we where able to see, that both tomcat by them self where alive. Just ajp on both where dead. We couldn't make a connection either trough 7009 nor 9009. An with our openFiles trick we found a lot of close_wait again, e.g. 200 for 9009. I left the second tomcat on this state for a few ours just to see, what happens. The count of 200 connection with close_wait was kept until a reboot of the tomcat.

Instead of rebooting Tomcat, try to force the Tomcat JVM to do a Major Garbage Collection.
There are a number of tools that allow to do that.
One command-line one which I found practical is jmxsh, here :
http://code.google.com/p/jmxsh/

If when you do a Major GC, these CLOSE_WAIT connections disappear, you will have learned
something about their origin.
And if then - without restarting Tomcat - you can connect again via the AJP ports, you'll
have learned something else.

Go do it and report.


> I would say with some of our reconfiguration we managed to stop increasing connections. But still we are not sure why our ajp connections dying..
>
> Here is our connector out of Server.xml:
>
>   <Connector port="9009" protocol="AJP/1.3" redirectPort="9443" maxThreads="200" connectionTimeout="600000" />
>
>
> worker.properties:
>
> worker.tomcatX.host=localhost
> worker.tomcatX.type=ajp13
> worker.tomcatX.fail_on_status=404
> worker.tomcatX.lbfactor=1
> worker.tomcatX.ping_timeout=1000
> worker.tomcatX.ping_mode=A
> worker.tomcatX.socket_timeout=10
> worker.tomcatX.connection_pool_timeout=600
>
>
> worker.tomcat1.reference=worker.tomcatX
> worker.tomcat1.port=7009
>
> worker.tomcat2.reference=worker.tomcatX
> worker.tomcat2.port=9009
>
> worker.loadbalancer.type=lb
> worker.loadbalancer.balance_workers=tomcat1,tomcat2
>
> worker.status.type=status
>
> Hopefully one of you guys can give us a hint to fix that problem.
>
> Mit freundlichen Grüßen
> David Kumar
> Softwareentwickler, B. Sc.
> Abteilung Infotech - Interaktiv
> TELESTAR-DIGITAL GmbH
> Am Weiher 14
> D-56766 Ulmen
>
> http://www.telestar.de/
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: David Kumar [mailto:dkumar@(protected)]
> Gesendet: Dienstag, 22. Januar 2013 07:36
> An: Tomcat Users List
> Betreff: AW: AW: AW: ajp on 7009 and 9009 : connections keept open
>
> Hey,
>
> last friday I changed our configuration to use a executor.
> Here is what I did:
>
> <Connector port="7009" protocol="AJP/1.3" redirectPort="8443" maxThreads="200" executor="active-executor" />
> <Executor name="active-executor" namePrefix="activeThread-" maxThreads="200" minSpareThreads="30" maxIdleTime="60000" />
>   <Connector port="7080" protocol="HTTP/1.1"
>           connectionTimeout="20000"
>           redirectPort="8443" executor="active-executor" />
>
> The second tomcat has same configuration besides ports..
>
> Until yesterday it worked like a charm. But at late afternoon one of the tomcats failed again..
>
> I couldn't start the garbagecollection so far..
>
> Any other ideas?
>
> Thanks
>
> Mit freundlichen Grüßen
> David Kumar
> Softwareentwickler, B. Sc.
> Abteilung Infotech - Interaktiv
> TELESTAR-DIGITAL GmbH
> Am Weiher 14
> D-56766 Ulmen
> http://www.telestar.de/
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: David Kumar [mailto:dkumar@(protected)]
> Gesendet: Freitag, 18. Januar 2013 11:19
> An: Tomcat Users List; Tomcat Users List
> Betreff: AW: AW: AW: ( ajp on 7009 and 9009 not afs3-rmtsys): connections keept open
>
> Hey,
>
> I do that at next deployment. --> I Thursday...
>
> So far I'm trying executor for tomcat. As far I read, when I'm using connectors idle process are forced to be close..
>
>
> Mit freundlichen Grüßen
> David Kumar
> Softwareentwickler, B. Sc.
> Abteilung Infotech - Interaktiv
> TELESTAR-DIGITAL GmbH
> Am Weiher 14
> D-56766 Ulmen
>
> http://www.telestar.de/
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: André Warnier [mailto:aw@(protected)]
> Gesendet: Freitag, 18. Januar 2013 11:10
> An: Tomcat Users List
> Betreff: Re: AW: AW: ( ajp on 7009 and 9009 not afs3-rmtsys): connections keept open
>
> David Kumar wrote:
>> Hey André,
>>
>> are you talking about running System.gc()?
> Yes.
>
>> That should be possible..
>>
>> Mit freundlichen Grüßen
>> David Kumar
>> Softwareentwickler, B. Sc.
>> Abteilung Infotech - Interaktiv
>> TELESTAR-DIGITAL GmbH
>> Am Weiher 14
>> D-56766 Ulmen
>>
>> http://www.telestar.de/
>>
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: André Warnier [mailto:aw@(protected)]
>> Gesendet: Freitag, 18. Januar 2013 10:07
>> An: Tomcat Users List
>> Betreff: Re: AW: ( ajp on 7009 and 9009 not afs3-rmtsys): connections keept open
>>
>> David,
>>  (and sorry for top-posting here)
>>
>> just to verify something.
>> Can you trigger a Major Garbage Collection at the Tomcat JVM level, at a moment when you
>> have all these connections in CLOSE_WAIT, and see if they disappear after the GC ?
>>
>> If yes, it may give a good clue about where all these CLOSE_WAITs are coming from.
>>
>>
>> David Kumar wrote:
>>> Just read this email.. :-)
>>>
>>> I figured out we are not using executor connector...
>>>
>>>
>>> Mit freundlichen Grüßen
>>> David Kumar
>>> Softwareentwickler, B. Sc.
>>> Abteilung Infotech - Interaktiv
>>> TELESTAR-DIGITAL GmbH
>>> Am Weiher 14
>>> D-56766 Ulmen
>>> http://www.telestar.de/
>>>
>>>
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: David Kumar [mailto:dkumar@(protected)]
>>> Gesendet: Freitag, 18. Januar 2013 09:11
>>> An: Tomcat Users List
>>> Betreff: AW: ( ajp on 7009 and 9009 not afs3-rmtsys): connections keept open
>>>
>>> here you are with attachment :-)
>>>
>>>
>>> btw: in mod_jk.log I found some
>>> [Thu Jan 17 23:00:08 2013] [11196:140336689317632] [error] ajp_get_reply::jk_ajp_common.c (2055): (tomcat2) Tomcat is down or refused connection. No response has been sent to the client (yet)
>>> [Thu Jan 17 23:00:08 2013] [11196:140336689317632] [error] ajp_service::jk_ajp_common.c (2559): (tomcat2) connecting to tomcat failed.
>>>
>>>
>>> but realy just a few one...
>>>
>>>
>>> Mit freundlichen Grüßen
>>> David Kumar
>>> Softwareentwickler, B. Sc.
>>> Abteilung Infotech - Interaktiv
>>> TELESTAR-DIGITAL GmbH
>>> Am Weiher 14
>>> D-56766 Ulmen
>>>
>>> http://www.telestar.de/
>>>
>>>
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: David Kumar
>>> Gesendet: Freitag, 18. Januar 2013 09:08
>>> An: 'Tomcat Users List'
>>> Betreff: ( ajp on 7009 and 9009 not afs3-rmtsys): connections keept open
>>>
>>> Hey,
>>>
>>> thanks for reply. I got that about the Apache configuration. Since we had our problem yesterday, again and there was no error at the apache logs I'm willing to say that is not the main problem and I have to check that, when my main problem is solved.. :-)
>>>
>>>
>>>
>>> I agree with you about wrong reporting of service. Its just shown up as afs3 because these service uses 7009 per default. But I'm using 7009 and 9009 for ajp.
>>>
>>>
>>> So doesn't this mean there is a connection problems between my Apache and the tomcats?
>>>
>>> You're right, both Webapps doing the same and are configured identically besides the ports.
>>>
>>> I'm using more than one database, but all of them are used through a database pool. If there is a bug, I think I should have found some error at my logs like no free connection or something like that. As there is no such log entry I'm willing to say that my database connections processing like they should.
>>>
>>> Basically on each tomcat there are running two services. One is a axis2 project. Our CRM is posting customer data to this webapp. This data will be persisted into a database. Depending on the information given by our CRM axis sends a email.
>>>
>>> The second one is basically a cache for our websites. We have a PIM with all our product data. These app is gathering all the data from PIM and a CMS and is merging these information together so that the data can be displayed.
>>> All the mentioned data is hold in different "cache objects". Also some communication with our ERP and some databases are made trough this app.
>>>
>>> The second app is a REST service. Information will be posted as POST or GET request to it. Most likely the responses are JSON Object.
>>>
>>> When ever one webApp is reloading (automatically or manually) itself, the result will be posted to the other tomcat/webapp as a serialized object, so the other on do not need to reload it self.
>>>
>>> I can't say how many SMB files there are, it is depending on some other stuff so it is dynamic.
>>>
>>> Attached you can find a printed list by lsof.
>>>
>>> There you can see a really strange thing. Yesterday just tomcat2 had the problem with to many open files. A few days before it was just tomcat1 having this problem.
>>>
>>> Now let my answer your question:
>>>
>>> 1. That is hard to say, I guess I have to do some more investigation on our logfiles.
>>>
>>> 2. / 3. Here is my httpd.conf:
>>> <IfModule mpm_worker_module>
>>>  ThreadLimit       25      
>>>  StartServers       2
>>>  MaxClients       150
>>>  MinSpareThreads    25
>>>  MaxSpareThreads    75
>>>  ThreadsPerChild    25
>>>  MaxRequestsPerChild  4000
>>> </IfModule>
>>>
>>> we are using worker ....
>>>
>>> And here are our tomcat connectors again:
>>> tomcat1:
>>>
>>> <Connector port="7080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
>>>
>>>
>>> <Connector port="7009" protocol="AJP/1.3" redirectPort="8443"/>
>>>
>>>
>>> tomcat2:
>>>    <Connector port="9080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9443"/>
>>>
>>> <Connector port="9009" protocol="AJP/1.3" redirectPort="9443"/>
>>>
>>>
>>> Okay we are not using executor.. I will check that..
>>>
>>> You probably read my copy-paste error. I did copy some comments out of out server config --> Sry again.
>>>
>>> 4. we are using..
>>> 5. via a multipart message sending to the other tomcat.
>>> 6. I don't think so also because of that the connections are kept open on our ajp ports.
>>>
>>> I know that "CLOSE_WAIT" means, waiting for connections to be closed, but wondering that it is not closing..
>>>
>>>
>>> Thanks again
>>>
>>> Mit freundlichen Grüßen
>>> David Kumar
>>> Softwareentwickler, B. Sc.
>>> Abteilung Infotech - Interaktiv
>>> TELESTAR-DIGITAL GmbH
>>> Am Weiher 14
>>> D-56766 Ulmen
>>> http://www.telestar.de/
>>>
>>>
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Christopher Schultz [mailto:chris@(protected)]
>>> Gesendet: Donnerstag, 17. Januar 2013 18:38
>>> An: Tomcat Users List
>>> Betreff: Re: AW: AW: afs3-rmtsys: connections keept open
>>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA256
>>>
>>> David,
>>>
>>> On 1/17/13 1:49 AM, David Kumar wrote:
>>>> I just checked /var/logs/apache2/error.logs. And found following
>>>> errors:
>>>>
>>>> [Wed Jan 16 15:14:46 2013] [error] server is within MinSpareThreads
>>>> of MaxClients, consider raising the MaxClients setting [Wed Jan 16
>>>> 15:14:56 2013] [error] server reached MaxClients setting, consider
>>>> raising the MaxClients setting
>>> So you are maxing-out your connections: you are experiencing enough
>>> load that your configuration cannot handle any more connections:
>>> requests are being queued by the TCP/IP stack and some requests may be
>>> rejected entirely depending upon the queue length of the socket.
>>>
>>> The first question to ask yourself is whether or not your hardware can
>>> take more than you have it configured to accept. For instance, if your
>>> load average, memory usage, and response time are all reasonable, then
>>> you could probably afford to raise your MaxClients setting in httpd.
>>>
>>> Note that the above has almost nothing to do with Tomcat: it only has
>>> to do with Apache httpd.
>>>
>>>> Yesterday my problem occurred about the same time.
>>> So, the problem is that Tomcat cannot handle your peak load due to a
>>> file handle limitation. IIRC, your current file handle limit for the
>>> Tomcat process is 4096.
>>>
>>>> I'm checking every five minutes how many open files there are:
>>>>
>>>> count open files started: 01-16-2013_15:10: Count: 775 count open
>>>> files started: 01-16-2013_15:15: Count: 1092
>>> Okay. lsof will help you determine how many of those are "real" files
>>> versus sockets. Limiting socket usage might be somewhat easier
>>> depending upon what your application actually does.
>>>
>>>> But maybe the afs3 connection causing the Apache error?
>>> afs3 is a red herring: you are using port 7009 for AJP communication
>>> between httpd and Tomcat and it's being reported as afs3. This has
>>> nothing to do with afs3 unless you know for a fact that your web
>>> application uses that protocol for something. I don't see any evidence
>>> that afs3 is related to your environment in the slightest. I do see
>>> every indication that you are using port 7009 yourself for AJP so
>>> let's assume that's the truth.
>>>
>>> Let's recap what your webapp(s) actually do to see if we can't figure
>>> out where all your file handles are being used. I'll assume that each
>>> Tomcat is configured (reasonably) identically, other than port numbers
>>> and such. I'll also assume that you are running the same webapp using
>>> the same (virtually) identical configuration and that nothing
>>> pathological is happening (like one process totally going crazy and
>>> making thousands of socket connections due to an application bug).
>>>
>>> First, all processes need access to stdin, stdout, stderr: that's 3
>>> file handles. Plus all shared libraries required to get the process
>>> and JVM started. Plus everything Java needs. Depending on the OS,
>>> that's about 30 or so to begin with. Then, Tomcat uses /dev/random (or
>>> /dev/urandom) plus it needs to load all of its own libraries from JAR
>>> files. There are about 25 of them, and they generally stay open. So,
>>> we're up to about 55 file handles. Don't worry: we won't be counting
>>> these things one-at-a-time for long. Next, Tomcat has two <Connector>s
>>> defined with default connection sizes. At peak load, they will both be
>>> maxed-out at 200 connections each for a total of 402 file handles (1
>>> bind file handle + 200 file handles for the connections * 2
>>> connectors). So, we're up to 457.
>>>
>>> Now, onto your web application. You have to count the number of JAR
>>> files that your web application provides: each one of those likely
>>> consumes another file handle that will stay open. Does your webapp use
>>> a database? If so, do you use a connection pool? How big is the
>>> connection pool? Do you have any leaks? If you use a connection pool
>>> and have no leaks, then you can add 'maxActive' file handles to our
>>> running count. If you don't use a connection pool, then you can add
>>> 400 file handles to your count, because any incoming request on either
>>> of those two connectors could result in a database connection. (I
>>> highly recommend using a connection pool if you aren't already).
>>>
>>> Next, you said this:
>>>
>>>> Both of the tomcats are "synchronising" them self. The send some
>>>> serialized objects via http to each other.
>>> So the webapps make requests to each other? How? Is there a limit to
>>> the number of connections directly from one Tomcat to another? If not,
>>> then you can add another 400 file handles because any incoming
>>> connection could trigger an HTTP connection to the other Tomcat. (What
>>> happens if an incoming client connection causes a connection to the
>>> other Tomcat... will that Tomcat ever call-back to the first one and
>>> set-up a communication storm?).
>>>
>>>> And both of them getting some file from SMB shares.
>>> How many files? Every file you open consumes a file handle. If you
>>> close the file, you can reduce your fd footprint, but if you keep lots
>>> of files open...
>>>
>>> If you have a dbcp with size=50 and you limit your cross-Tomcat
>>> connections to, say another 50 and your webapp uses 50 JAR files then
>>> you are looking at 600 or so file handles required to run your webapp
>>> under peak load, not including files that must be opened to satisfy a
>>> particular request.
>>>
>>> So the question is: where are all your fds going? Use lsof to
>>> determine what they are being used for.
>>>
>>> Some suggestions:
>>>
>>> 1. Consider the number of connections you actually need to be able to
>>> handle: for both connectors. Maybe you don't need 200 possible
>>> connections for your HTTP connector.
>>>
>>> 2. Make sure your MaxClients in httpd matches make sense with what
>>> you've got in Tomcat's AJP connector: you want to make sure that you
>>> have enough connections available from httpd->Tomcat that you aren't
>>> making users wait. If you're using prefork MPM that means that
>>> MaxClients should be the same as your <Connector>'s maxThreads setting
>>> (or, better yet, use an <Executor>).
>>>
>>> 3. Use an <Executor>. Right now, you might allocate up to 400 threads
>>> to handle connections from both AJP and HTTP. Maybe you don't need
>>> that. You can share request-processing threads by using an <Executor>
>>> and have both connectors share the same pool.
>>>
>>> 4. Use a DBCP. Just in case you aren't.
>>>
>>> 5. Check to see how you are communicating Tomcat-to-Tomcat: you may
>>> have a problem where too many connections are being opened.
>>>
>>> 6. Check to make sure you don't have any resource leaks: JDBC
>>> connections that aren't closed, files not being closed, etc. etc.
>>> Check to make sure you are closing files that don't need to be open
>>> after they are read.
>>>
>>>> But I can't imagine that might be the problem? I'm wondering why
>>>> the tcp connections with state "CLOSE_WAIT" doesn't get closed.
>>> http://en.wikipedia.org/wiki/Transmission_Control_Protocol
>>>
>>> - -chris
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
>>> Comment: GPGTools - http://gpgtools.org
>>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>>
>>> iEYEAREIAAYFAlD4NvsACgkQ9CaO5/Lv0PC4EACfURhDENZPf28HDIazwPqAqri5
>>> KqYAni9AOSQZVIdsBtQLoEfDcYkpuf7f
>>> =dEDY
>>> -----END PGP SIGNATURE-----
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_240325.eml (zipped)
David Kumar wrote:
> Hey,
>
> we just had that problem again. I did that GC trick, it didn't work out well.
> I used:
>
> set hosts [list]
> lappend hosts {localhost:7008}
> lappend hosts {localhost:9008}
> # ...add as many as you want...
>
> foreach {host} $hosts {
>  set parts [split $host ":"]
>  set hostname [lindex $parts 0]
>  set port [lindex $parts 1]
>
>  # for each host...
>
>  # Connect to it.
>  jmx_connect -h $hostname -p $port
>
>  # Invoke the garbage collector.
>  jmx_invoke -n -m java.lang:type=Memory gc
>
>  # Close this connection
>  jmx_close
> }
>
> I found that while googleing.
> But it doesn't have any effect. Any other ideas?
>

Did it really connect with the Tomcat JVM and really do anything ?
Is your JVM started with options that allow JMX interaction ?
Also, there are ways to start the JVM with parameters telling it to log the Garbage
Collections to a logfile. Make sure that you do that, and check the logfile to see if it
really does a GC when you ask it to.

Note that there are also other ways to trogger a GC than using jmxsh. I was only pointing
you to that tool as an easy-to-script, non-GUI tool.
But in your java directory (at least the JDK/bin), there should also be a "jconsole"
program which allows you to do pretty much the same interactively with a GUI.



Attachment: users_240326.eml (zipped)
Hey,


I'm really not sure if that tool does anything, because there is no feedback..
Funny: Just a few minutes ago a colleague showed ma a tool called something like VM monitor on his mac. It look a kind of similar to jconsole.exe. Next time I will try to make GC with this tool.
Meanwhile I reduced the connectionTimeout, reconfigured maxClients and added -DisableReuse to jkpropertys.

Lets see what happens...


Thanks a lot..


Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

http://www.telestar.de/




-----Ursprüngliche Nachricht-----
Von: André Warnier [mailto:aw@(protected)]
Gesendet: Mittwoch, 13. März 2013 12:20
An: Tomcat Users List
Betreff: Re: AW: AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open

David Kumar wrote:
> Hey,
>
> we just had that problem again. I did that GC trick, it didn't work out well.
> I used:
>
> set hosts [list]
> lappend hosts {localhost:7008}
> lappend hosts {localhost:9008}
> # ...add as many as you want...
>
> foreach {host} $hosts {
>  set parts [split $host ":"]
>  set hostname [lindex $parts 0]
>  set port [lindex $parts 1]
>
>  # for each host...
>
>  # Connect to it.
>  jmx_connect -h $hostname -p $port
>
>  # Invoke the garbage collector.
>  jmx_invoke -n -m java.lang:type=Memory gc
>
>  # Close this connection
>  jmx_close
> }
>
> I found that while googleing.
> But it doesn't have any effect. Any other ideas?
>

Did it really connect with the Tomcat JVM and really do anything ?
Is your JVM started with options that allow JMX interaction ?
Also, there are ways to start the JVM with parameters telling it to log the Garbage
Collections to a logfile. Make sure that you do that, and check the logfile to see if it
really does a GC when you ask it to.

Note that there are also other ways to trogger a GC than using jmxsh. I was only pointing
you to that tool as an easy-to-script, non-GUI tool.
But in your java directory (at least the JDK/bin), there should also be a "jconsole"
program which allows you to do pretty much the same interactively with a GUI.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_240328.eml (zipped)
Will connecting jconsole to my prod env will it cause any performance issues
?





I connected jconsole to my server running in training env. Not many user
were using my app are when I connected.

I looked at activeSession whihc is in
Manager/myapp/localhost/attributes/activeSession

The value was 95 , I am sure not 95 users are using my app , its only me
and one more guy logged in   also logs say the same. How come I have 95
sessions , I can list session Ids but I donot see anything more about that
session , can I check the size of a session ? and objects in the session?

memory tab shows me how much is available ? etc but any pattern of the
graph whihc says I have memory problems?








--
Sent from the Tomcat - User mailing list archive at Nabble.com.


Attachment: users_240329.eml (zipped)
On Mar 13, 2013, at 11:30 AM, fachhoch wrote:

> Will connecting jconsole to my prod env will it cause any performance issues
> ?

Connecting with jconsole shouldn't cause any problems.

> I connected jconsole to my server running in training env. Not many user
> were using my app are when I connected.
>
> I looked at activeSession whihc is in
> Manager/myapp/localhost/attributes/activeSession
>
> The value was 95 , I am sure not 95 users are using my app , its only me
> and one more guy logged in   also logs say the same. How come I have 95
> sessions ,

Hard to say exactly. Perhaps your session expiration time is large and sessions are not being removed as quickly as you would expect.

> I can list session Ids but I donot see anything more about that
> session , can I check the size of a session ? and objects in the session?

Do you have the Manager app installed?  This is probably the easiest way to look at your sessions.

> memory tab shows me how much is available ? etc but any pattern of the
> graph whihc says I have memory problems?

Not exactly sure what you are asking here, but in general if you have a memory leak the graph will trend upwards. In other words, the amount of memory in use will increase over time.

Dan


Attachment: users_240330.eml (zipped)
Hard to say exactly. Perhaps your session expiration time is large and
sessions are not being removed as quickly as you would expect.

how can I figure this out ?, I am did not make any setting for session
timeout ,except for browser activity  where to check session expiration
configration?

are there any suggested ways to use threadlocal when deployed in tomcat ? I
am using thread local as advised in any tutorial,   any special care must
be taken  with threadlocal for tomcat ?


I dont have manager app , I just have my application I removed all others
apps from tomcat.






--
Sent from the Tomcat - User mailing list archive at Nabble.com.


Attachment: users_240331.eml (zipped)
> From: fachhoch [mailto:fachhoch@(protected)]
> Subject: Re: tomcat 6.0.35 in production maintaince

> how can I figure this out ?

Use the manager app, as suggested.

> are there any suggested ways to use threadlocal when deployed in tomcat ?

Using ThreadLocal when the threads belong to a pool is rather tricky, and often leads to memory leaks. Try to avoid it, if possible.

> I dont have manager app , I just have my application I removed all others
> apps from tomcat.

So put it back in.

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





--
Sent from the Tomcat - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_240335.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Fachhoch,

On 3/13/13 11:55 AM, fachhoch wrote:
>> Hard to say exactly. Perhaps your session expiration time is
>> large and sessions are not being removed as quickly as you would
>> expect.
>
> how can I figure this out ?, I am did not make any setting for
> session timeout ,except for browser activity  where to check
> session expiration configration?

Default is 30 minute session timeout. You would have set this in
web.xml if you had changed the default.

More likely is that you have some (all?) JSPs that create sessions
because session="false" isn't set in them, and you maybe use them from
scripts or something like that, where cookies set in a response are
ignored. Every request -> new session.

We had that problem on a server recently that we never expect to have
sessions, but it always had 6 sessions active. It was because our
monitoring service was hitting a JSP to check the "liveness" of the
server and creating a new session every few minutes. Adding
session="false" eliminated all of the sessions (after 30 minutes, of
course).

> are there any suggested ways to use threadlocal when deployed in
> tomcat ? I am using thread local as advised in any tutorial,   any
> special care must be taken  with threadlocal for tomcat ?

Yes, your best bet would be not to use them at all. Unless you remove
the ThreadLocal safely after *every single request*, you will likely
have a ClassLoader leak which means that you won't be able to reliably
redeploy your webapp without restarting CHADIS. (That's why I asked
about redeployments, but you didn't answer).

> I dont have manager app , I just have my application I removed all
> others apps from tomcat.

Not terribly relevant.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlFAtToACgkQ9CaO5/Lv0PCZzgCdHebgYOu0NJeE0s7lzyF9hrLh
JLsAoMFDxD6rUNY7/c9ulbCiopydk7tn
=jHgn
-----END PGP SIGNATURE-----


Attachment: users_240334.eml (zipped)
Chris,

On 6.3.2013 7:02, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>> It seems that Tomcat 6.0.32 (and probably other 6.0.xx versions)
>> use undocumented attribute for HTTPS connector "protocols". So in
>> Tomcat 7 you might use:
>>
>> sslProtocol="TLSv1.1" sslEnabledProtocols="TLSv1.1"
>>
>> and in Tomcat 6.0.32:
>>
>> sslProtocol="TLSv1.1" protocols="TLSv1.1"
>>
>>
>> It works for me.
>
> Can you file a bug for this? That should be a) documented and b)
> accept either "protocol" or "sslEnabledProtocols" to make it line-up
> with Tomcat 7.0.

Bug report: https://issues.apache.org/bugzilla/show_bug.cgi?id=54691

-Ognjen



Attachment: users_240336.eml (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Praveen,

On 3/9/13 11:20 AM, Praveen Boppana wrote:
> Hi,
>
> I'm very new to tomcat7 environment, we are migrating from oc4j to
> tomcat7. We have an issue with EL in jsp pages throwing error "The
> method proprietaryEvaluate(String, Class, PageContext, null,
> boolean) is undefined for the type PageContextImpl."

Can you post the full stack trace?

Any chance you could post a simple, repeatable test case and
instructions for running it?

> Tried setting the system property
> -Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true in
> catalina.properties file. Didn't resolve the issue.

What led you to believe setting that parameter would make a difference?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlFAtuEACgkQ9CaO5/Lv0PCMBACfSEku0x0o5hPgIlBiYmaGrIXf
guwAn3LlIDg2B2xaVMOabTQMCmS0e1Nz
=sgPK
-----END PGP SIGNATURE-----

©2008 junlu.com - Jax Systems, LLC, U.S.A.