  | |  | Error when switching to java 1.5 | Error when switching to java 1.5 2006-10-30 - By Erin Harris
Hi,
There is something in the archives that looks similar - could it be the same problem?
http://mail-archives.apache.org/mod_mbox/xerces-j-users/200412.mbox/ %3c64EE0DBA15556341AF577C102564465D09D6DD@(protected)%3e
Erin Harris
footh <footh@(protected)> 27/10/2006 03:15 PM
To xalan-j-users@(protected) cc
Subject Re: Error when switching to java 1.5
Erin,
Thanks for the response.
I just tried doing it via the command line and it worked fine.
So, it appears that the problem is somewhere with the Tomcat/Cocoon setup. I've tried running it with the xalan library in the Tomcat endorsed directory and that didn't help. As it stands, the libraries are in the WEB-INF directory for the application. Below is the relevant portion of the stack trace (i've ommited the lines above which are cocoon-related:
Caused by: javax.xml.transform.TransformerException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2416) at org.apache.xalan.templates.ElemElement.constructNode(ElemElement.java:339) at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:288) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode (TransformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java :1367) at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3458) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument (TransformerHandlerImpl.java:406) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer .java:585) ... 52 more Caused by: java.lang.NullPointerException at org.apache.xml.serializer.SerializerBase.getPrefix(SerializerBase.java:867) at org.apache.xalan.templates.ElemAttribute.resolvePrefix(ElemAttribute.java:131) at org.apache.xalan.templates.ElemElement.execute(ElemElement.java:241) at org.apache.xalan.templates.ElemAttribute.execute(ElemAttribute.java:108) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411) ... 73 more
--- Erin Harris <eharris@(protected)> wrote:
> Hi, > > I couldn't get this to fail when running from the > command line: > > java -Djava.endorsed.dirs=d:\xalan-j_2_7_0 > org.apache.xalan.xslt.Process > -xsl test.xsl -in test.xml > > Does it fail for you when running from the command > line as well or only > when running within Tomcat? Are you using the > Tomcat endorsed directory ( > <Tomcat_Home>\common\endorsed )? > > Did you get a stack trace with the exception? > > > Thanks. > > > Erin Harris > > > > > > footh <footh@(protected)> > 25/10/2006 05:47 PM > > To > xalan-j-users@(protected) > cc > > Subject > Error when switching to java 1.5 > > > > > > > I am using an identity template that removes > namespaces in a Cocoon application that runs under > Tomcat. Previously, I was using Java 1.4.2 but once > I > switched to Java 1.5 I receive a null pointer > TransformerException. Following is the identity > template that matches all nodes. The error occurs > on > the "apply-templates" tag. On the "select" > attribute, > the presence of the "@*" symbol causes the error. > If > I remove it, everything is fine. However, then > attributes of nodes are not rendered. Has anyone > encountered this problem before? Any suggestions? > > <xsl:template match="*"> > <xsl:element name="{name()}" > namespace="{namespace-uri()}"> > <xsl:apply-templates select="@*|node()" /> > </xsl:element> > </xsl:template> > > I've tried throwing in different versions of Xalan > jars to no avail. Currently, I'm using 2.7.0. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > >
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
<br><font size=2 face="sans-serif">Hi,</font> <br> <br><font size=2 face="sans-serif">There is something in the archives that looks similar - could it be the same problem?</font> <br> <br><a href="http://mail-archives.apache.org/mod_mbox/xerces-j-users/200412 .mbox/%3c64EE0DBA15556341AF577C102564465D09D6DD@(protected)%3e"> <font size=2 color=blue face="sans-serif">http://mail-archives.apache.org/mod _mbox/xerces-j-users/200412.mbox/%3c64EE0DBA15556341AF577C102564465D09D6DD@(protected) -server.javector.com%3e</font></a><font size=2 face="sans-serif"><br> </font> <br><font size=2 face="sans-serif"><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>footh <footh@(protected)>< /b> </font> <p><font size=1 face="sans-serif">27/10/2006 03:15 PM</font> <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">Re: Error when switching to java 1.5</font>< /table> <br> <table> <tr valign=top> <td> <td></table> <br></table> <br> <br> <br><tt><font size=2>Erin,<br> <br> Thanks for the response.<br> <br> I just tried doing it via the command line and it<br> worked fine.<br> <br> So, it appears that the problem is somewhere with the<br> Tomcat/Cocoon setup. I've tried running it with the<br> xalan library in the Tomcat endorsed directory and<br> that didn't help. As it stands, the libraries are in<br> the WEB-INF directory for the application. Below is<br> the relevant portion of the stack trace (i've ommited<br> the lines above which are cocoon-related:<br> <br> Caused by: javax.xml.transform.TransformerException:<br> java.lang.NullPointerException<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2416)<br> at<br> org.apache.xalan.templates.ElemElement.constructNode(ElemElement.java:339)<br> at<br> org.apache.xalan.templates.ElemElement.execute(ElemElement.java:288)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> at<br> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> at<br> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> at<br> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> at<br> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java :1374)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> at<br> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode (TransformerImpl.java:2281)<br> at<br> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java :1367)<br> at<br> org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3458)<br> at<br> org.apache.xalan.transformer.TransformerHandlerImpl.endDocument (TransformerHandlerImpl.java:406)<br> at<br> org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)<br> at<br> org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer .java:585)<br> ... 52 more<br> Caused by: java.lang.NullPointerException<br> at<br> org.apache.xml.serializer.SerializerBase.getPrefix(SerializerBase.java:867)<br> at<br> org.apache.xalan.templates.ElemAttribute.resolvePrefix(ElemAttribute.java:131) <br> at<br> org.apache.xalan.templates.ElemElement.execute(ElemElement.java:241)<br> at<br> org.apache.xalan.templates.ElemAttribute.execute(ElemAttribute.java:108)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes (ElemApplyTemplates.java:393)<br> at<br> org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java :176)<br> at<br> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates (TransformerImpl.java:2411)<br> ... 73 more<br> <br> --- Erin Harris <eharris@(protected)> wrote:<br> <br> > Hi,<br> > <br> > I couldn't get this to fail when running from the<br> > command line:<br> > <br> > java -Djava.endorsed.dirs=d:\xalan-j_2_7_0<br> > org.apache.xalan.xslt.Process <br> > -xsl test.xsl -in test.xml<br> > <br> > Does it fail for you when running from the command<br> > line as well or only <br> > when running within Tomcat? Are you using the<br> > Tomcat endorsed directory (<br> > <Tomcat_Home>\common\endorsed )?<br> > <br> > Did you get a stack trace with the exception?<br> > <br> > <br> > Thanks.<br> > <br> > <br> > Erin Harris<br> > <br> > <br> > <br> > <br> > <br> > footh <footh@(protected)> <br> > 25/10/2006 05:47 PM<br> > <br> > To<br> > xalan-j-users@(protected)<br> > cc<br> > <br> > Subject<br> > Error when switching to java 1.5<br> > <br> > <br> > <br> > <br> > <br> > <br> > I am using an identity template that removes<br> > namespaces in a Cocoon application that runs under<br> > Tomcat. Previously, I was using Java 1.4.2 but once<br> > I<br> > switched to Java 1.5 I receive a null pointer<br> > TransformerException. Following is the identity<br> > template that matches all nodes. The error occurs<br> > on<br> > the "apply-templates" tag. On the "select"<br> > attribute,<br> > the presence of the "@*" symbol causes the error. <br> > If<br> > I remove it, everything is fine. However, then<br> > attributes of nodes are not rendered. Has anyone<br> > encountered this problem before? Any suggestions? <br> > <br> > <xsl:template match="*"><br> > <xsl:element name="{name()}"<br> > namespace="{namespace-uri()}"><br> > <xsl:apply-templates select="@*|node()" /><br> > </xsl:element><br> > </xsl:template><br> > <br> > I've tried throwing in different versions of Xalan<br> > jars to no avail. Currently, I'm using 2.7.0.<br> > <br> > __________________________________________________<br> > Do You Yahoo!?<br> > Tired of spam? Yahoo! Mail has the best spam<br> > protection around <br> > http://mail.yahoo.com <br> > <br> > <br> <br> <br> __________________________________________________<br> Do You Yahoo!?<br> Tired of spam? Yahoo! Mail has the best spam protection around <br> http://mail.yahoo.com <br> </font></tt> <br>
|
|
 |