简体   繁体   English

在具有不同弹簧的单个tomcat服务器上进行多次战争

[英]multiple wars on a single tomcat server with different spring

I have two WAR files that i need to deploy on a server. 我需要在服务器上部署两个WAR文件。
the catch is that i cant run another tomcat on that server. 问题是我无法在该服务器上运行另一个tomcat。
deploying two WAR files is easy but, is it possible to run them both while one of them uses 部署两个WAR文件很简单,但是可以在其中一个使用时运行它们

Spring 3.8 春季3.8

and the other one uses 而另一个使用

Spring 4.1.4 春季4.1.4

which is the latest version? 哪个是最新版本?

Will it conflict? 它会发生冲突吗?
answers like "try it out" are acceptable :) but i need to know for sure so i wont have issues in the future. 像“试一试”这样的答案是可以接受的:)但我需要确定,所以我将来不会有问题。
Thanks 谢谢

See the following for an explanation of how Tomcat's classloading mechanism works: 有关Tomcat的类加载机制如何工作的说明,请参阅以下内容:

http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html 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. WebappX - 为部署在单个Tomcat实例中的每个Web应用程序创建一个类加载器。 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 . Web应用程序的/ WEB-INF / classes目录中的所有解压缩的类和资源,以及Web应用程序的/ WEB-INF / lib目录下的JAR文件中的类和资源, 都对此Web应用程序可见,但不是到其他人

If, then, the Spring Jar files are bundled in WEB-INF/lib for each application then you will have no issues. 然后,如果将Spring Jar文件捆绑在WEB-INF / lib中,则每个应用程序都没有问题。 An issue would only arise if they were in some shared location. 只有在某个共享位置才会出现问题。

two different application under tomcat has two diffferent classpath and classloader so they don't conflict tomcat下的两个不同的应用程序有两个不同的classpath和classloader,因此它们不会发生冲突

latest as of today is 4.2.0 (under dev), you can keep track at http://projects.spring.io/spring-framework/ 截至今日最新版本为4.2.0(在开发版下),您可以在http://projects.spring.io/spring-framework/上查看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM