Running multiple Tomcat 7.x / Tomcat 8.x / Tomcat 9.x / Tomcat 10.x embedded containers within the same JVM
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, Tomcat 8.x, Tomcat 9.x and Tomcat 10.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. Also note that Tomcat 11.x onwards has gotten rid of that class.