Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

So I was working with JSTL in OSGi, under Gemini runtime. And I'm getting following exception, when I try to access the url to my servlet: -

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /WEB-INF/login.jsp (line: 3, column: 66) Unable to read TLD "META-INF/c.tld" from JAR file "file:/D:/OSGi%20Runtime/Gemini/gemini-web/dep/com.springsource.javax.servlet.jsp.jstl-1.2.0.v20110728.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

However, I have checked, that I already have all the necessary bundles in my runtime. The relevant bundle that I have is: -

71  ACTIVE      javax.servlet_3.0.0.v201103241009
73  ACTIVE      javax.el_2.2.0.v201105051105
74  ACTIVE      javax.servlet.jsp_2.2.0.v201103241009
75  ACTIVE      com.springsource.javax.servlet.jsp.jstl_1.2.0.v20110728
121 ACTIVE      com.springsource.org.apache.taglibs.standard_1.1.2.v20110517

There are more bundles, but those are the ones that are relevant. So, I can't understand what went wrong.

From the Spring Source Repository, from where I downloaded the bundle, it's clear that, org.apache.taglibs.standard bundle - Bundle 121, contains that JstlCoreTLV class. So, not sure, what's going on here.

Here's my JSP header I'm using (Just in case, it is relevant): -

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

I'm using: -

  • Servlet 3.0
  • JSP 2.2
  • Gemini Runtime 2.1
  • JSTL 1.2.0

Update: -

The problem described below seems to be solved, and now I'm not getting any warning as shown below. That was because, I was having the taglibs.standard_1.1.2 - (Bundle 121), which was incompatible to others. So, I removed it, and the warnings went away.

So, you can ignore whatever is there from here on. But, The problem above is still there. I'm still getting that JasperException. May be this will help further, as the problem domain is reduced now a little bit thanks to the valuable input from @BalusC.


Part after this is solved. So, you can ignore it: -

Also, I'm not sure that the version of the OSGi JSTL bundle that I have - Bundle 75, is compatible with the other bundles - javax.el, taglibs, servlets, etc, or not. Because I was using JSTL 1.2.1, but I couldn't get the bundle for JSTL 1.2.1. What I got was the bundle I used (JSTL 1.2.0). Why this is bothering me is because of these kinds of messages coming up, when I start my application: -

Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Jan 22, 2013 7:14:05 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined

As you can see that there two different URLs shown above: -

  • URI: http://java.sun.com/jstl/core
  • URI: http://java.sun.com/jsp/jstl/core

Now, AFAIK both those URLs, do not belong to same JSTL versions. So, could that raise some problems? And what can be the reason for them to come? I have just used one JSTL bundle.

like image 720
Rohit Jain Avatar asked Jan 22 '13 13:01

Rohit Jain


1 Answers

com.springsource.javax.servlet.jsp.jstl_1.2.0.v20110728
com.springsource.org.apache.taglibs.standard_1.1.2.v20110517

You're mixing JSTL 1.2.0 API+impl with JSTL 1.1.2 impl.

The both impls are conflicting with each other which explains all the trouble you're seeing.

Get rid of the 1.1.2 impl.

See also:

  • Our JSTL wiki page
like image 169
BalusC Avatar answered Nov 20 '22 16:11

BalusC