在tomcat中部署的war中你有两次相同的类会发生什么? [英] What happens when you have the same class twice in a war deployed in tomcat?

查看:120
本文介绍了在tomcat中部署的war中你有两次相同的类会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在tomcat中部署的war中有两次相同的编译类会发生什么?
(我知道这不是一个好习惯,等等,但幕后会发生什么?)

是否有可能出现令人讨厌的副作用?

What happens when you have the same compiled class twice in a war deployed in tomcat? (I know it's not a good practice and so on, but what happens behind the scene?)
Are there chances of nasty side-effects?

推荐答案

我希望这种情况与你遇到的其他任何情况一样。

I would expect the behaviour is the same as anywhere else you have that situation.

头等舱将使用类加载器找到的,另一个将被忽略。

The first class found by the class loader will be used, the other will be ignored.

这篇关于在tomcat中部署的war中你有两次相同的类会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆