A stream handler factory can be registered once per VM and tomcat registers the DirContextStreamHandlerFactory for the jndi protocol. However if there are web applications running inside that want to register handlers for custom scheme currently it is not possible. Can the DirContextStreamHandlerFactory be enhanced to allow applications to register stream handler for custom schemes they might have. Or better can this be a made a property in the context.xml file ? Is this already there - or can this enhanced in the future?
This has been fixed in 7.0.x and will be included in 7.0.11 onwards. Add as many factories as you wish using: DirContextURLStreamHandlerFactory#addUserFactory(URLStreamHandlerFactory factory) The class loader hierarchy means that the factory will have to be in $CATALINA_BASE/lib.
I would add that adding stream handlers via the java.protocol.handler.pkgs system property was and remains an alternative option.