Wednesday, November 28, 2007

Connecting jconsole to JBoss JMX server

So I was working on integrating the JBI ant tasks to the Open ESB distribution for JBoss and I was having some issues connecting to the JMX server. So, I wanted to try something simple and see if I could connect jconsole to the JMX server first. Out of the box this does not work. You will have to add some system properties to your run.sh or run.bat file for this to work. It's pretty simple really, but took me a while to find. For this to work just add the following properties to you run.sh file:


# Enable the jconsole agent remotely on port 64850
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=64850"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"


Next, start JBoss and once it is started you can start jconsole by issuing the command jconosle from a command window. You can connect in one of three ways. If you are connecting locally just select the local tab, you will see the PID and the class for JBoss and select Connect. If you are connecting to remotely select the remote tab and enter the Host/IP and the Port (the one you entered in your run.sh file).

Monday, November 12, 2007

Contributing a patch back to an Open Source project

I recently needed to contribute a patch back to an open source project I was working on, and since I wasn't familiar with using cvs from the command line I needed to research how to create a diff. I thought I would post my findings since it took me a while to find anything useful. First you will want to create a diff of the code you are contributing. For a single class you could do the following:

cvs diff -u myClass.java > myClass.diff

This creates a unified diff, which I have read most open source projects prefer, or the class you modified with what is current in CVS, and output the diff to myClass.diff.

If the class is not under CVS control, you can add the class and then run the following:

cvs diff -uN myClass.java > myClass.diff

If you have modifications to more than one class you can do a diff on the entire package by doing the following:

cvs diff -uN myPackage > myPackage.diff

This will recursively perform a diff on anything that is either added or under cvs control and write the output out to myPackage.diff.

You can also set how many lines of context you wish in your unified diff by doing the following:

cvs diff -u8N myClass.java > myClass.diff

Friday, November 9, 2007

Happy Birthday Marines - Semper Fi

Don't forget to celebrate the best holiday of the year on Saturday November 10th, The 232 Birthday of the United States Marine Corps. If you need a little inspiration this weekend checkout General Conway's Marine Corps Birthday Message, this is just one of the several proud traditions that all Marines will be participating in this weekend. If you know a Marine, make sure and tell them Happy Birthday. Semper Fi.

Monday, November 5, 2007

soapUI - Great plug-in for IDEA

I had used soapUI before, with Netbeans, but hadn't ever even looked to see if my preferred IDE IntelliJ IDEA had a plug-in. Today I was getting ready to run some tests and needed soapUI and I didn't want to start Netbeans, so I installed the soapUI plug-in for IDEA. It's great, and very simple to use. Some of you may have used the standalone version of soapUI before, but if your like me you always have your IDE up so why not just get the plug-in. If you haven't ever used soapUI and need a really great tool to send SOAP for testing purposes, it's a great tool and I highly recommend it.