Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to read TLD "META-INF/c.tld"

there's this issue with JSTL I'm stuck with for the past couple of days. Any help is appreciated.

Tomcat 6.0.28
Eclipse: Helios

pom.xml :

 <dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.1.2</version>
 </dependency>
 <dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>servlet-api</artifactId>
  <version>2.4</version>
  <scope>provided</scope>
</dependency>
<dependency>   
  <groupId>taglibs</groupId> 
  <artifactId>standard</artifactId> 
  <version>1.1.2</version> 
</dependency>
<dependency>   
  <groupId>javax.servlet.jsp</groupId> 
  <artifactId>jsp-api</artifactId> 
  <version>2.0</version>
  <scope>provided</scope>
</dependency>

JSP:

<%@ page session="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="utilfn" uri="/utility-functions" %>

web.xml:

<web-app id="WebApp_ID" version="2.4" 
 xmlns="http://java.sun.com/xml/ns/j2ee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

When I deploy the Maven-built war on tomcat 6 using the manager it works fine. When I run it as "Run As > Run On Server" inside eclipse, I get this:

Unable to read TLD "META-INF/c.tld" from JAR file "file:/<- location ->/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Myproject/WEB-INF/lib/standard-1.1.2.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

Wherever I look, it says the same thing:

  1. Make sure servlet-api and jsp-api are not in lib
  2. Make sure to use the right JSTL version and URI that goes with JSP 2.0.

And they seem to be fine as I can deploy the war independently. So what's wrong here!?

like image 571
DS. Avatar asked Aug 10 '10 18:08

DS.


2 Answers

After i moved using Indigo Eclipse 3.7 and took the lasted update of m2e, this problem happened to me, i remove the dependency below it worked well.

<dependency>
  <groupId>javax.servlet.jsp</groupId>
  <artifactId>jsp-api</artifactId>
  <version>2.1</version>
  <scope>provided</scope>
</dependency>

I'm not sure why the issues was gone, as my understanding new version of m2e has jsp compilation library already.

like image 52
Sobree Maenchi Avatar answered Oct 18 '22 13:10

Sobree Maenchi


remove :
javax.servlet.jsp jsp-api 2.0 provided

from you pom.xml and that should do.. it worked in my case :-)

like image 25
Alok Avjeet Avatar answered Oct 18 '22 13:10

Alok Avjeet