Thursday, 8 November 2012

New Relic Agent in JBoss AS7

New Relic is a company with a hot new cloud based performance and monitoring service.
Without having performed a deeper evaluation, I must still say that it looks quite impressive and has a clean and very nice UI.
As you sign up for their service you get to download a zip with the New Relic Agent. For a Java-environment, it contains e g some JARs, configuration files and a README.txt explaining how to run the bundled installer.
If you're running JBoss AS7 you are currently (this will certainly be amended) a bit on your own though. But don't despair (or wait in wain)! The solution is quite simple. Just follow steps below and and you're up and monitoring your apps in no time.

Note: This has successfully been tested using JBoss AS7.1.2.Final on OSX 10.8.2 with Java SE 1.6.0_37.

1. create the directory structure
where JBOSS_HOME is the root install directory of your JBoss AS7 distribution. 

2. add a file named module.xml with the following content to the directory main from 1.
<?xml version="1.0" encoding="UTF-8">
<module xmlns="urn:jboss:module:1.0" name="com.newrelic.agent">
    <resource-root path="newrelic.jar"/>
    <!-- Insert resources here -->

3. from the downloaded zip, copy the file newrelic.jar to the directory main from 1.
This is the New Relic Agent.

4. from the downloaded zip, copy the file newrelic.yml to the directory main from 1.
This is the base configuration for the New Relic Agent.

5. add the following lines th the JBoss AS startup script (e g) $JBOSS_HOME/bin/

JAVA_OPTS="$JAVA_OPTS -javaagent:<path>/newrelic.jar"
Make sure to change the <path> to where the newrelic.jar is located - it should be in the directory in 1.

6. start JBoss AS with (in the simplest form) e g

7. deploy you app (ear/war etc) to JBoss AS7

8. Look at how your app is discovered - it might take a few minutes - and then how it behaves. Configure, monitor, set alerts & notifications, etc.


Saturday, 11 August 2012

HermesJMS setup for HornetQ

The amount of free UI-based client software for the JBoss HornetQ messaging server/service is quite limited. One of the few and perhaps the best in this area is HermesJMS.
A simple documentation and various hints (community entries, blogposts etc) around the Internet for setting up HermesJMS with HornetQ do exist, but none are (IMHO) as straightforward and complete as they could be. 
To remedy this; here is a complete (?) step-by-step instruction to setup HermesJMS with HornetQ .
This setup has been validated on...
  • HermesJMS 1.15 on OSX 10.7, OSX 10.8 and Windows 8
  • HornetQ 2.2.5.Final (standalone), 2.2.14.Final (standalone), 2.3.0.CR1 (standalone), 2.3.0.Final (standalone) and JBoss AS 6.1.0.Final on both OSX 10.7, OSX 10.8, Ubuntu and RHEL
...all using Java SE 6.

Connecting to HornetQ from HermesJMS

To view the contents of topics/queues in a HornetQ instance, a session must be setup. To view various configuration data exposed by JMX from a HornetQ instance, a context must be setup.

Setup a session

Right-click the sessions node in the tree pane and select New -> New Session...
In the now showing Preferences window, select the Providers tab
Right-click and select Add Group
Give the group a name – e g HornetQ
For the new group, right-click Library and select Add JAR(s).
Select the following JARs – one at time. After a JAR is selected also click Scan. After all JARs are selected click Apply.
(for JBoss AS 6 in $JBOSS_HOME/client)
(for HornetQ 2.2.x.Final standalone in $HORNETQ_HOME/lib)
  • hornetq-core-client.jar
  • hornetq-jms-client.jar
  • jnp-client.jar
  • netty.jar
  • jboss-logging.jar (only needed for JBoss AS 6!)
  • hornetq-commons.jar (only needed as of HornerQ 2.3.0.x!)
Select the Sessions tab in the Preferences window.
Give the Session a name in the drop-down menu– e g HornetQ-Session - and click Apply.
As Plug In, select the HornetQ plugin from the drop-down (you might need to select HornetQ from the loader drop-down first).
Right-click in the Property-Value-pane. 
Select Add property. A line is now available. 
Click on it in the  Property-column and select jmxUrl
On the same line, in the Value-column, select it by double-clicking and enter the value service:jmx:rmi:///jndi/rmi://localhost:6000/jmxconnector
Note: adjust the path (hostname and port) as needed.
For the Connection Factory, select hermes.JNDIQueueConnectionFactory from the Class-drop-down and HornetQ (earlier created in the Providers tab) from the Loader-drop-down.
Right-click in the Property-Value-pane. 
Select Add property. A line is now available. 
Enter the following Property-Value-pairs.
  • binding - ConnectionFactory
  • initialContextFactory - org.jnp.interfaces.NamingContextFactory
  • providerURL - jnp://localhost:1099
  • urlPkgPrefixes - org.jboss.naming:org.jnp.interfaces
Note: adjust path (hostname) for providerURL as needed. 
It can sometimes be cumbersome to get values to "stick" during configuration. If you encounter some error, re-visit your configurations and make sure all(!) values are properly set before moving on. If they are not – try again! Setting them one-by-one clicking Apply and Ok and saving the configuration between each usually works.

Setup a context

Right-click the contexts node in the tree pane and select New -> New Context...
Give the session a name – e g HornetQ-Context.
In the now showing JNDI InitialContext window, set the following property-valiue-pairs:
  • loader - HornetQ
  • initialContextFactory - org.jnp.interfaces.NamingContextFactory
  • providerURL - jnp://localhost:1099
  • urlPkgPrefixes org.jboss.naming:org.jnp.interfaces
That should do it. Enjoy!

Monday, 30 July 2012

Who is using a high-performance JVM

After almost two decades in IT, at numerous clients in any and all sectors, system performance has run as red thread at just about every site that passed my path. Performance tests has been been made and sometimes even evaluated and acted upon in an acceptable fashion. At some sites there has been critical situations and at other there has been no problems at all. At the sites where problems has been identified, resources has (after a while) been poured in, in terms of bodies and silicone to rectify the problem. A quick solution has often been to "just" add more hardware. In some cases lots of time and money has been spend to analyze the problem and doing everything from specific performance enhancing fixes to complete re-designs and re-implementations of the systems in question to navigate around resource hogs.

Nowhere though, in all this time, at any of these locations, among all theses people, has the solution - or even idea of solution - existed to utilize a high-perfoming JVM. This could be due to that the existing available solutions aren't mature and good enough for the problems at large, cost or just ignorance.

Maturity certainly seems to have been a factor of the past but to date ignorance still appears to be the strongest.

After reading up about Oracle JRockit, I'm exited to try it out on a (or several) live system. This will one of the major goals of the remainder of the year. Expect results to be published here.

Friday, 29 June 2012

JavaOne Redux

It was back in 1997 that I started out using that cool new programming language called Java. As a young developer, the language quickly became the core of my toolbox,  but it wasn't until a few years later that things really started to kick off for me and Java...

In 1999 I got to attended JavaOne hosted by Sun Microsystems in San Francisco. What an amazing conference - and city - that was! The sheer amount of attendees and the quality of speakers and exhibitors has from my experience and as a whole still to been met. -And that huge old yellow conference t-shirt is still around as a token of my faithfulness and the indestructible foundations of Java and the community.

Perhaps was it those days in the bay i California that made me dedicate most of my resources and life for the Java ecosystem. And although I've always kept an open mind to other technologies, using Java has just always made me feel good. I especially remember coming home bubbling with ideas and inspiration, taking on any and all sorts of little projects - like doing some quick application for the Palm devices, using the KVM v0.7, that could send data between devices over IR. -Those were the days! :-)

As Java EE came into my world things got both good and bad. The first versions were... well... not so good. -EJB 1.0, 1.1, 2.0 or even 2.1 anyone? *Brr...* Now however, the EE stack has truly matured. It has an enormous support among almost all major vendors and is the choice in most major and serious businesses. The lightweight alternatives are not be brushed aside though! They are many, have a very strong support and are of equal value in their own applicable areas as the EE are in its. This flexibility and strength come from the huge amount of existing Java-based technologies. You can just choose exactly what you want for the situation you're in - or you can naturally write it yourself if noting exist or just isn't good enough in your eyes. In the Java community, evolution and progress never ever stops! 

Now, with much over a decade away from the conference where it all began, I will once again attend JavaOne in San Francisco. This time the huge corporation Oracle will host the conference as the current prime caretaker of the platform Java has evolved into. To say that I'm psyched about the whole thing is a clear understatement.

During the conference days I will make daily reports available at this blog and in-between I'll tweet quick and short comments more frequently as swesource.

Stay tuned and/or see you there!

JavaOne, hosted by Oracle, will be in San Francisco, CA, USA, September 30th - October 4th, 2012. 

Saturday, 14 April 2012

Twiddle Standalone

standalone-twiddle - a standalone version of JBoss Twiddle (CLI based JMX client for e g shell scripted data retrieval) has just been released. Can be used for e g AS7. See and

Tuesday, 28 February 2012

sample-maven-hierarchical released

OSS release: sample-maven-hierarchical - a sample project for exemplifying hierarchical project structures in Apache Maven 3 - is now available! It is currently JEE6 compliant.

Friday, 24 February 2012

sample-maven released

OSS release: sample-maven - a sample project for exemplifying the functionality in Apache Maven 3 - is now available! Expect evolution and more related to come!

Friday, 17 February 2012

Building AS 7.1.0.Final and running its test suite

How to build JBoss AS 7.1.0.Final from source, how to build its test suite and how run the test suite is now described in detail on my JBoss Community blog.

Sunday, 12 February 2012

Building AS 6.1.0.Final and running its test suite

How to build JBoss AS 6.1.0.Final from source, how to build its test suite and how run the test suite is now described in detail on my JBoss Community blog.

Saturday, 11 February 2012

Building AS 5.1.0.GA and running its test suite

How to build JBoss AS 5.1.0.GA from source, how to build its test suite and how run the test suite is now described in detail on my JBoss Community blog.

Wednesday, 1 February 2012

My black mistress

I have a mistress of sorts. She is very black. At frequent times, she shows up in my life. All chosen at her own convenience and pleasure it appears. As she slides in through the door to my bedroom - or wherever she shows up - she takes me in, measures and weighs me with her gaze. After that she slowly and smoothly floats over me. She climbs on top of me. Weighs me down. She plays around with me. Pokes at me. Grabs my pump. The grip is firm but not to hard. She feels at its scars. Some are self-inflicted obviously. Most others put there by others through the ages. I gasps as she presses it tightly with her cold grip. I try to be strong but in the end I always beg for her to let me come with her. It is not from fear, neither of apathy. I just know then and there that it is the right thing to do because it will set me free. But by then she usually stops. She unmounts and never ever takes her eyes of me as she leaves for her next lover. Her satisfied saying "later..." in my mind. She knows she can have me any time but she can and will wait for me to ripe even more. She is Death and she will prevail.