Updated code ignoring jndi factory