Re: tomcat jmx disabled by default ?

2013-04-07 Thread Zdeněk Henek
Hi Jakub,

do you have running Tomcat and JConsole as same user?

JMX should really work out of box when both Tomcat and JConsole/JVisualVM
are in same machine and same user.

Regards,
Zdenek


On Sun, Apr 7, 2013 at 9:15 PM, Neven Cvetkovic
wrote:

> Mark,
>
> When connecting to local jmx, connection is not over the network interface
> but through local Java process that you need to have access to. So I doubt
> that is Jakub's problem here.
>
> I've had issues when jdks didn't match and when different users were used
> to start JVM process.
>  On Apr 7, 2013 3:09 PM, "Mark Eggers"  wrote:
>
> > On 4/7/2013 7:54 AM, Jakub 1983 wrote:
> >
> >> Neven,
> >>
> >> thx for your reply,
> >>
> >> so my question is why when I start my own main without passing
> >> -Dcom.sun.management.* properties I can connect to it with jconsole,
> >> but I cannot connect with jconsole to tomcat (although it is visible in
> >> jconsole) ?
> >>
> >> both my main, and tomcat, and jconsole are running on the same laptop.
> >>
> >> regards,
> >> Jakub
> >>
> >>
> >>
> >>
> >> On Sun, Apr 7, 2013 at 3:49 PM, Neven Cvetkovic
> >> **wrote:
> >>
> >>  Jakub,
> >>>
> >>> "You don't have to" configure Tomcat with above settings to get JMX.
> You
> >>> are correct that JMX works out of the box. However, that works only
> >>> locally, above commands are for REMOTE JMX access. You are opening up a
> >>> jmx
> >>> port so external (not same machine) jconsole or jvirtualvm can access
> JMX
> >>> MBean server your Tomcat is running. Thus, if you want to connect to
> >>> remote
> >>> Tomcat instance, "you have to provide" JMX connection details, and
> that's
> >>> what we often do.
> >>>
> >>> The above settings are best configured in CATALINA_HOME/bin/setenv.bat
> or
> >>> setenv.sh script that you need to create. Even though this script
> doesn't
> >>> exist by default, startup script calls it if it is created by user. All
> >>> your customizations should be contained there.
> >>>
> >>> Hope that helps. Cheers!
> >>> On Apr 7, 2013 5:59 AM, "Jakub 1983"  wrote:
> >>>
> >>>  why do I have to enable jmx with command
> 
>  *set CATALINA_OPTS=-Dcom.sun.**management.jmxremote \
>   -Dcom.sun.management.**jmxremote.port=%my.jmx.port% \
>   -Dcom.sun.management.**jmxremote.ssl=false \
>   -Dcom.sun.management.**jmxremote.authenticate=false*
> 
> 
>  http://tomcat.apache.org/**tomcat-7.0-doc/monitoring.html<
> http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html>
> 
>  even when I run it *under java 6* ?
>  in java 6 jmx is active by default (it is active when I run my own
>  main),
>  I cannot see how it is disabled by default by tomcat start scripts,
>  but when I run default startup, I cannot connect with jconsole,
>  when I set CATALINA_OPTS as above, it works fine,
>  but why doesn't it work without it ?
> 
>  regards
>  Jakub
> 
> 
> >>>
> >>
> > Works for me . . . I just started my Tomcat 7.0.39 with Java 6 and a Java
> > 6 version of jconsole connects right up:
> >
> > Environment:
> >
> > OS: Windows 7 Home Premium 64 bit
> > JRE / JDK: 1.6.0_43
> > Tomcat: 7.0.39
> >
> > I have a setenv.bat with:
> >
> > set "JRE_HOME=C:\Program Files\Java\jre6"
> >
> > since my normal environment is JRE / JDK 7.
> >
> > Maybe your Windows firewall isn't configured to allow Java network
> > connections? However that wouldn't explain why it works when JMX is
> > configured.
> >
> > . . . . just my two cents.
> > /mde/
> >
> >
> > --**--**-
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<
> users-unsubscr...@tomcat.apache.org>
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>


Re: tomcat jmx disabled by default ?

2013-04-07 Thread Neven Cvetkovic
Mark,

When connecting to local jmx, connection is not over the network interface
but through local Java process that you need to have access to. So I doubt
that is Jakub's problem here.

I've had issues when jdks didn't match and when different users were used
to start JVM process.
 On Apr 7, 2013 3:09 PM, "Mark Eggers"  wrote:

> On 4/7/2013 7:54 AM, Jakub 1983 wrote:
>
>> Neven,
>>
>> thx for your reply,
>>
>> so my question is why when I start my own main without passing
>> -Dcom.sun.management.* properties I can connect to it with jconsole,
>> but I cannot connect with jconsole to tomcat (although it is visible in
>> jconsole) ?
>>
>> both my main, and tomcat, and jconsole are running on the same laptop.
>>
>> regards,
>> Jakub
>>
>>
>>
>>
>> On Sun, Apr 7, 2013 at 3:49 PM, Neven Cvetkovic
>> **wrote:
>>
>>  Jakub,
>>>
>>> "You don't have to" configure Tomcat with above settings to get JMX. You
>>> are correct that JMX works out of the box. However, that works only
>>> locally, above commands are for REMOTE JMX access. You are opening up a
>>> jmx
>>> port so external (not same machine) jconsole or jvirtualvm can access JMX
>>> MBean server your Tomcat is running. Thus, if you want to connect to
>>> remote
>>> Tomcat instance, "you have to provide" JMX connection details, and that's
>>> what we often do.
>>>
>>> The above settings are best configured in CATALINA_HOME/bin/setenv.bat or
>>> setenv.sh script that you need to create. Even though this script doesn't
>>> exist by default, startup script calls it if it is created by user. All
>>> your customizations should be contained there.
>>>
>>> Hope that helps. Cheers!
>>> On Apr 7, 2013 5:59 AM, "Jakub 1983"  wrote:
>>>
>>>  why do I have to enable jmx with command

 *set CATALINA_OPTS=-Dcom.sun.**management.jmxremote \
  -Dcom.sun.management.**jmxremote.port=%my.jmx.port% \
  -Dcom.sun.management.**jmxremote.ssl=false \
  -Dcom.sun.management.**jmxremote.authenticate=false*


 http://tomcat.apache.org/**tomcat-7.0-doc/monitoring.html

 even when I run it *under java 6* ?
 in java 6 jmx is active by default (it is active when I run my own
 main),
 I cannot see how it is disabled by default by tomcat start scripts,
 but when I run default startup, I cannot connect with jconsole,
 when I set CATALINA_OPTS as above, it works fine,
 but why doesn't it work without it ?

 regards
 Jakub


>>>
>>
> Works for me . . . I just started my Tomcat 7.0.39 with Java 6 and a Java
> 6 version of jconsole connects right up:
>
> Environment:
>
> OS: Windows 7 Home Premium 64 bit
> JRE / JDK: 1.6.0_43
> Tomcat: 7.0.39
>
> I have a setenv.bat with:
>
> set "JRE_HOME=C:\Program Files\Java\jre6"
>
> since my normal environment is JRE / JDK 7.
>
> Maybe your Windows firewall isn't configured to allow Java network
> connections? However that wouldn't explain why it works when JMX is
> configured.
>
> . . . . just my two cents.
> /mde/
>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tomcat.**apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: tomcat jmx disabled by default ?

2013-04-07 Thread Mark Eggers

On 4/7/2013 7:54 AM, Jakub 1983 wrote:

Neven,

thx for your reply,

so my question is why when I start my own main without passing
-Dcom.sun.management.* properties I can connect to it with jconsole,
but I cannot connect with jconsole to tomcat (although it is visible in
jconsole) ?

both my main, and tomcat, and jconsole are running on the same laptop.

regards,
Jakub




On Sun, Apr 7, 2013 at 3:49 PM, Neven Cvetkovic
wrote:


Jakub,

"You don't have to" configure Tomcat with above settings to get JMX. You
are correct that JMX works out of the box. However, that works only
locally, above commands are for REMOTE JMX access. You are opening up a jmx
port so external (not same machine) jconsole or jvirtualvm can access JMX
MBean server your Tomcat is running. Thus, if you want to connect to remote
Tomcat instance, "you have to provide" JMX connection details, and that's
what we often do.

The above settings are best configured in CATALINA_HOME/bin/setenv.bat or
setenv.sh script that you need to create. Even though this script doesn't
exist by default, startup script calls it if it is created by user. All
your customizations should be contained there.

Hope that helps. Cheers!
On Apr 7, 2013 5:59 AM, "Jakub 1983"  wrote:


why do I have to enable jmx with command

*set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
 -Dcom.sun.management.jmxremote.port=%my.jmx.port% \
 -Dcom.sun.management.jmxremote.ssl=false \
 -Dcom.sun.management.jmxremote.authenticate=false*


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

even when I run it *under java 6* ?
in java 6 jmx is active by default (it is active when I run my own main),
I cannot see how it is disabled by default by tomcat start scripts,
but when I run default startup, I cannot connect with jconsole,
when I set CATALINA_OPTS as above, it works fine,
but why doesn't it work without it ?

regards
Jakub







Works for me . . . I just started my Tomcat 7.0.39 with Java 6 and a 
Java 6 version of jconsole connects right up:


Environment:

OS: Windows 7 Home Premium 64 bit
JRE / JDK: 1.6.0_43
Tomcat: 7.0.39

I have a setenv.bat with:

set "JRE_HOME=C:\Program Files\Java\jre6"

since my normal environment is JRE / JDK 7.

Maybe your Windows firewall isn't configured to allow Java network 
connections? However that wouldn't explain why it works when JMX is 
configured.


. . . . just my two cents.
/mde/


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



Re: Better SSL connector setup

2013-04-07 Thread Mark Eggers

Some notes from October 2011 referenced below:

On 4/7/2013 8:47 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Kevin,

On 4/6/13 10:10 PM, Kevin Jenkins wrote:

I have a server that has two hosts: First:
http://masterserver2.raknet.com/

Second (using alias) https://lobby3.raknet.com

https://milestone.lobby3.raknet.com:444/

I would like have access be on these specific URLS. Right now you
can use untrusted URLs, such as https://masterserver2.raknet.com/
https://milestone.lobby3.raknet.com/

Additionally, I would like to access milestone.lobby3.raknet.com on
port 443 rather than 444 (so that 443 does not display a warning
like it does now).

I setup two connectors because I did not know how else to specify
there are two ssl certificate files


If you want two separate hostnames served under HTTPS and you:

a. Don't have a wildcard or other special type of certificate
or
b. Don't have Server Name Indication capabilities



From the list archives:

http://mail-archives.apache.org/mod_mbox/tomcat-users/201110.mbox/%3c1318710394.66976.yahoomail...@web125511.mail.ne1.yahoo.com%3E

Wildcard certificates would work in this case because the hosts are part 
of the same domain.


SNI is apparently client-side only for Java.


...then you will need to configure a  for each hostname on
a separate interface/port combination with separate certificates.

The easiest way to do this is to set up a second interface with a
separate IP address. This is usually trivial to do, and it doesn't
really interfere with networking on the server. Just create a second
interface with a second IP address, map DNS properly, and then set up
your web server to bind specifically to the second IP address for the
second hostname's SSL virtual host.



In a Tomcat-only setup this is the way to go. Secondary or virtual IP 
addresses are easy to set up.



Your  look just fine (other than the use of port 444, of
course). Once you have a second interface/IP, you'll want to use the
"address" attribute of the  to choose the interface to
listen on. I would choose one  to listen on *all*
interfaces to be a catch-all in case your IP address(es) change(s) and
you forget to re-configure everything: a security warning due to a
mismatched-host is better for users than an unreachable host.

- -chris


The other solution is to front the Tomcat systems with an Apache HTTPD 
server and use named virtual hosts in SSL. Apparently the configuration 
checking routine throws a warning on startup, but the actual 
configuration works (on Apache HTTPD 2.2, I've not tried 2.4).


. . . . just my two cents.
/mde/

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



Re: configuration of db

2013-04-07 Thread David Kerber

On 4/7/2013 11:32 AM, aishani wrote:

SIR WHEN I RE-START MY STARTUP BAT FILE AGAIN DB CONNECTION ESTABLISHED.
PLEASE GUIDE ME WHAT I HAVE TO CONFIGURE IN MQSQL.

THANKS


Please don't top-post.

I can't help you with mySQL; I've never used it.  Do some research 
through your favorite search engine to find how to set the maximum 
number of simultaneous connections in mySQL.







-Original Message-
From: David Kerber [mailto:dcker...@verizon.net]
Sent: Sunday, April 07, 2013 5:25 PM
To: users@tomcat.apache.org
Subject: Re: configuration of db

On 4/7/2013 6:58 AM, aishani wrote:

SIR WHEN MORE THAN 15 DB CONNECTION CROSSED TOMCAT GIVES AN ERROR
MESSAGE THAT TOO MANY SQL CONNECTION. I AM USING TOMCAT 5.X WITH
MYSQL.HOW CAN I CONFIGURE TOMCAT FOR EXECUTING MANY DB CONNECTION?




That error is almost certainly coming from MySQL, not tomcat.  Verify that
you have mySQL configured to accept as many connections as you need.


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


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






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



Re: configuration of db

2013-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Aishani,

On 4/7/13 11:32 AM, aishani wrote:
> SIR WHEN I RE-START MY STARTUP BAT FILE AGAIN DB CONNECTION
> ESTABLISHED. PLEASE GUIDE ME WHAT I HAVE TO CONFIGURE IN MQSQL.

What have you tried so far? Please post your existing configuration.

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

iQIcBAEBCAAGBQJRYZYMAAoJEBzwKT+lPKRYN6IP/1FmwjzkVP5jc588PDCboJYe
Fii2fJFnZRpFOEIuOUcfkaKqVEum+p6IQMrC0MVVa+8wTpIeyX6GKAw2zwf6m5g9
0kxwFW5ztFOK53tZ5CQiTkv7MDfDU2nqfA33J8MF4X4qwgWT7g1NyPhmDBPlJsru
gLTD5cF0zhDBG0yGz8Vopj6yWLX3MAt22vLhA3NXjy5AjUdfzeIy2WWrPyvpDYBj
nhkRFRflK7msBwDGGw53LBBnFoyiRDZQCiJ+FdbHIbZU1vYMCAsrbuj7Z7ZZs4Ux
rSiRehHqIeYCBjJGTPfzEQDqd7ulw/yTfLZD4exgMMjN11MftSlFWDSoWL1aUXQT
9catzqN7QUscCSFtAfOq6k2D0iZzYCXuTfjXVubgJHt7S2s5qyZWxuT5HUb0jjeJ
m3YDAQuPQ420WKEamv94QSw0GuY5axGuAAYEOdVE2PXOqosdgd6NW2R/wpF0MiDr
b9KPNbJV8b4FBeS2NTE0ab8nR1Ll3xcJFuZXi+tImoaPRMo6RQT3ShIWNNcpmkNg
MM1lBm7IS5zVUHtTPGdaPNCSgVIGBNZszsVCBJK/saVaxtXYvClmFb4/YaOaaLrH
r0C8uEugXDTfBkiF2z5x2fhtioo0uoyRRtcbVmgkGkI9KcI1tLFcrSJxDskv8Q6H
oYbvHjWIwCIyQAYkH76i
=txkB
-END PGP SIGNATURE-

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



Re: tomcat jmx disabled by default ?

2013-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jakub,

On 4/7/13 5:58 AM, Jakub 1983 wrote:
> why do I have to enable jmx with command
> 
> *set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ 
> -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ 
> -Dcom.sun.management.jmxremote.ssl=false \ 
> -Dcom.sun.management.jmxremote.authenticate=false*
> 
> 
> http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
> 
> even when I run it *under java 6* ? in java 6 jmx is active by
> default (it is active when I run my own main), I cannot see how it
> is disabled by default by tomcat start scripts, but when I run
> default startup, I cannot connect with jconsole, when I set
> CATALINA_OPTS as above, it works fine, but why doesn't it work
> without it ?

The above configuration sets up *remote* JMX management. JMX is always
enabled, and you can connect from localhost (as the same user, or
root) using tools like jvisualvm, etc. without specifying any of the
stuff above.

Note that enabling remote authentication with authentication disabled
(and SSL disabled, too!) is pretty much a terrible idea: anyone can
connect to your server and do all sorts of evil things.

Of course, firewalls, etc. can be configured to restrict access, but
it's generally a good idea to also restrict access via password and
encrypt the traffic from the remote host to the server.

Thanks,
- -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/

iQIcBAEBCAAGBQJRYZXfAAoJEBzwKT+lPKRYLlkP/3ue8hSLskZwyZIWxBbbltzH
5M5pWhSaViWAGxsszvx7BFqRQEUYOgndGl/TUsRNSc6rM/RQ2Gcq603/G22dsmLv
uM5IPnKV7D8Sk3g/qbG/b8kbPy2s+5d1QlEZF0gKVHbIS21uNmnhUyJE/KqjU858
lZmSNpfcSmtR0In+7BPDsy9QFGswkSQu7ZQdfGxhnIdTlbgIhFYz3+acHbC3hYpL
BW0hvgUNyUjJ3SvjzHpAaociXP8HyQPfWooj/aWOex2rgi+5D5LfxlBI2qfXDGj0
4gakMIUq+ONBHSFBEp3HcaS2BzUWbZ2gpghHFurQOdbrwXA/etfkC4ksiTsh2utU
M/k5wQ3XcpmuWjnWga6ATXWiFIiv8g+nhAl2mkl2bwkWPcrOPTK5O9WFA12zQaIZ
w202VopEQOqx6qlivaNQA1xXbM6SN7ZV3DjO+SMValuSMAllQ5LoueaL37lTTZIA
kGJ8+XonoN4GFBZ7snaL+mGtKTxykUjgg/s01eaOh4RL1NFrFRMPWy30JI4hQ8l/
DhJ8vv+ZKeoEqRvmCCfCB05tyWEgRG1qIS0AQTU+A5f70WRRkTJGvC16GMypn+kJ
+ioIdomkadTQsydkyxVEzTU6jagGSn8Xu0s/xUzQEXyM72/ausjZoOp5CaDCvr4o
Yjg2+7lZ5IVcAHO5Zgcz
=z+Y8
-END PGP SIGNATURE-

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



Re: Better SSL connector setup

2013-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Kevin,

On 4/6/13 10:10 PM, Kevin Jenkins wrote:
> I have a server that has two hosts: First: 
> http://masterserver2.raknet.com/
> 
> Second (using alias) https://lobby3.raknet.com
>  
> https://milestone.lobby3.raknet.com:444/
> 
> I would like have access be on these specific URLS. Right now you
> can use untrusted URLs, such as https://masterserver2.raknet.com/ 
> https://milestone.lobby3.raknet.com/
> 
> Additionally, I would like to access milestone.lobby3.raknet.com on
> port 443 rather than 444 (so that 443 does not display a warning
> like it does now).
> 
> I setup two connectors because I did not know how else to specify
> there are two ssl certificate files

If you want two separate hostnames served under HTTPS and you:

a. Don't have a wildcard or other special type of certificate
or
b. Don't have Server Name Indication capabilities

...then you will need to configure a  for each hostname on
a separate interface/port combination with separate certificates.

The easiest way to do this is to set up a second interface with a
separate IP address. This is usually trivial to do, and it doesn't
really interfere with networking on the server. Just create a second
interface with a second IP address, map DNS properly, and then set up
your web server to bind specifically to the second IP address for the
second hostname's SSL virtual host.

Your  look just fine (other than the use of port 444, of
course). Once you have a second interface/IP, you'll want to use the
"address" attribute of the  to choose the interface to
listen on. I would choose one  to listen on *all*
interfaces to be a catch-all in case your IP address(es) change(s) and
you forget to re-configure everything: a security warning due to a
mismatched-host is better for users than an unreachable host.

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

iQIcBAEBCAAGBQJRYZUIAAoJEBzwKT+lPKRYj44P/iYRzgb3O2rjHU6fnH4xjdDf
EdtuWrMIDyesjxI5DgFmkk++0R5CeIZKfD5BDlIB5wAZtM2kEMQAud/uJ/8+spkT
mMAAR4LmenPB5kmXbHGznBH+DE0ih2ILt/Zq0HuYzGrDiVFDfEf/55F6R8OEYF7Z
ok5ygMDPXOwrmq6lyvm8zGelcQ6yCFK8/zJkaH2+EHXHQBMmy5oVoz0OfmqN1RxN
EqxpsFK9qbZVWdP5lePH4uAzjHp17W19BThxO16LOJy2teEvKDex+pHP2RLR3Pk4
nHjybAQLoM18dYtkpabOQ13537eBUbcOhvxq0BPAb1l1UJ9d22a4J8RjoPF1uUK9
hkAWDtKdqVltrSLCkowbfoVyGEPltyzqEUcP2zIg5Kn5C4cpITt4nH9OoVmrmbG0
AOMDUdJEfRurSqBGLirXxhzDnEpqFipvy1cRHrB400tnFziOLOIJtojrzmJQp+3a
Z798cHthQ/2jiK7U8M5eVfsS5BzzECVI6ss8pJViWgVExoC4GNToimWoNOO0J4UZ
x6bLNaf7O5fbzBS/U8tgeYjmGsnOLTOiEV/ddmPYqu1FHio4TLrk9k2k/lX5TyZF
TSR0pBKggqMDeFr8dcxuXnEJTjQNT+9YyJapXfcjy3jlmzP8nVbgRb+zWM9ycuXd
9ls4z5Rw7/KsYPoEFeEp
=2flM
-END PGP SIGNATURE-

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



RE: configuration of db

2013-04-07 Thread aishani
SIR WHEN I RE-START MY STARTUP BAT FILE AGAIN DB CONNECTION ESTABLISHED.
PLEASE GUIDE ME WHAT I HAVE TO CONFIGURE IN MQSQL.

THANKS



-Original Message-
From: David Kerber [mailto:dcker...@verizon.net] 
Sent: Sunday, April 07, 2013 5:25 PM
To: users@tomcat.apache.org
Subject: Re: configuration of db

On 4/7/2013 6:58 AM, aishani wrote:
> SIR WHEN MORE THAN 15 DB CONNECTION CROSSED TOMCAT GIVES AN ERROR 
> MESSAGE THAT TOO MANY SQL CONNECTION. I AM USING TOMCAT 5.X WITH 
> MYSQL.HOW CAN I CONFIGURE TOMCAT FOR EXECUTING MANY DB CONNECTION?
>
>

That error is almost certainly coming from MySQL, not tomcat.  Verify that
you have mySQL configured to accept as many connections as you need.


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


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



Re: tomcat jmx disabled by default ?

2013-04-07 Thread Neven Cvetkovic
Jakub,

I am not sure that I understand "when I start my own main ..." - I
assume you refer to your own Java class that has main() method and
that you start, e.g.

java com.mydomain.MyApp

What specific command do you use when starting up your Tomcat? Also,
include what version and what operating system you use (I assume 7.0.x
and Windows). Also include which version of JDK you use (I assume JDK
1.6.0_x).

So when you start jconsole (or similar tool jvisualvm - try it if you
haven't already it is an awesome tool) - you should see the list of
all Java processes that you have access to. You should be able to
connect to any Java process listed there, including Catalina/Tomcat
process (usually defined with pid - process id) and including your own
application (MyApp). Once you connect to a Java process, you would be
able to see JMX namespaces, MBeans, memory configuration, classes
loaded, etc...

So, does the Tomcat process show up in the list of processes (without
remote JMX configuration) same way your MyApp shows up? When you try
to connect to Tomcat/Catalina process what is the error message if
any?

What user owns the Tomcat process?

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



Re: tomcat jmx disabled by default ?

2013-04-07 Thread Jakub 1983
Neven,

thx for your reply,

so my question is why when I start my own main without passing
-Dcom.sun.management.* properties I can connect to it with jconsole,
but I cannot connect with jconsole to tomcat (although it is visible in
jconsole) ?

both my main, and tomcat, and jconsole are running on the same laptop.

regards,
Jakub




On Sun, Apr 7, 2013 at 3:49 PM, Neven Cvetkovic
wrote:

> Jakub,
>
> "You don't have to" configure Tomcat with above settings to get JMX. You
> are correct that JMX works out of the box. However, that works only
> locally, above commands are for REMOTE JMX access. You are opening up a jmx
> port so external (not same machine) jconsole or jvirtualvm can access JMX
> MBean server your Tomcat is running. Thus, if you want to connect to remote
> Tomcat instance, "you have to provide" JMX connection details, and that's
> what we often do.
>
> The above settings are best configured in CATALINA_HOME/bin/setenv.bat or
> setenv.sh script that you need to create. Even though this script doesn't
> exist by default, startup script calls it if it is created by user. All
> your customizations should be contained there.
>
> Hope that helps. Cheers!
> On Apr 7, 2013 5:59 AM, "Jakub 1983"  wrote:
>
> > why do I have to enable jmx with command
> >
> > *set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
> > -Dcom.sun.management.jmxremote.port=%my.jmx.port% \
> > -Dcom.sun.management.jmxremote.ssl=false \
> > -Dcom.sun.management.jmxremote.authenticate=false*
> >
> >
> > http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
> >
> > even when I run it *under java 6* ?
> > in java 6 jmx is active by default (it is active when I run my own main),
> > I cannot see how it is disabled by default by tomcat start scripts,
> > but when I run default startup, I cannot connect with jconsole,
> > when I set CATALINA_OPTS as above, it works fine,
> > but why doesn't it work without it ?
> >
> > regards
> > Jakub
> >
>


Re: tomcat jmx disabled by default ?

2013-04-07 Thread Neven Cvetkovic
Jakub,

"You don't have to" configure Tomcat with above settings to get JMX. You
are correct that JMX works out of the box. However, that works only
locally, above commands are for REMOTE JMX access. You are opening up a jmx
port so external (not same machine) jconsole or jvirtualvm can access JMX
MBean server your Tomcat is running. Thus, if you want to connect to remote
Tomcat instance, "you have to provide" JMX connection details, and that's
what we often do.

The above settings are best configured in CATALINA_HOME/bin/setenv.bat or
setenv.sh script that you need to create. Even though this script doesn't
exist by default, startup script calls it if it is created by user. All
your customizations should be contained there.

Hope that helps. Cheers!
On Apr 7, 2013 5:59 AM, "Jakub 1983"  wrote:

> why do I have to enable jmx with command
>
> *set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
> -Dcom.sun.management.jmxremote.port=%my.jmx.port% \
> -Dcom.sun.management.jmxremote.ssl=false \
> -Dcom.sun.management.jmxremote.authenticate=false*
>
>
> http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
>
> even when I run it *under java 6* ?
> in java 6 jmx is active by default (it is active when I run my own main),
> I cannot see how it is disabled by default by tomcat start scripts,
> but when I run default startup, I cannot connect with jconsole,
> when I set CATALINA_OPTS as above, it works fine,
> but why doesn't it work without it ?
>
> regards
> Jakub
>


Re: configuration of db

2013-04-07 Thread David Kerber

On 4/7/2013 6:58 AM, aishani wrote:

SIR WHEN MORE THAN 15 DB CONNECTION CROSSED TOMCAT GIVES AN ERROR MESSAGE
THAT TOO MANY SQL CONNECTION. I AM USING TOMCAT 5.X WITH MYSQL.HOW CAN I
CONFIGURE TOMCAT FOR EXECUTING MANY DB CONNECTION?




That error is almost certainly coming from MySQL, not tomcat.  Verify 
that you have mySQL configured to accept as many connections as you need.



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



Re: tomcat jmx disabled by default ?

2013-04-07 Thread André Warnier

Jakub 1983 wrote:

why do I have to enable jmx with command

*set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false*


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

even when I run it *under java 6* ?
in java 6 jmx is active by default (it is active when I run my own main),
I cannot see how it is disabled by default by tomcat start scripts,
but when I run default startup, I cannot connect with jconsole,
when I set CATALINA_OPTS as above, it works fine,
but why doesn't it work without it ?



What you say above seems to me largely nonsense.
There is nothing in the standard Tomcat startup scripts which sets or unsets these 
properties.  Consult the following page to see what the Java JVM defaults are for Oracle's 
Java 1.7.


http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html

(for example, com.sun.management.jmxremote.ssl is true by default)

Other versions may have different properties or values.
Pre-packaged versions of Tomcat for various OS/platforms may also have different defaults, 
but that depends on those packages, not on Tomcat per se.


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



configuration of db

2013-04-07 Thread aishani
SIR WHEN MORE THAN 15 DB CONNECTION CROSSED TOMCAT GIVES AN ERROR MESSAGE
THAT TOO MANY SQL CONNECTION. I AM USING TOMCAT 5.X WITH MYSQL.HOW CAN I
CONFIGURE TOMCAT FOR EXECUTING MANY DB CONNECTION?



tomcat jmx disabled by default ?

2013-04-07 Thread Jakub 1983
why do I have to enable jmx with command

*set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false*


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

even when I run it *under java 6* ?
in java 6 jmx is active by default (it is active when I run my own main),
I cannot see how it is disabled by default by tomcat start scripts,
but when I run default startup, I cannot connect with jconsole,
when I set CATALINA_OPTS as above, it works fine,
but why doesn't it work without it ?

regards
Jakub