Bug 30051 - Explicit dependency to Xerces breaks JSTL xml tags with J2SE 1.5
Summary: Explicit dependency to Xerces breaks JSTL xml tags with J2SE 1.5
Status: RESOLVED DUPLICATE of bug 30050
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.1.0
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-12 14:01 UTC by Henrik Eriksson
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Eriksson 2004-07-12 14:01:13 UTC
SYMPTOM:

Exception when using JSTL XML transform tags on Tomcat 5.0.25 and J2SE 1.5 
Beta 2 without Tomcat-bundled XML parser

exception 

javax.servlet.ServletException: javax.servlet.jsp.JspException: Can't create 
default XMLReader; is system property org.xml.sax.driver set?
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException
(PageContextImpl.java:821)
	org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:758)
	org.apache.jsp.xml.Transform_jsp._jspService(Transform_jsp.java:135)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:298)
	org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


root cause 

org.xml.sax.SAXException: Can't create default XMLReader; is system property 
org.xml.sax.driver set?
	org.xml.sax.helpers.XMLReaderFactory.createXMLReader
(XMLReaderFactory.java:155)
	org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource
(Unknown Source)
	org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource
(Unknown Source)
	org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag
(Unknown Source)
	org.apache.jsp.xml.Transform_jsp._jspx_meth_x_transform_0
(Transform_jsp.java:224)
	org.apache.jsp.xml.Transform_jsp._jspService(Transform_jsp.java:89)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:298)
	org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


STEPS TO REPRODUCE:
 1) Install J2SE 1.5 Beta 2 as only JVM (just to make sure)
 2) Intall Tomcat 5.0.x (I used 5.0.25)
 3) Remove Tomcat's bundled Xerces XML parser and API definitions from 
$CATALINA_HOME$/common/endorsed
 4) Start Tomcat
 5) Deploy JSTL examples (standard-examples.war) to Tomcat
 6) Visit http://localhost:8080/standard-examples/xml/Transform.jsp

CAUSE:
JSTL tries to use hard-wired Xerces parser which is distributed under new 
package name in J2SE 1.5. See  
http://java.sun.com/j2se/1.5.0/docs/guide/xml/jaxp/JAXP-Compatibility_150.html

REMEDY:
Remove explict dependency to Xerces from JSTL
Comment 1 Justyna Horwat 2004-07-15 21:26:12 UTC
When moving to the JAXP 1.3 API's this bug will also be addressed. I'm going to mark it as a duplicate of 
30050 and so the two can be tracked together and assigned to me.

As an aside, I noticed that there was a problem with the J2SE 5.0 Beta2 (build 51) with 
XMLReaderFactory not properly creating the default XMLReader. This problem has since been addressed 
in later builds like 56 and 57.

*** This bug has been marked as a duplicate of 30050 ***