Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes Transformer Exception -- Please help. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Transformer Exception -- Please help." Watch "Transformer Exception -- Please help." New topic
Author

Transformer Exception -- Please help.

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1064
I have some straightforward XSLT logic that creates an XML document, then calls another class to create the HTML file from it using the XSL document.

The code runs fine locally under straight Tomcat, but does not work on the Apache-Tomcat server (don't know if this is a distinction of significance).

Locally, JDK 1.4.2_06 and Tomcat 5.5.4 (worked to with Tocmat 5.0.19)

Server, JDK 1.4.2_04 and Tomcat 5.0.28 + Apache.

When I run the code on the server, I get the error below.

javax.xml.transform.TransformerConfigurationException:

javax.xml.transform.TransformerException: java.lang.IllegalStateException:

can't declare any more prefixes in this context

Can anyone help me figure out even ... where ... the problem is?

=============================

The actual class's source that is giving this error source is below:


========================================


Thanks in advance for any help.

-- Mike

Edit Comment: Please add [ code ] [ / code ] tags, without the spaces when posting source code.
Thanks.

- m
[ December 24, 2004: Message edited by: Madhav Lakkapragada ]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Add some debug statements and a finally block of code to printStackTrace(...). I am not familiar with this error.

- m


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1064
OK, great idea.

Here's the printStackTrace() output.

As you can see, the very first error is an org.apache.xalan error.

The references to my code I'm not taking seriously since the code works fine locally (and even ... used to work on the server).

Is this org.apache.xalan processor something I can configure or update?

This org.apache.xalan processor doesn't refer to the xalan.jar file I put into Tomcat's commmon/libs folder is it?

I really look forward to your reply!!!

Thanks in advance.

-- Mike

----------------------------------

javax.xml.transform.TransformerException: java.lang.IllegalStateException: can't declare any more prefixes in this context
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:980)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:788)
at traditionalpilates.ApplyXSLSheet.createHTMLFile(ApplyXSLSheet.java:75)
at traditionalpilates.ApplyXSLSheet.<init>(ApplyXSLSheet.java:37)
at traditionalpilates.CreateXML.outputFile(CreateXML.java:312)
at traditionalpilates.CreateXML.<init>(CreateXML.java:65)
at traditionalpilates.HomeServlet.doGet(HomeServlet.java:188)
at traditionalpilates.HomeServlet.doPost(HomeServlet.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.IllegalStateException: can't declare any more prefixes in this context
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:972)
... 35 more
---------
java.lang.IllegalStateException: can't declare any more prefixes in this context
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:972)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:788)
at traditionalpilates.ApplyXSLSheet.createHTMLFile(ApplyXSLSheet.java:75)
at traditionalpilates.ApplyXSLSheet.<init>(ApplyXSLSheet.java:37)
at traditionalpilates.CreateXML.outputFile(CreateXML.java:312)
at traditionalpilates.CreateXML.<init>(CreateXML.java:65)
at traditionalpilates.HomeServlet.doGet(HomeServlet.java:188)
at traditionalpilates.HomeServlet.doPost(HomeServlet.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
---------
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1064
This problem is now fixed.

The problem was that there were too many old JDOM files in the Tomcat common libs folder.

Thanks

-- Mike
Filexbb BB
Greenhorn

Joined: Jun 01, 2004
Posts: 2
Hi,

Just to move the atribute "version" to the last within the tag "xsl:stylesheet"

e.g.
from "<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">"
to
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">"

You can refer the following link for yr reference

http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg07022.html
 
Don't get me started about those stupid light bulbs.
 
subject: Transformer Exception -- Please help.