Tomcat 7.x has introduced a class called
TomcatURLStreamHandlerFactory where the singleton has a static
instance field and a final
registered attribute which are not always in sync and cause unexpected exceptions. Due to this, it is not possible to execute Tomcat 7.x and Tomcat 8.x embedded in the same JVM, in addition running one of these Tomcat embedded versions one after the other within the same JVM but different classpaths might also fail.
If you want to be safe, prefer using the Installed Container.