were u able to resolve that issue. I am facing the same problem of getting a nullpointer exception when i try to get the factory.
Let me know if you could resolve this and if so how.
If you're running your sample code inside JBoss you only need to create a default InitialContext object.
Context context = new InitialContext();
If you're running for a separate process, you need to set the property that are inside $JBOSS_HOME/server/default/conf/jndi.properties and only those