Bug 24776 - org.apache.taglibs.standard.tag.common.xml.XPathUtil.JstlVariableContext deriving from final class
Summary: org.apache.taglibs.standard.tag.common.xml.XPathUtil.JstlVariableContext deri...
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.1
Hardware: Other All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2003-11-18 11:37 UTC by Sebastian Redl
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Redl 2003-11-18 11:37:01 UTC
Taglibs: Taglibs Standard 1.1.0-B1
Tomcat: 5.0.14
J2SE: 1.4.1_02
Xalan: 2.5.2 or whatever version comes with my JRE

It seems that the class mentioned in the summary derives from
org.apache.xpath.VariableStack, which is part of Xalan. This class, however, is
declared as final in both tested Xalan versions and XPathUtil thus fails to
load. This renders all xml jstl tags unusable.

Steps to reproduce:
1) Add any xml jstl tag with a select attribute to a jsp page.
2) Try to view the page. A ServletException as the result of a ValidationError
will occur. Origin comes down to the place where XPathUtil is instantiated.

Proposed solution:
If no component tries to cast the JstlVariableStack to a VariableStack,
aggregation instead of derivation would suffice. Otherwise a change to Xalan
might be required.
Comment 1 Sebastian Redl 2003-11-18 12:04:20 UTC
Ok, seems to me like I was wrong. Anyone knows how to prevent java from loading
the Xalan version in rt.jar?

Comment 2 Pierre Delisle 2003-11-18 13:01:36 UTC
As stated in the README file of Taglibs Standard 1.1.0-B1:


This version of the Standard Tag Library has the following runtime

   1. Dependencies provided by the JSP 2.0 container:
      - Servlet 2.4
      - JSP 2.0

   2. Dependencies provided in newer J2SEs (1.4.2 and higher)
      - JAXP 1.2 
      - Xalan 2.5 
      - JDBC Standard Extension 2.0

Since all of the dependencies in (2) are included in Sun's
distribution of J2SE 1.4.2 (and higher), this is therefore the J2SE
version of choice to use the standard tag library.

If the java platform under which you run your JSP container does not
provide these dependencies, they must be made available either globally
to all web-applications by your container, or individually within the
WEB-INF/lib directory of your web-application.

For convenience, these jar files have been included in directory 
lib/old-dependencies of this distribution (assuming the build process
of this distribution included them). If you would like to download
these jar files yourself, instructions on where you can get them are 
included below.

JAXP 1.2

The JAXP 1.2 jar files can be obtained in the Java Web Services
Developer Pack (JWSDP) available at 

  - jaxp-api.jar
  - dom.jar
  - sax.jar
  - xercesImpl.jar

Xalan 2.5

The Xalan jar file can be obtained in the Java Web Services
Developer Pack (JWSDP) available at 
http://java.sun.com/products/jwsdp, as well as from 
Apache at http://xml.apache.org/xalan-j.

  - xalan.jar

Please note that if you use Sun's distribution of J2SE 1.4.1, you must
supersede the version of xalan.jar provided by the J2SE with version
2.5 or higher of Xalan.  This newer version of xalan.jar must then be
made available through the endorsed dirs mechanism.