2010 September
September 30, 2010
Monitor Railo on Tomcat using JConsole
At Learnosity, I’ve been trying to get to the bottom of a “Java Heap Space” error on my local Railo installation and decided to use JConsole to monitor Tomcat server. JConsole is a very useful Java application monitoring tool, which is bundled into every JRE. You can run it by simply executing jconsole binary:
$JAVA_HOME/bin/jconsole
Where $JAVA_HOME is the path to your Java installation.
By default, JConsole picks up all local Java processes, which you can monitor individually. Unfortunately, Tomcat doesn’t seem to be listed under local processes and I had to use remote connection instead. The way to connect to Tomcat with JConsole is a little tricky and this is what you need to do:
You need to tell Tomcat to accept clients on TCP port 8999, on the host “localhost”, without authentication.
DO NOT disable remote authentication in production environment. It should only be done for testing purposes in development/staging environments. closeTo translate this into code, set CATALINA_HOME environment variable to this:
$CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost"; $ export CATALINA_OPTS;
(Re)start Tomcat and you should now be able to monitor it on localhost:8999
Top
Here are some JConsole screen shots:


References:
Monitoring Tomcat with JMX
Using JConsole to Monitor ApplicationsSeptember 21, 2010
Create iPhone ringtone from iTunes library
Have you ever listened to a tune and said, man I wish I had that ringtone! If you have an iPhone and iTunes, you can convert your iTunes track into a ringtone very easily. This will probably work with other handsets too, but I have an iPhone and I know it works well with it.
The steps are:
1) Locate your song in iTunes and right-click on it.
2) Figure out what part of song you’d like to convert to your ringtone. E.g from 0:10 to 0:25. (from 10th second to 25th second).
3) Right-click on your chosen song and select “Get Info”. Then click the “Options” tab
4) This is where you specify part of the song you’d like to convert to ringtone by setting the Start Time and Stop Time. Set your values in “minute:seconds” format. You can also fine tune your values by adding milliseconds after your seconds, e.g “1:25.350″ (1 minute, 25 seconds and 350 milliseconds). Keep in mind that ringtones cannot exceed around 39 seconds in length. Press “OK” and you’re almost there.

5) Right click on the same song again and click “Create AAC Version”. This will create your shortened version of the song and add it to iTunes.
6) Locate your newly created file in iTunes, right-click on it and select “Show In Finder” on a Mac, or “Open in Windows Explorer” on Windows.
7) In your Win Explorer or Finder you’ll notice that the file has a .m4a extension. Rename the file to have .m4r extension.
Now delete your new file from iTunes, but leave it on your filesystem. Double click the .m4r file and it will get imported into your ringtones in iTunes.9) To load the ringtone into your iPhone, simply sync your phone with iTunes. Once the sync is complete, go to “Settings” in your iPhone, and then go to “Sounds” and “Ringtone”. Your new ringtone should be listed under “Custom” ringtones.
My first custom ringtone is Carousel by Mr Bungle from 0.09.25 to 0:23.15 and it’s a little beauty. What’s yours?
Have fun
Top
Marko