基本问题的复杂解决方案-Tomcat到JBoss [英] Basic question complicated solution - Tomcat to JBoss

查看:95
本文介绍了基本问题的复杂解决方案-Tomcat到JBoss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么tomcat不能很好地读取我的web-inf / lib目录中存在tld文件的JSTL jar,但是当我移至jBoss 5时却无法读取?



是类加载器问题吗?



我尝试研究,但是没有明确的答案。我读了一篇与类加载器相关的文章,但不确定如何将其实际应用到我的应用程序中。



任何帮助将不胜感激。 b

预先感谢
Asif

解决方案

Tomcat是一个简单的JSP / Servlet容器,它随JSP和仅限Servlet API。 JBoss是功能更完善的Java EE应用程序服务器,几乎包含整个Java EE API(包括JSTL)。



当您将JSTL与您自己的Web应用程序一起交付时,它的API / impl版本将与JBoss已经使用的版本冲突,这是一个很大的问题。 JBoss将加载自己的JSTL API( jstl.jar ),但是Webapp将加载JSTL impl( standard.jar )。实际上,您应该从Web应用程序中删除JSTL JAR并使用JBoss。为了使JSTL也可以在Tomcat上的同一Web应用程序上运行,您还可以将JAR添加到Tomcat自己的 / lib 文件夹中。这样,每个部署到Tomcat的Web应用程序都将能够利用JSTL,而无需在 / WEB-INF / lib 中包含JAR。


Why can't the JSTL jars having tld files present in my web-inf/lib directory be read nicely by tomcat but not when i move to jBoss 5?

Is it a classloader issue?

I tried researching but there exists no clear answer. I read a huge classloader related article but not sure how that applies practically to my application.

Any help would be appreciated.

Thanks in advance Asif

解决方案

Tomcat is a simple JSP/Servlet container which ships with JSP and Servlet APIs only. JBoss is a more full fledged Java EE application server which ships with almost the entire Java EE API, including JSTL.

When you ship JSTL along with your own webapp, then chances are big that its API/impl version will conflict with the one which JBoss is already using. JBoss will load its own JSTL API (the jstl.jar), but the webapp will load the JSTL impl (the standard.jar). You should actually remove the JSTL JARs from your webapp and utilize the JBoss ones. In order to get JSTL to work for the same webapp on Tomcat as well, you could also add the JARs to Tomcat's own /lib folder. This way every webapp deployed to Tomcat will be able to utilize JSTL without the need to include the JARs in /WEB-INF/lib.

这篇关于基本问题的复杂解决方案-Tomcat到JBoss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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