  | |  | Xalan and jstl 1.1 problem with transform tag | Xalan and jstl 1.1 problem with transform tag 2006-10-23 - By Erin Harris
Hi Valeria,
Which level of Xalan are you using? If you are using 2.7.x then you would also need to copy over serializer.jar into the endorsed directory.
Thanks.
Erin Harris
"Valeria P." <valeriapesce@(protected)> 22/10/2006 11:12 AM Please respond to "Valeria P." <valeriapesce@(protected)>
To <xalan-j-users@(protected)> cc
Subject Xalan and jstl 1.1 problem with transform tag
Hallo, I have this problem that I could not solve although I tried all the suggestions I could find in manuals and in forums/lists archives.
I developed a simple XML based document repository using JSTL xml tags 1.0
under Tomcat 4.0. Now I am trying to do the same with Tomcat 5 using JSTL 1.1 but I keep receiving an error message about the instantiation of the transformer:
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.transformer.TransformerImpl could not be instantiated: java.lang.InstantiationException: org.apache.xalan.transformer.TransformerImpl
I did the following to overcome the problem: 1) download the latest versions of xalan.jar, xercesImpl.jar and xml-apis.jar and place them under the WEB-inf directory of my application 2) (just to be sure to override any existing old package including the same classes) place the same files under TOMCAT_HOME/common/endorsed and JAVA_HOME/lib/endorsed 3) add: -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp .DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor .TransformerFactoryImpl both to JAVA_OPTS and CATALINA_OPTS
I also tried the CheckEnvironment method and it appears I am running the correct version of Xalan.
Other details about my test environment: - Windows XP - JRE 1.5.0 - Tomcat 5.5.12 - A CMS compliant with Tomcat 5 and coming with JSTL 1.1 libraries (InfoGlue: www.infoglue.org)
This is my very simple transformer page (very very basic as you can see):
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
<c:import var="xmlText" url="${requestScope.xmlUrl}" /> <c:import var="xslText" url="${requestScope.xslUrl}" /> <c:catch var="ex"> <x:transform xslt="${xslText}" doc="${xmlText}"></x:transform> </c:catch> <c:if test="${not empty ex}"> <c:out value="${ex}" /> </c:if>
The request-scoped variables contain what they should (I tested them importing directly to the page without storing the imported contents in variables).
I really don't know what else to try.
Thank you to those who had the patience to read and to those who will be so kind to reply.
Valeria
<br><font size=2 face="sans-serif">Hi Valeria,</font> <br> <br><font size=2 face="sans-serif">Which level of Xalan are you using? If you are using 2.7.x then you would also need to copy over serializer .jar into the endorsed directory.</font> <br> <br><font size=2 face="sans-serif">Thanks.</font> <br><font size=2 face="sans-serif"><br> <br> Erin Harris<br> <br> </font> <br> <br> <br> <table width=100%> <tr valign=top> <td width=40%><font size=1 face="sans-serif"><b>"Valeria P." <valeriapesce@(protected)></b> </font> <p><font size=1 face="sans-serif">22/10/2006 11:12 AM</font> <table border> <tr valign=top> <td bgcolor=white> <div align=center><font size=1 face="sans-serif">Please respond to<br> "Valeria P." <valeriapesce@(protected)></font></div></table> <br> <td width=59%> <table width=100%> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">To</font></div> <td><font size=1 face="sans-serif"><xalan-j-users@(protected)></font> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">cc</font></div> <td> <tr valign=top> <td> <div align=right><font size=1 face="sans-serif">Subject</font></div> <td><font size=1 face="sans-serif">Xalan and jstl 1.1 problem with transform tag</font></table> <br> <table> <tr valign=top> <td> <td></table> <br></table> <br> <br> <br><tt><font size=2>Hallo,<br> I have this problem that I could not solve although I tried all the <br> suggestions I could find in manuals and in forums/lists archives.<br> <br> I developed a simple XML based document repository using JSTL xml tags 1.0 <br> under Tomcat 4.0.<br> Now I am trying to do the same with Tomcat 5 using JSTL 1.1 but I keep <br> receiving an error message about the instantiation of the transformer:<br> <br> javax.xml.transform.TransformerFactoryConfigurationError: Provider <br> org.apache.xalan.transformer.TransformerImpl could not be instantiated: <br> java.lang.InstantiationException: <br> org.apache.xalan.transformer.TransformerImpl<br> <br> I did the following to overcome the problem:<br> 1) download the latest versions of xalan.jar, xercesImpl.jar and <br> xml-apis.jar and place them under the WEB-inf directory of my application<br> 2) (just to be sure to override any existing old package including the same <br> classes) place the same files under TOMCAT_HOME/common/endorsed and <br> JAVA_HOME/lib/endorsed<br> 3) add:<br> -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp .DocumentBuilderFactoryImpl<br> -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp .SAXParserFactoryImpl<br> -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor .TransformerFactoryImpl<br> both to JAVA_OPTS and CATALINA_OPTS<br> <br> I also tried the CheckEnvironment method and it appears I am running the <br> correct version of Xalan.<br> <br> Other details about my test environment:<br> - Windows XP<br> - JRE 1.5.0<br> - Tomcat 5.5.12<br> - A CMS compliant with Tomcat 5 and coming with JSTL 1.1 libraries <br> (InfoGlue: www.infoglue.org)<br> <br> This is my very simple transformer page (very very basic as you can see):<br> <br> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c " %><br> <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x " %><br> <br> <c:import var="xmlText" url="${requestScope.xmlUrl}" /><br> <c:import var="xslText" url="${requestScope.xslUrl}" /><br> <c:catch var="ex"><br> <x:transform xslt="${xslText}" doc="${xmlText}" ></x:transform><br> </c:catch><br> <c:if test="${not empty ex}"><br> <c:out value="${ex}" /><br> </c:if><br> <br> The request-scoped variables contain what they should (I tested them <br> importing directly to the page without storing the imported contents in <br> variables).<br> <br> I really don't know what else to try.<br> <br> Thank you to those who had the patience to read and to those who will be so <br> kind to reply.<br> <br> Valeria<br> <br> </font></tt> <br>
|
|
 |