Basic question complicated solution - Tomcat to JBoss

◇◆丶佛笑我妖孽 提交于 2020-01-25 12:38:58

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/7562890/basic-question-complicated-solution-tomcat-to-jboss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!