将jar文件保存在WAR和Tomcat lib文件夹之间的区别 [英] Difference between keeping jar files in WAR and Tomcat lib folder

查看:258
本文介绍了将jar文件保存在WAR和Tomcat lib文件夹之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Web应用程序.我想要该应用程序中的Eclipse BIRT报告. 如果我将BIRT jar文件添加到Tomcat库中,Tomcat甚至不会因内存错误而启动.

I have web application. I want Eclipse BIRT reports in that application. Tomcat is not even started by memory error if i add BIRT jar files into Tomcat lib.

If build WAR with that jars only application runs

有什么区别,这是什么背后的问题?

What is the difference and what is the problem behind this?

推荐答案

所有WAR文件都可以看到Tomcat/lib中的JAR.

Jars in Tomcat/libs are visible to all WAR files.

通常,无需将JAR放置在Tomcat/lib中.只有当您的WAR文件很大(例如50 MB以上)并且其中大部分是第三方JAR时,才可以执行此操作.在这种情况下,您可以将不属于源代码的所有JAR(例如Spring,Hibernate等)移至Tomcat/Lib并部署轻量级的WAR.仅对于登台/测试/生产系统才需要.

Generally there is no need to place JARs in Tomcat/libs. Only time one would do this is when your WAR file is very big (say 50 MB+) and bulk of it is third-party JARs. In such cases, you can move all the JARs that are not part of your source code like Spring, Hibernate, etc. and move them to Tomcat/Lib and deploy a much light-weight WARs. This may be needed only for Staging/Test/Production systems.

这篇关于将jar文件保存在WAR和Tomcat lib文件夹之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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