Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

spring - 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!?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...