Hashtable ctxProperties = new Hashtable();
ctxProperties.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
ctxProperties.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
JavaCompInitializer initializer = new JavaCompInitializer();
initializer.setInitialContextProperties(ctxProperties);
initializer.start();
DummyTransactionManager tm = new DummyTransactionManager();
InitialContext ic = new InitialContext(ctxProperties);
ic.bind("java:/TransactionManager", tm);