tomcat 8 common.loader server.loader shared.loader [英] tomcat 8 common.loader server.loader shared.loader

查看:47
本文介绍了tomcat 8 common.loader server.loader shared.loader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 tomcat 8,在

I'm using tomcat 8, in

tomcat-home/config/catalina.properties

tomcat-home/config/catalina.properties

,有关于

common.loader、server.loader 和 shared.loader

common.loader, server.loader and shared.loader

但是,关于类加载器的 tomcat 文档(https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html),只有关于common.loader的描述.

However, on tomcat document about class loader(https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html), there is only has description about common.loader.

那么这三个加载器有什么区别呢?(我知道 common class loader 包含对 Tomcat 内部类和所有 Web 应用程序都可见的附加类.通常,应用程序类不应放置在这里.如果留空,server.loader 和 shared.loader 将使用common.loader config.webapp common jar可以放在shared.loader中.但是还有什么区别吗?比如common.loader和server.loader,server.loader和shared.loader等等的区别?)>

So what are differences between these 3 loader? (I know common class loader contains additional classes that are made visible to both Tomcat internal classes and to all web applications. Normally, application classes should NOT be placed here. If left blank, server.loader and shared.loader will use common.loader config. Webapp common jar can be placed in shared.loader. But what are other differences? such as differences between common.loader and server.loader, server.loader and shared.loader etc?)

推荐答案

(可能正是因为这种混淆)默认情况下不再使用它们.服务器类路径曾经包含只对服务器可用,但对任何 Web 应用程序不可用的类.我希望它是正确的:公共加载器包含可用于每个 Web 应用程序服务器的类,而共享加载器包含可用于所有 Web 应用程序但不是服务器的类.

(Probably precisely because of this confusion) they're no longer used by default. The server classpath used to contain classes that were only available to the server, but not to any web application. I hope to get it right: The common loader contains classes available to every web application and the server, while the shared loader contained classes available to all web applications, but not the server.

这里是龙 - 不要去那里.内存很便宜 - 不要使用这些构造来更优化地放置一些罐子".默认值(如果您使用 JNDI 资源,则 JDBC 驱动程序除外)应该是:Jars 在您的 Web 应用程序中.

Here be dragons - don't go there. Memory is cheap - don't use those constructs to "place some jars more optimally". The default (other than for JDBC drivers if you use JNDI resources) should be: Jars are in your web application.

它们不再被使用是有原因的.原因是您的安装的可理解性和可维护性.应用程序之间共享的代码有很多意想不到的副作用.

They're no longer used for a reason. And the reason is understandability and maintainability of your installation. There are a lot of unexpected side effects with code that's shared between applications.

这篇关于tomcat 8 common.loader server.loader shared.loader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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