简体   繁体   中英

multiple wars on a single tomcat server with different spring

I have two WAR files that i need to deploy on a server.
the catch is that i cant run another tomcat on that server.
deploying two WAR files is easy but, is it possible to run them both while one of them uses

Spring 3.8

and the other one uses

Spring 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:

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 .

If, then, the Spring Jar files are bundled in WEB-INF/lib for each application then you will have no issues. 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

latest as of today is 4.2.0 (under dev), you can keep track at http://projects.spring.io/spring-framework/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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