2

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

Asif
  • 1,288
  • 1
  • 16
  • 27

1 Answers1

4

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Now after doing that i still have the same issue http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application.However, when i have a new webapp that has 1 JSP that has a JSTL call and no JSTL jars in WEB-INF/lib and this works like a charm. But for the app that i moved from tomcat the same solution fails. That one is a SPRING+TILES appl with some custom tld files present in tld folder and corresponding entries in web.xml.I tried removing the custom tlds and entries and the error doesn't change.Any suggestions?Thanks for your time. – Asif Sep 29 '11 at 23:41
  • Also, when i copy all jars from the application that fails to application that works i.e. the new application that i created, the new application still works. – Asif Sep 29 '11 at 23:43
  • FWIW: `find /c/_/jboss-eap-6.1 -name *jstl*.jar` yields `/c/_/jboss-eap-6.1/modules/system/layers/base/javax/servlet/jstl/api/main/jboss jstl-api_1.2_spec-1.0.3.Final.jar`. This contains the implementation too has a `\org\apache\taglibs\standard` tree (the api in its name is a bit confusing). Still asking for a way to this with 1.2.1: http://stackoverflow.com/questions/24262223/recommended-way-for-adding-jslt-1-2-1-in-a-maven-project – Mr_and_Mrs_D Jun 19 '14 at 11:50