Thanks, I had looked at the test case. I then wrote a very similar piece of code but was getting the exception that it could not create an instance of null.
It would seem to me, based on the JAX documentation, that the appropriate way to get hold of the ConnectionFactory would be via JNDI lookup. I am able to do this, as mentioned in my initial post, but then the NullPointer.
Are you saying that the JBoss implementation does not support straightforward JNDI lookup to establish a connection?