Reusing Juan Melo's custom implementation of ObjectFactory interface (CustomMongoJNDIFactory), it can be also configured using jndi-lookup tag of Spring's jee namespace and corresponding Tomcat config in context.xml file, like this:
spring-mongodb-persistence-context.xml:
context.xml: