Plain simple: you can only access JNDI names form "java:" when you are running inside the application server (EJB, Servlets, JSPs, MBeans) but not from an outside client.
Have fun - Andy
I run the program with "XAConnectionFactory" and then with "ConnectionFactory" but i am getting java.lang.NullPointerException
This program is running fine in Jboss2.4.4
I use the default configuration of JBoss 3.0 and 3.1 and on both the program can lookup XAConnectionFactory as well as java:XAConnectionFactory (it fails later but that's another story).
Please use the HTML-Adaptor (http://localhost:8082), find the MBean named JNDIView, click on it and then on the "list" butten and send me your output.
BTW which OS are you using ?