Re: Tomcat Monitoring - Thread usage - currentThreadCount or currentThreadBusy

2013-08-15 Thread Leon Rosenberg
Hello Vikram,

if you are working on a monitoring solution for tomcat I suggest you take a
look at moskito: http://www.moskito.org.

regards
Leon


On Thu, Aug 15, 2013 at 3:42 AM, Vikram Jain rahulvi...@gmail.com wrote:

 Hi Team,

 I'm Vikram Jain. My first query to Tomcat user group, looking forward to
 hear from you. :)

 I am working on Tomcat monitoring solution for a project and when it comes
 to monitoring 'Thread usage', I am wondering whether I should be comparing
 'currentThreadCount' or 'currentThreadBusy' attribute against 'maxThread'
 to generate an alert.
 Is currentThreadBusy the actual represntation of the activeThread count ?
 If currentThreadCount increases when there is an increase in need of
 request processing threads and once the requests are processed, whether the
 currentThreadCount drops ?

 Please assist. If you find it relevant, please also update the docs to the
 benefit of other users :)

 Regards,
 Vikram



Exception by upgrading to WebSocket connection in 8.0.0-RC1

2013-08-15 Thread Sergey Shcherbakov
Hello everybody,

I am using an embedded Tomcat version 8.0.0-RC1 and trying to setup the
WebSocket connection to it.
From my browser application using SockJS and Spring 4 MVC on the server I
am initiating a websocket session.
When establishing connection I see in the server logs the following
exception:

2013-08-15 00:48:07,561 303759 ERROR [http-nio-8080-exec-4]
org.apache.coyote.http11.Http11NioProtocol - Error reading request, ignored


java.lang.IllegalStateException: The preInit() method must be called to
configure the WebSocket HttpUpgradeHandler before the container calls
init(). Usually, this means the Servlet that created the
WsHttpUpgradeHandler instance should also call preInit()

at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(
WsHttpUpgradeHandler.java:88) ~[tomcat-embed-core-8.0.0-RC1.jar:8.0.0-RC1]

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:658) ~[tomcat-embed-core-8.0.0-RC1.jar:8.0.0-RC1]

at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(
Http11NioProtocol.java:223) [tomcat-embed-core-8.0.0-RC1.jar:8.0.0-RC1]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(
NioEndpoint.java:1592) [tomcat-embed-core-8.0.0-RC1.jar:8.0.0-RC1]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(
NioEndpoint.java:1550) [tomcat-embed-core-8.0.0-RC1.jar:8.0.0-RC1]

at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1145) [na:1.7.0_17]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:615) [na:1.7.0_17]

at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]


It looks like I am missing some bit of the Tomcat configuration (to call
preInit()?).

Has anybody seen the issue, what could be the reason?

Thank you!


Best Regards,

Sergey


Tomcat isn't honoring the accept-language header, manager app shows up in Spanish

2013-08-15 Thread Haszlakiewicz, Eric
I've been having some problems getting Tomcat to show the right language for 
web pages.  I've narrowed it down to what appears to be a problem with how the 
accept-language header is handled.  Specifically, lower preference languages 
override higher preference ones.

Here is the setup that I used:
Server:
  Completely fresh installation of Tomcat 7.0.42 with a user added to 
tomcat-users.xml, running on Linux (RHEL5).
  The locale command returns blank for LANG and LC_ALL, POSIX for all other 
LC_* settings.  Neither LANG nor any other LC_* environment variable is set.
Browser:
  Firefox 22.0, running on Windows 7, system locale set to English (United 
States), as is the format in the Region and Language control panel.
  Preferred languages in Firefox have been adjusted to include Spanish at a 
*low* priority:
Tools-Options-Content-Languages, Added Spanish [es], then moved it 
down to the *end* of the list.

Behavior seen:
  When I go to http://myserver:8080/manager/html, the page displays with 
Spanish labels instead of English.
  I checked which Accept-Language header is being sent to the server, and it 
sends en-us,en;q=0.7,es;q=0.3 so English _should_ be preferred.

I tried re-ordering the order of the languages, but it didn't make any 
difference, the Spanish messages were always displayed.

Is this a known bug?  Should I report it in bugzilla?

Eric

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



Re: Exception by upgrading to WebSocket connection in 8.0.0-RC1

2013-08-15 Thread Mark Thomas
On 15/08/2013 08:41, Sergey Shcherbakov wrote:

 It looks like I am missing some bit of the Tomcat configuration (to call
 preInit()?).

You shouldn't need to worry about that.

 Has anybody seen the issue,

No.

 what could be the reason?

I suspect that as both Spring 4 and Tomcat 8 are both in RC / milestone
stage that Tomcat changed in a way Spring wasn't expecting.

Mark


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



Re: Tomcat isn't honoring the accept-language header, manager app shows up in Spanish

2013-08-15 Thread Mark Thomas
On 15/08/2013 17:08, Haszlakiewicz, Eric wrote:
 I've been having some problems getting Tomcat to show the right language for 
 web pages.  I've narrowed it down to what appears to be a problem with how 
 the accept-language header is handled.  Specifically, lower preference 
 languages override higher preference ones.
 
 Here is the setup that I used:
 Server:
   Completely fresh installation of Tomcat 7.0.42 with a user added to 
 tomcat-users.xml, running on Linux (RHEL5).
   The locale command returns blank for LANG and LC_ALL, POSIX for all 
 other LC_* settings.  Neither LANG nor any other LC_* environment variable is 
 set.
 Browser:
   Firefox 22.0, running on Windows 7, system locale set to English (United 
 States), as is the format in the Region and Language control panel.
   Preferred languages in Firefox have been adjusted to include Spanish at a 
 *low* priority:
 Tools-Options-Content-Languages, Added Spanish [es], then moved it 
 down to the *end* of the list.
 
 Behavior seen:
   When I go to http://myserver:8080/manager/html, the page displays with 
 Spanish labels instead of English.
   I checked which Accept-Language header is being sent to the server, and it 
 sends en-us,en;q=0.7,es;q=0.3 so English _should_ be preferred.
 
 I tried re-ordering the order of the languages, but it didn't make any 
 difference, the Spanish messages were always displayed.
 
 Is this a known bug?  Should I report it in bugzilla?

It is a bug but not a known one. I'm looking at a fix now but please
report it in Bugzilla.

Mark


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



How to gracefully shutdown tomcat7 executable war?

2013-08-15 Thread Olaf Bergner
We are currently experimenting with deploying all of our web-based services as 
executable wars created by the tomcat7-maven-plugin's exec-war goal. Our 
deployment format is RPM, so we wrapped this exec-war into some standard linux 
service and packaged everything as an RPM. So far, we really like the 
simplicity of this process compared to what we used to do before, namely 
deploying war files into a regular tomcat container. We do not want to go back 
there.

The one nagging problem we face, though, is that so far we have not been able 
to gracefully shutdown our running tomcat service. The only thing that works 
for us is kill –9. It goes without saying that this is not something you 
should do in production.

We tried two alternatives:

  1.  Tried to gracefully shutdown tomcat exec-war by sending its process the 
SIGINT signal (kill –2 ${tomcatpid}). According to our researches, this should 
be equivalent to a CTRL-C in the console (which we do not have in production). 
Alas, tomcat exec-war seems to ignore this.
  2.  Since our exec-war uses a custom server.xml, we expected it to open 
tomcat's well-known shutdown port. If we start tomcat with debug logging turned 
on, we actually see that Digester, when parsing our server.xml, creates a 
StandardServer with shutdown port 8505. A netstat –tulpn | grep 8505 before 
starting tomcat exe-war confirms that this port is available. However, after 
tomcat exec-war has started nothing listens on this port. So this approach has 
failed for us, too.

So my question is: is there a way to gracefully shutdown a running tomcat7 
executable war as built by the tomcat7-maven-plugin-2.1? If yes, what does this 
way look like? As always, any help is more than welcome.

Best, Olaf


Re: How to gracefully shutdown tomcat7 executable war?

2013-08-15 Thread Mark Thomas
On 15/08/2013 17:33, Olaf Bergner wrote:

 1.  Tried to gracefully shutdown tomcat exec-war by sending its
 process the SIGINT signal (kill –2 ${tomcatpid}). According to our
 researches, this should be equivalent to a CTRL-C in the console
 (which we do not have in production). Alas, tomcat exec-war seems to
 ignore this.

Try kill -15 instead.

Mark


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



Re: Exception by upgrading to WebSocket connection in 8.0.0-RC1

2013-08-15 Thread Nick Williams

On Aug 15, 2013, at 11:27 AM, Mark Thomas wrote:

 On 15/08/2013 08:41, Sergey Shcherbakov wrote:
 
 It looks like I am missing some bit of the Tomcat configuration (to call
 preInit()?).
 
 You shouldn't need to worry about that.
 
 Has anybody seen the issue,
 
 No.
 
 what could be the reason?
 
 I suspect that as both Spring 4 and Tomcat 8 are both in RC / milestone
 stage that Tomcat changed in a way Spring wasn't expecting.

Yes, I concur. Please file a bug at https://jira.springsource.org/browse/SPR 
ASAP so that they can get it fixed for RC2.

Nick

Re: How to gracefully shutdown tomcat7 executable war?

2013-08-15 Thread Olaf Bergner
Hi Mark, thanks for the prompt reply. I tried your suggestion, and yes,
*something* happens. The log says

15.08.13 18:45:50.903 [INFO] | [Thread-5] [Http11Protocol] [Pausing
ProtocolHandler [http-bio-8080]]
log4j:WARN No appenders could be found for logger
(org.apache.catalina.core.StandardService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.

but the tomcat exec-war process is still alive (ps tells me so). I then
forced a thread dump and it revealed that amongst a bunch of daemon and GC
threads the main thread is still alive and waiting in
Tomcat7Runner.waitIndefinitely(). Anything else I should try?


Olaf

Am 15.08.13 18:36 schrieb Mark Thomas unter ma...@apache.org:

On 15/08/2013 17:33, Olaf Bergner wrote:

 1.  Tried to gracefully shutdown tomcat exec-war by sending its
 process the SIGINT signal (kill ­2 ${tomcatpid}). According to our
 researches, this should be equivalent to a CTRL-C in the console
 (which we do not have in production). Alas, tomcat exec-war seems to
 ignore this.

Try kill -15 instead.

Mark


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



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



Re: Exception by upgrading to WebSocket connection in 8.0.0-RC1

2013-08-15 Thread Rossen Stoyanchev
On Thu, Aug 15, 2013 at 12:39 PM, Nick Williams
nicho...@nicholaswilliams.net wrote:

 I suspect that as both Spring 4 and Tomcat 8 are both in RC / milestone
 stage that Tomcat changed in a way Spring wasn't expecting.

Right. This is already fixed actually. Just use Spring Framework
4.0.0.BUILD-SNAPSHOT.

Once the ticket below is completed, the underlying cause for this
issue should go away by the way:
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314

Rossen

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



Re: Tomcat isn't honoring the accept-language header, manager app shows up in Spanish

2013-08-15 Thread Mark Thomas
On 15/08/2013 17:31, Mark Thomas wrote:
 On 15/08/2013 17:08, Haszlakiewicz, Eric wrote:

 Is this a known bug?  Should I report it in bugzilla?
 
 It is a bug but not a known one. I'm looking at a fix now but please
 report it in Bugzilla.

Scratch that. The bug is fixed in trunk, 7.0.x and proposed for 6.0.x.

Mark

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



Re: How to gracefully shutdown tomcat7 executable war?

2013-08-15 Thread Mark Thomas
On 15/08/2013 17:58, Olaf Bergner wrote:
 Hi Mark, thanks for the prompt reply. I tried your suggestion, and yes,
 *something* happens. The log says
 
 15.08.13 18:45:50.903 [INFO] | [Thread-5] [Http11Protocol] [Pausing
 ProtocolHandler [http-bio-8080]]
 log4j:WARN No appenders could be found for logger
 (org.apache.catalina.core.StandardService).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
 more info.
 
 but the tomcat exec-war process is still alive (ps tells me so). I then
 forced a thread dump and it revealed that amongst a bunch of daemon and GC
 threads the main thread is still alive and waiting in
 Tomcat7Runner.waitIndefinitely(). Anything else I should try?

Sorry, I don't know the Maven plug-in at all. kill -15 was just
something that has worked elsewhere.

Mark


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



Re: tomcat 7 in ubuntu

2013-08-15 Thread fachhoch

It is happending becasue of tomcat-users.xml  any advice what causes this ?




--
View this message in context: 
http://tomcat.10.x6.nabble.com/tomcat-7-in-ubuntu-tp5003226p5003250.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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



Oracle RAC JDBC/UCP config question

2013-08-15 Thread Jeffrey Janner
Has anyone on this list ever set up an Oracle UCP connection to an Oracle RAC 
and had it supporting all RAC features, i.e. dead connections, failover, etc.?
My question is configuration oriented so I don't think exact hardware/os/tomcat 
revs are important.
However, assume Oracle 11gR2 and either thin or OCI client, though I'd prefer 
thin, and configuration is via JNDI resource definition.
From what I can gather from various sources, though oddly unable to confirm on 
Oracle's sites, I should be able to set up the JNDI definition as normal, but 
need to add the following two lines to enable RAC features:
fastConnectionFailoverEnabled=true
onsConfiguration=nodes=node1:6151,node2:6151
with, of course, proper values for the node names and communication ports.

What I'm wanting to find out from someone whose been down this road before, are 
there any code changes needed?
From what I can tell, if a node goes down mid-query, an error is generated, 
and I'd have to catch it and resubmit if I don't want to error out to the 
client.  But otherwise, is there anything needed to actually turn on the 
features, or any other files or JNDI settings or Java properties that are 
required?

Jeffrey Janner
Sr. Network Administrator
jeffrey.jan...@polydyne.commailto:first.l...@polydyne.com
PolyDyne Software Inc.
Main:   512.343.9100
Direct:  512.583.8930

 [cid:image002.png@01CC0FB7.4FF43CE0]

Speed, Intelligence  Savings in Sourcing



Re: Tomcat Monitoring - Thread usage - currentThreadCount or currentThreadBusy

2013-08-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vikram,

On 8/14/13 9:42 PM, Vikram Jain wrote:
 I am working on Tomcat monitoring solution for a project and when
 it comes to monitoring 'Thread usage', I am wondering whether I
 should be comparing 'currentThreadCount' or 'currentThreadBusy'
 attribute against 'maxThread' to generate an alert. Is
 currentThreadBusy the actual represntation of the activeThread
 count ? If currentThreadCount increases when there is an increase
 in need of request processing threads and once the requests are
 processed, whether the currentThreadCount drops ?

I would go for currentThreadBusy because your thread count could ==
maxThread which just means that all potential threads have been
allocated -- not that they are all busy at the same time.

 Please assist. If you find it relevant, please also update the docs
 to the benefit of other users :)

There are some existing notes about using JMX for monitoring here:
http://wiki.apache.org/tomcat/FAQ/Monitoring

Feel free to add your own commentary if it can be helpful.

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

iQIcBAEBCAAGBQJSDUszAAoJEBzwKT+lPKRYf3AP/2t6EAnw836R/2D6zbngkELk
dVlzJXhK0qixwzwc/ZOJX1CZGbLDecMgmxG12p5n5WEEzqppkXdDe+rc+HPb1zPc
CIEr6qVGH3ydbG/O6qn+opEOKf8DQuPlu/MM43uC7pUQm7O4/Ehegg+1ubBEhRHg
y1PhJC2IPQM9esz/fUzqXf5nL5Y7uUE/2TfvKCP5zhu3EUPm1K5WVXI2/CnhcmXP
+KXmjtlrGUA7OA5ERcW9TSGJQD343EigN92nA4zRn5UrfOL18P2VK1fEC+zbmr3u
tS0WxAKylh/uLgbuAUediB2z+UxzwpYhtZC+NNu+r/cbToLw39cNHS6CAKOZw4f3
ChPUAdDkp3qs0AJDzihNtxtGQcWTwjcHBQBvzhD2X0EUQPU+qWmP6OopEpMRyYEk
RYeulZ1IAgs7Z9I4SgSnsuH5n7GWLXOU4cStnGSyehljm3420n986Y4H1kIEgEXs
hxV5TzqE2fjbCZXDfqMZaLzCxk2ORqiHEPBxALZ1rIuDADi5xNo/q6ZnlvD/HMQ5
gEujDWvCI2vSn4LughMQKy1fU2DoGXeJSTdaFwmMdANAOoG8fJa5RrZwrT3hoLNX
hz/2yiB/pOSQxZDFDV/by8tFhA+LXZop1E5FacEnQVlzuSPacdKU5tCAp32pEYgG
LwbRej65xANHvGOkte82
=hyJ3
-END PGP SIGNATURE-

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



Re: tomcat 7 in ubuntu

2013-08-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Facchoch,

On 8/15/13 1:17 PM, fachhoch wrote:
 It is happening because of tomcat-users.xml any advice what causes 
 this ?

It looks like Nabble has sheared-off all context for this comment. Can
you remind us of what is going on?

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

iQIcBAEBCAAGBQJSDU2xAAoJEBzwKT+lPKRYI8gP/1/aufJXf40rz/G7m0s/Gj6p
0BXvywOQuhipMaSW+ctFXXXLI/fNIxvNLtYZ3NPi8u5+It8HLhRpEp4UTK2HiS+K
+SjDxzNKmaQjYmMTPbS73SIZoGkVXily2GoowRpyVyKvaxRyDkfxUOcZJ95Y8JpV
cpMJ2vEa40ELcyj42hs/eAGD8FSXHZBcrfO1da8a9r+UaKRwE0JXQxNx2AS47eCu
4NmRSzPFXkEWshtrcN/S1ZRLJ/2UR4GySxI/KMcmMN7A8jo4XSOQBpnsIJOcwBf8
FnwMICUwugNb4uRE6/mK8hkktaAFFQ7GOXUqp/Xt/GrmO+h0LmPRtZJbRSRQo2Yl
p5l5Pl+b5G97m1rQ5DJNGZRkYWpouKa5mNCbj/lte0G5iNrty2oXifSKWI10mla4
GjcvTXpIFivr/wlzFvN5BVSvCvVlguYswhgej7x+knngcrYQgD8B6EqZX3EiiDMV
zQconDYh+37K0h8RGwxqmf4dOcjjn1Ju8SvH1nrbA1D0diz0aN7s7A+Dk6GX56bi
t8GxOHgRxtUYwPB+zbGj7Kg5DZgqVC5klolT1pZBkXQfCnEI+NAPUhtsxNqrTrN/
rP+PRClyi28scfZAzyrUFKJx7f8lXGl0Ycl3HVe+y1cwnEK6u7AdYK+cpjV2pOsd
1xQGxsI89fMJ3z+jJ/l6
=92VG
-END PGP SIGNATURE-

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