我有两个 WAR 文件需要部署在服务器上。
问题是我无法在该服务器上运行另一个 tomcat。
部署两个 WAR 文件很容易,但是,是否可以在其中一个使用时运行它们
Spring 3.8
另一个使用
Spring 4.1.4
哪个是最新版本?
会冲突吗?
像“尝试一下”这样的答案是可以接受的:)但我需要确定,这样我将来就不会遇到问题。
谢谢
最佳答案
有关 Tomcat 类加载机制如何工作的说明,请参阅以下内容:
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
WebappX — A class loader is created for each web application that is deployed in a single Tomcat instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application, are made visible to this web application, but not to other ones.
如果每个应用程序的 Spring Jar 文件都捆绑在 WEB-INF/lib 中,那么您将不会遇到任何问题。只有当他们位于某个共享位置时才会出现问题。
关于java - 具有不同 spring 的单个 tomcat 服务器上的多个 war ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28593879/