简体   繁体   中英

JBoss 6x The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

I have a web application (its a ear file) in JBoss 6x.

Error Message on accessing JSP Page: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

JSP

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

web.xml

<web-app      
    xmlns="http://java.sun.com/xml/ns/javaee"    
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"     
    version="3.0">

WEB-INF\\lib contains

jstl-1.2.jar

Please advice, what am i doing wrong here? Thanks

The problem turned out to be with Classloaders behavior in JBoss 6x for .ear (enterprise archive). My ear file has a war inside it, which ends up using its own classloader - that always looks for jar files only in WEB-INF\\lib.

My jstl-1.2.jar was in JBOSS_HOME\\server\\domain\\lib All jars in this location are visible to .ear, but not to the .war inside it. Therefore JSP could not find jstl-1.2.jar

Once i placed the jstl-1.2.jar in WEB-INF\\lib in the war, the error went away. This explains the problem and immediate solution.

Although i would like to have a single class-loader for the entire .ear (not a different one for .war) - not sure how to do that - but that is a different question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM