You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paolo Santarsiero <pa...@gmail.com> on 2009/12/14 10:11:33 UTC

remote monitoring JVM by VisualVM

Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by remote
access using VisualVM. I configured all, but my client always display an
error message (" Cannoct connect using
service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
I added in catalina.sh this Java options:
elif [ "$1" = "start" ] ; then

  shift
  touch "$CATALINA_BASE"/logs/catalina.out
  if [ "$1" = "-security" ] ; then
    echo "Using Security Manager"
    shift
     "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
     #START JMXREMOTE OPTIONS
      -Dcom.sun.management.jmxremote.port=8080 \
      -Dcom.sun.management.jmxremote.ssl=false \
      -Dcom.sun.management.jmxremote.authenticate=true \
     #END JMXREMOTE OPTIONS
      $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Djava.security.manager \
      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start \
      >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

      if [ ! -z "$CATALINA_PID" ]; then
        echo $! > $CATALINA_PID
      fi
  else
      "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
     #START JMXREMOTE OPTIONS
      -Dcom.sun.management.jmxremote.port=8080 \
      -Dcom.sun.management.jmxremote.ssl=false \
      -Dcom.sun.management.jmxremote.authenticate=true \
      #END JMXREMOTE OPTIONS
      $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      org.apache.catalina.startup.Bootstrap "$@" start \
      >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

      if [ ! -z "$CATALINA_PID" ]; then
        echo $! > $CATALINA_PID
      fi
  fi
-----------------------------------------------------------------------------------------------------------------------------------------------
In JRE_Home/management i modified jmxremote.password and added rights
passwords for access roles.
My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP connector
in order to free use 8080 port for jmx.
I hope you can help me, thanks.

RE: remote monitoring JVM by VisualVM

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Paolo Santarsiero [mailto:paolo.santarsiero@gmail.com]
> Subject: Re: remote monitoring JVM by VisualVM
> 
> How can I integrate this Listener in my production Tom?

The general building-from-source instructions are here:
http://tomcat.apache.org/tomcat-6.0-doc/building.html

It's easy and fairly quick, but you will need an active internet connection to allow the build script to download jars that Tomcat needs.

I haven't built the new listener yet, but the following should work:

1) Download the Tomcat source and untar/unzip it.

2) Download the two new .java and one .properties files from SVN and place them in:
apache-tomcat-6.0.20-src/java/org/apache/catalina/mbeans

3) Optionally, download the one new and one updated .xml files from SVN and place them in:
apache-tomcat-6.0.20-src/webapps/docs/config

4) Build Tomcat using the ant script that comes with the source download.

You'll need to at least look at the listeners.xml file to see how to configure the new JMX one.

You could also hand-compile the two new .java files, but that's probably harder than just letting ant do it.

 - Chuck


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


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


Re: remote monitoring JVM by VisualVM

Posted by Paolo Santarsiero <pa...@gmail.com>.
Many thanks Chuck, I think this can solve my problem. How can I integrate
this Listener in my production Tom?

2009/12/14 Caldarale, Charles R <Ch...@unisys.com>

> > From: Paolo Santarsiero [mailto:paolo.santarsiero@gmail.com]
> > Subject: Re: remote monitoring JVM by VisualVM
> >
> > I use 8080 port because it's sure open on server (I used it for tomcat
> > direct access).
>
> Unfortunately, JMX requires an additional, dynamically assigned port,
> making it difficult to use through a firewall.  There is a new listener
> available for Tomcat that you can configure for a specific secondary port;
> search the archives for "JMX firewall", or look here:
> http://marc.info/?l=tomcat-user&m=123688600013694&w=2
> http://marc.info/?l=tomcat-user&m=122277270626801&w=2
> http://marc.info/?l=tomcat-user&m=122216618925359&w=2
>
> AFAIK, the JMX listener has not made it into a Tomcat release, but it
> should be available from SVN:
> http://svn.apache.org/viewvc?rev=699523&view=rev
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: remote monitoring JVM by VisualVM

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Paolo Santarsiero [mailto:paolo.santarsiero@gmail.com]
> Subject: Re: remote monitoring JVM by VisualVM
> 
> I use 8080 port because it's sure open on server (I used it for tomcat
> direct access).

Unfortunately, JMX requires an additional, dynamically assigned port, making it difficult to use through a firewall.  There is a new listener available for Tomcat that you can configure for a specific secondary port; search the archives for "JMX firewall", or look here: 
http://marc.info/?l=tomcat-user&m=123688600013694&w=2
http://marc.info/?l=tomcat-user&m=122277270626801&w=2
http://marc.info/?l=tomcat-user&m=122216618925359&w=2

AFAIK, the JMX listener has not made it into a Tomcat release, but it should be available from SVN:
http://svn.apache.org/viewvc?rev=699523&view=rev

 - Chuck


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


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


Re: remote monitoring JVM by VisualVM

Posted by Paolo Santarsiero <pa...@gmail.com>.
thanks for all answer, but problem doesn't solve. I tested at last JConsole
in debug mode and this is the exception stack:
java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 8 more

2009/12/14 Caldarale, Charles R <Ch...@unisys.com>

> > From: David kerber [mailto:dckerber@verizon.net]
> > Subject: Re: remote monitoring JVM by VisualVM
> >
> > I believe the monitor port has to be a different one from the http
> > request port, so if 8080 is the one your app is listening on, it won't
> > work for monitoring.
>
> The OP already stated that he disabled the HTTP <Connector>.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: remote monitoring JVM by VisualVM

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David kerber [mailto:dckerber@verizon.net]
> Subject: Re: remote monitoring JVM by VisualVM
> 
> I believe the monitor port has to be a different one from the http
> request port, so if 8080 is the one your app is listening on, it won't
> work for monitoring.

The OP already stated that he disabled the HTTP <Connector>.

 - Chuck


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


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


Re: remote monitoring JVM by VisualVM

Posted by David kerber <dc...@verizon.net>.
Paolo Santarsiero wrote:
> I use 8080 port because it's sure open on server (I used it for tomcat
> direct access).

I believe the monitor port has to be a different one from the http 
request port, so if 8080 is the one your app is listening on, it won't 
work for monitoring.


> 
> 2009/12/14 Pid <pi...@pidster.com>
> 
>> On 14/12/2009 10:04, Paolo Santarsiero wrote:
>>
>>> Thanks for answer, but don't solve. I executed jconsole in debug mode and
>>> the eception stack is this:
>>>
>> Firewall settings interfering?
>> Is the server actually listening on the port you set?
>>
>>
>> p
>>
>>
>>
>>  java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx;
>>> nested exception is:
>>> java.net.ConnectException: Connection timed out: connect
>>> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
>>> at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
>>> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
>>> at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
>>> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>>> at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
>>> at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
>>> at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
>>> at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
>>> Caused by: java.net.ConnectException: Connection timed out: connect
>>> at java.net.PlainSocketImpl.socketConnect(Native Method)
>>> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>> at java.net.Socket.connect(Socket.java:525)
>>> at java.net.Socket.connect(Socket.java:475)
>>> at java.net.Socket.<init>(Socket.java:372)
>>> at java.net.Socket.<init>(Socket.java:186)
>>> at
>>>
>>> sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
>>> at
>>>
>>> sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
>>> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
>>> ... 8 more
>>>
>>>
>>> 2009/12/14 trucbinh<tr...@gmail.com>
>>>
>>>  Hi,
>>>>    I think you should add this line
>>>> -Djava.rmi.server.hostname=192.168.1.12
>>>> like this
>>>>
>>>>
>>>>      -Dcom.sun.management.jmxremote.port=8080 \
>>>>      -Dcom.sun.management.jmxremote.ssl=false \
>>>>      -Dcom.sun.management.jmxremote.authenticate=true \
>>>>      -Djava.rmi.server.hostname=192.168.1.12
>>>>
>>>>      192.168.1.12 is your tomcat server address.
>>>> Regards,
>>>> Binh.
>>>>
>>>>
>>>>
>>>> On 12/14/2009 4:11 PM, Paolo Santarsiero wrote:
>>>>
>>>>  Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by
>>>>> remote
>>>>> access using VisualVM. I configured all, but my client always display an
>>>>> error message (" Cannoct connect using
>>>>> service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
>>>>> I added in catalina.sh this Java options:
>>>>> elif [ "$1" = "start" ] ; then
>>>>>
>>>>>   shift
>>>>>   touch "$CATALINA_BASE"/logs/catalina.out
>>>>>   if [ "$1" = "-security" ] ; then
>>>>>     echo "Using Security Manager"
>>>>>     shift
>>>>>      "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>>>      #START JMXREMOTE OPTIONS
>>>>>       -Dcom.sun.management.jmxremote.port=8080 \
>>>>>       -Dcom.sun.management.jmxremote.ssl=false \
>>>>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>>>>      #END JMXREMOTE OPTIONS
>>>>>       $CATALINA_OPTS \
>>>>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
>>>>> \
>>>>>       -Djava.security.manager \
>>>>>       -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
>>>>>       -Dcatalina.base="$CATALINA_BASE" \
>>>>>       -Dcatalina.home="$CATALINA_HOME" \
>>>>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>>>>       >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>>>
>>>>>       if [ ! -z "$CATALINA_PID" ]; then
>>>>>         echo $!>   $CATALINA_PID
>>>>>       fi
>>>>>   else
>>>>>       "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>>>      #START JMXREMOTE OPTIONS
>>>>>       -Dcom.sun.management.jmxremote.port=8080 \
>>>>>       -Dcom.sun.management.jmxremote.ssl=false \
>>>>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>>>>       #END JMXREMOTE OPTIONS
>>>>>       $CATALINA_OPTS \
>>>>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
>>>>> \
>>>>>       -Dcatalina.base="$CATALINA_BASE" \
>>>>>       -Dcatalina.home="$CATALINA_HOME" \
>>>>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>>>>       >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>>>
>>>>>       if [ ! -z "$CATALINA_PID" ]; then
>>>>>         echo $!>   $CATALINA_PID
>>>>>       fi
>>>>>   fi
>>>>>
>>>>>
>>>>> -----------------------------------------------------------------------------------------------------------------------------------------------
>>>>> In JRE_Home/management i modified jmxremote.password and added rights
>>>>> passwords for access roles.
>>>>> My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP
>>>>> connector
>>>>> in order to free use 8080 port for jmx.
>>>>> I hope you can help me, thanks.
>>>>>
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


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


Re: remote monitoring JVM by VisualVM

Posted by Paolo Santarsiero <pa...@gmail.com>.
I use 8080 port because it's sure open on server (I used it for tomcat
direct access).

2009/12/14 Pid <pi...@pidster.com>

> On 14/12/2009 10:04, Paolo Santarsiero wrote:
>
>> Thanks for answer, but don't solve. I executed jconsole in debug mode and
>> the eception stack is this:
>>
>
> Firewall settings interfering?
> Is the server actually listening on the port you set?
>
>
> p
>
>
>
>  java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx;
>> nested exception is:
>> java.net.ConnectException: Connection timed out: connect
>> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
>> at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
>> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
>> at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
>> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>> at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
>> at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
>> at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
>> at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
>> Caused by: java.net.ConnectException: Connection timed out: connect
>> at java.net.PlainSocketImpl.socketConnect(Native Method)
>> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>> at java.net.Socket.connect(Socket.java:525)
>> at java.net.Socket.connect(Socket.java:475)
>> at java.net.Socket.<init>(Socket.java:372)
>> at java.net.Socket.<init>(Socket.java:186)
>> at
>>
>> sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
>> at
>>
>> sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
>> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
>> ... 8 more
>>
>>
>> 2009/12/14 trucbinh<tr...@gmail.com>
>>
>>  Hi,
>>>    I think you should add this line
>>> -Djava.rmi.server.hostname=192.168.1.12
>>> like this
>>>
>>>
>>>      -Dcom.sun.management.jmxremote.port=8080 \
>>>      -Dcom.sun.management.jmxremote.ssl=false \
>>>      -Dcom.sun.management.jmxremote.authenticate=true \
>>>      -Djava.rmi.server.hostname=192.168.1.12
>>>
>>>      192.168.1.12 is your tomcat server address.
>>> Regards,
>>> Binh.
>>>
>>>
>>>
>>> On 12/14/2009 4:11 PM, Paolo Santarsiero wrote:
>>>
>>>  Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by
>>>> remote
>>>> access using VisualVM. I configured all, but my client always display an
>>>> error message (" Cannoct connect using
>>>> service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
>>>> I added in catalina.sh this Java options:
>>>> elif [ "$1" = "start" ] ; then
>>>>
>>>>   shift
>>>>   touch "$CATALINA_BASE"/logs/catalina.out
>>>>   if [ "$1" = "-security" ] ; then
>>>>     echo "Using Security Manager"
>>>>     shift
>>>>      "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>>      #START JMXREMOTE OPTIONS
>>>>       -Dcom.sun.management.jmxremote.port=8080 \
>>>>       -Dcom.sun.management.jmxremote.ssl=false \
>>>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>>>      #END JMXREMOTE OPTIONS
>>>>       $CATALINA_OPTS \
>>>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
>>>> \
>>>>       -Djava.security.manager \
>>>>       -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
>>>>       -Dcatalina.base="$CATALINA_BASE" \
>>>>       -Dcatalina.home="$CATALINA_HOME" \
>>>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>>>       >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>>
>>>>       if [ ! -z "$CATALINA_PID" ]; then
>>>>         echo $!>   $CATALINA_PID
>>>>       fi
>>>>   else
>>>>       "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>>      #START JMXREMOTE OPTIONS
>>>>       -Dcom.sun.management.jmxremote.port=8080 \
>>>>       -Dcom.sun.management.jmxremote.ssl=false \
>>>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>>>       #END JMXREMOTE OPTIONS
>>>>       $CATALINA_OPTS \
>>>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH"
>>>> \
>>>>       -Dcatalina.base="$CATALINA_BASE" \
>>>>       -Dcatalina.home="$CATALINA_HOME" \
>>>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>>>       >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>>
>>>>       if [ ! -z "$CATALINA_PID" ]; then
>>>>         echo $!>   $CATALINA_PID
>>>>       fi
>>>>   fi
>>>>
>>>>
>>>> -----------------------------------------------------------------------------------------------------------------------------------------------
>>>> In JRE_Home/management i modified jmxremote.password and added rights
>>>> passwords for access roles.
>>>> My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP
>>>> connector
>>>> in order to free use 8080 port for jmx.
>>>> I hope you can help me, thanks.
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: remote monitoring JVM by VisualVM

Posted by Pid <pi...@pidster.com>.
On 14/12/2009 10:04, Paolo Santarsiero wrote:
> Thanks for answer, but don't solve. I executed jconsole in debug mode and
> the eception stack is this:

Firewall settings interfering?
Is the server actually listening on the port you set?


p


> java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx;
> nested exception is:
> java.net.ConnectException: Connection timed out: connect
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
> at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
> at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
> at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
> at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
> at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
> Caused by: java.net.ConnectException: Connection timed out: connect
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> at java.net.Socket.connect(Socket.java:525)
> at java.net.Socket.connect(Socket.java:475)
> at java.net.Socket.<init>(Socket.java:372)
> at java.net.Socket.<init>(Socket.java:186)
> at
> sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
> at
> sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
> ... 8 more
>
>
> 2009/12/14 trucbinh<tr...@gmail.com>
>
>> Hi,
>>     I think you should add this line -Djava.rmi.server.hostname=192.168.1.12
>> like this
>>
>>
>>       -Dcom.sun.management.jmxremote.port=8080 \
>>       -Dcom.sun.management.jmxremote.ssl=false \
>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>       -Djava.rmi.server.hostname=192.168.1.12
>>
>>       192.168.1.12 is your tomcat server address.
>> Regards,
>> Binh.
>>
>>
>>
>> On 12/14/2009 4:11 PM, Paolo Santarsiero wrote:
>>
>>> Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by
>>> remote
>>> access using VisualVM. I configured all, but my client always display an
>>> error message (" Cannoct connect using
>>> service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
>>> I added in catalina.sh this Java options:
>>> elif [ "$1" = "start" ] ; then
>>>
>>>    shift
>>>    touch "$CATALINA_BASE"/logs/catalina.out
>>>    if [ "$1" = "-security" ] ; then
>>>      echo "Using Security Manager"
>>>      shift
>>>       "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>       #START JMXREMOTE OPTIONS
>>>        -Dcom.sun.management.jmxremote.port=8080 \
>>>        -Dcom.sun.management.jmxremote.ssl=false \
>>>        -Dcom.sun.management.jmxremote.authenticate=true \
>>>       #END JMXREMOTE OPTIONS
>>>        $CATALINA_OPTS \
>>>        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>>>        -Djava.security.manager \
>>>        -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
>>>        -Dcatalina.base="$CATALINA_BASE" \
>>>        -Dcatalina.home="$CATALINA_HOME" \
>>>        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>        org.apache.catalina.startup.Bootstrap "$@" start \
>>>        >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>
>>>        if [ ! -z "$CATALINA_PID" ]; then
>>>          echo $!>   $CATALINA_PID
>>>        fi
>>>    else
>>>        "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>>       #START JMXREMOTE OPTIONS
>>>        -Dcom.sun.management.jmxremote.port=8080 \
>>>        -Dcom.sun.management.jmxremote.ssl=false \
>>>        -Dcom.sun.management.jmxremote.authenticate=true \
>>>        #END JMXREMOTE OPTIONS
>>>        $CATALINA_OPTS \
>>>        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>>>        -Dcatalina.base="$CATALINA_BASE" \
>>>        -Dcatalina.home="$CATALINA_HOME" \
>>>        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>>        org.apache.catalina.startup.Bootstrap "$@" start \
>>>        >>   "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>>
>>>        if [ ! -z "$CATALINA_PID" ]; then
>>>          echo $!>   $CATALINA_PID
>>>        fi
>>>    fi
>>>
>>> -----------------------------------------------------------------------------------------------------------------------------------------------
>>> In JRE_Home/management i modified jmxremote.password and added rights
>>> passwords for access roles.
>>> My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP
>>> connector
>>> in order to free use 8080 port for jmx.
>>> I hope you can help me, thanks.
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>


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


Re: remote monitoring JVM by VisualVM

Posted by Paolo Santarsiero <pa...@gmail.com>.
Thanks for answer, but don't solve. I executed jconsole in debug mode and
the eception stack is this:

java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 8 more


2009/12/14 trucbinh <tr...@gmail.com>

> Hi,
>    I think you should add this line -Djava.rmi.server.hostname=192.168.1.12
> like this
>
>
>      -Dcom.sun.management.jmxremote.port=8080 \
>      -Dcom.sun.management.jmxremote.ssl=false \
>      -Dcom.sun.management.jmxremote.authenticate=true \
>      -Djava.rmi.server.hostname=192.168.1.12
>
>      192.168.1.12 is your tomcat server address.
> Regards,
> Binh.
>
>
>
> On 12/14/2009 4:11 PM, Paolo Santarsiero wrote:
>
>> Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by
>> remote
>> access using VisualVM. I configured all, but my client always display an
>> error message (" Cannoct connect using
>> service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
>> I added in catalina.sh this Java options:
>> elif [ "$1" = "start" ] ; then
>>
>>   shift
>>   touch "$CATALINA_BASE"/logs/catalina.out
>>   if [ "$1" = "-security" ] ; then
>>     echo "Using Security Manager"
>>     shift
>>      "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>      #START JMXREMOTE OPTIONS
>>       -Dcom.sun.management.jmxremote.port=8080 \
>>       -Dcom.sun.management.jmxremote.ssl=false \
>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>      #END JMXREMOTE OPTIONS
>>       $CATALINA_OPTS \
>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>>       -Djava.security.manager \
>>       -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
>>       -Dcatalina.base="$CATALINA_BASE" \
>>       -Dcatalina.home="$CATALINA_HOME" \
>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>       >>  "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>
>>       if [ ! -z "$CATALINA_PID" ]; then
>>         echo $!>  $CATALINA_PID
>>       fi
>>   else
>>       "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>>      #START JMXREMOTE OPTIONS
>>       -Dcom.sun.management.jmxremote.port=8080 \
>>       -Dcom.sun.management.jmxremote.ssl=false \
>>       -Dcom.sun.management.jmxremote.authenticate=true \
>>       #END JMXREMOTE OPTIONS
>>       $CATALINA_OPTS \
>>       -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>>       -Dcatalina.base="$CATALINA_BASE" \
>>       -Dcatalina.home="$CATALINA_HOME" \
>>       -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>>       org.apache.catalina.startup.Bootstrap "$@" start \
>>       >>  "$CATALINA_BASE"/logs/catalina.out 2>&1&
>>
>>       if [ ! -z "$CATALINA_PID" ]; then
>>         echo $!>  $CATALINA_PID
>>       fi
>>   fi
>>
>> -----------------------------------------------------------------------------------------------------------------------------------------------
>> In JRE_Home/management i modified jmxremote.password and added rights
>> passwords for access roles.
>> My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP
>> connector
>> in order to free use 8080 port for jmx.
>> I hope you can help me, thanks.
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: remote monitoring JVM by VisualVM

Posted by trucbinh <tr...@gmail.com>.
Hi,
     I think you should add this line 
-Djava.rmi.server.hostname=192.168.1.12 like this

       -Dcom.sun.management.jmxremote.port=8080 \
       -Dcom.sun.management.jmxremote.ssl=false \
       -Dcom.sun.management.jmxremote.authenticate=true \
       -Djava.rmi.server.hostname=192.168.1.12

       192.168.1.12 is your tomcat server address.
Regards,
Binh.


On 12/14/2009 4:11 PM, Paolo Santarsiero wrote:
> Hello, I'm tryng to monitor my JVM and so Tomcat HeapMemory usage by remote
> access using VisualVM. I configured all, but my client always display an
> error message (" Cannoct connect using
> service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx.:8080:jmxrmi").
> I added in catalina.sh this Java options:
> elif [ "$1" = "start" ] ; then
>
>    shift
>    touch "$CATALINA_BASE"/logs/catalina.out
>    if [ "$1" = "-security" ] ; then
>      echo "Using Security Manager"
>      shift
>       "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>       #START JMXREMOTE OPTIONS
>        -Dcom.sun.management.jmxremote.port=8080 \
>        -Dcom.sun.management.jmxremote.ssl=false \
>        -Dcom.sun.management.jmxremote.authenticate=true \
>       #END JMXREMOTE OPTIONS
>        $CATALINA_OPTS \
>        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>        -Djava.security.manager \
>        -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
>        -Dcatalina.base="$CATALINA_BASE" \
>        -Dcatalina.home="$CATALINA_HOME" \
>        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>        org.apache.catalina.startup.Bootstrap "$@" start \
>        >>  "$CATALINA_BASE"/logs/catalina.out 2>&1&
>
>        if [ ! -z "$CATALINA_PID" ]; then
>          echo $!>  $CATALINA_PID
>        fi
>    else
>        "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS \
>       #START JMXREMOTE OPTIONS
>        -Dcom.sun.management.jmxremote.port=8080 \
>        -Dcom.sun.management.jmxremote.ssl=false \
>        -Dcom.sun.management.jmxremote.authenticate=true \
>        #END JMXREMOTE OPTIONS
>        $CATALINA_OPTS \
>        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
>        -Dcatalina.base="$CATALINA_BASE" \
>        -Dcatalina.home="$CATALINA_HOME" \
>        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
>        org.apache.catalina.startup.Bootstrap "$@" start \
>        >>  "$CATALINA_BASE"/logs/catalina.out 2>&1&
>
>        if [ ! -z "$CATALINA_PID" ]; then
>          echo $!>  $CATALINA_PID
>        fi
>    fi
> -----------------------------------------------------------------------------------------------------------------------------------------------
> In JRE_Home/management i modified jmxremote.password and added rights
> passwords for access roles.
> My Tomcat version is 6 and Java1.5. In server.xml  I disabled HTTP connector
> in order to free use 8080 port for jmx.
> I hope you can help me, thanks.
>
>    


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