Awkward NullPointerException in Xalan transformations
L.S,
I'm having a serious problem with XSL transformations using Apache Xalan 2.6.0: a transformation works once, but multiple calls to the method will cause a null-pointer exception to occur within the TrAXFilter object taking care of the transformation.
The class responsible for transforming any XML messages in our system looks like this (class MessageWriter appearing at line 14 is a JAXB marshalling class we've developed; class FilterManager appearing at line 21 returns an array of 1 hard-coded XMLFilter object):
public class MessageBuilder {
private final static SAXParserFactory XML_PARSER = SAXParserFactory.newInstance();
public static String getXmlMessage(MessageSDO message) {
String xml = MessageWriter.doMarshal(message);
try {
SAXParser parser = XML_PARSER.newSAXParser();
XMLReader reader = XMLReaderFactory.createXMLReader();
InputSource srcInput = new InputSource(new StringReader(xml));
FilterManager ftrManager = (FilterManager) ConfigurationManager.
getInstance(ConfigurationManager.BOUNDARY).getBean(FilterManager.class);
XMLFilter[] filters = ftrManager.getOutputFilters(message);
if (filters.length > 0) {
for (int i=0;i<filters.length;i++) {
filters.setParent((i==0)? reader : filters[i-1]);
Serializer serializer = SerializerFactory.getSerializer(OutputPropertiesFactory.getDefaultMethodProperties("xml"));
ByteArrayOutputStream output = new ByteArrayOutputStream();
serializer.setOutputStream(output);
filters[filters.length-1].setContentHandler(serializer.asContentHandler());
filters[filters.length-1].parse(srcInput);
xml = output.toString();
} catch (Exception e) {
throw new RuntimeException(e);
return xml;
The test I've run (if 2nd block commented out test succeeds, otherwise it fails on that 2nd attempt):
public void testTransformedOutput() {
System.out.println("Transformed output test:\n\n");
MessageSDO msg = MockSDOFactory.getInstance().getMessageSDO();
String xmlMsg = MessageBuilder.getXmlMessage(msg);
/*System.out.println("Transformed output test, 2nd pass:\n\n");
MessageSDO msg2 = MockSDOFactory.getInstance().getMessageSDO();
String xmlMsg2 = MessageBuilder.getXmlMessage(msg2);*/
}The exception message:
java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:334)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:134)
at org.boundary.helper.MessageBuilder.getXmlMessage(MessageBuilder.java:36)
// Line 36 in MessageBuilder is:
// filters[filters.length-1].parse(srcInput);What I don't yet understand is how TrAXFilter manages to somehow not have a parent in the 2nd pass of the test, while it does in the 1st pass. I've tried a few things already, but so far haven't been able to find a solution.
Does anyone know of a bug like this? Or is it clear to someone what I'm doing completely wrong here? I'd appreciate any help you can offer.
I've been able to solve this problem and since others might be interested, I thought I'd post the solution here as well.
It turns out that XMLFilter objects cannot be reused. This isn't documented very well, and undoubtedly doesn't come as a surprise to the more experienced XML specialists out there, but it's something you need to know. As a result, instead of using XMLFilter objects for repetetive transformations, you need to use an alternative, namely [url http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Templates.html]Templates objects:
final SAXTransformerFactory FACTORY = (SAXTransformerFactory) TransformerFactory.newInstance();
File xslFile = new File("someStylesheet.xsl");
StreamSource src = new StreamSource(xslFile);
Templates template = FACTORY.newTemplates(src);
// Later on, you can repeatedly do this:
String xml = getSomeXMLDocument();
InputSource srcInput = new InputSource(new StringReader(xml));
XMLFilter filter = FACTORY.newXMLFilter(template); // Use cached template instead of parsing XSL file every time...
XMLReader reader = XMLReaderFactory.createXMLReader();
filter.setParent(reader);
Serializer serializer = SerializerFactory.getSerializer(OutputPropertiesFactory.getDefaultMethodProperties("xml"));
ByteArrayOutputStream output = new ByteArrayOutputStream();
serializer.setOutputStream(output);
filter.setContentHandler(serializer.asContentHandler());
filter.parse(srcInput);
String xml = output.toString();
Similar Messages
-
Hello,
the code below is giving me the exception below.
I would greatly appreciate if anyone cud tell me the solution.
fin = new FileInputStream("c:/input.xml");
fout = new FileOutputStream("c:/html/output.html");
try
fullTransformer.transform(new StreamSource(fin), new
StreamResult(fout));
catch (Exception ex1)
System.out.println("Null Pointer exception thrown in Full");
ex1.printStackTrace();
Null Pointer exception thrown in Full
javax.xml.transform.TransformerException:
java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1212)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2894)
at java.lang.Thread.run(Thread.java:479)
java.lang.NullPointerException
at org.apache.xpath.objects.XObject.str(XObject.java:250)
at org.apache.xalan.templates.AVTPartXPath.evaluate(AVTPartXPath.java:161)
at org.apache.xalan.templates.AVT.evaluate(AVT.java:523)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:722)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2154)The first thing to try is add a few lines of code to check that fin and fout are not null. Maybe for some reason the file could not be opened.
How does your stylesheet look? Is it simple or complicated? Which version of Xalan are you using? Try downloading a new version at http://xml.apache.org. I once had a NullPointerException with Xalan which was caused by a bug in Xalan.
Jesper -
Is there anybody that knows how to interrupt xalan when processing.
There is a method stopTransformation() but it is not implemented
There are transformations running for a very long time(20 min) giving 100% load and i want to interrupt them.
It is for a very large database rapporting web application.The first thing to try is add a few lines of code to check that fin and fout are not null. Maybe for some reason the file could not be opened.
How does your stylesheet look? Is it simple or complicated? Which version of Xalan are you using? Try downloading a new version at http://xml.apache.org. I once had a NullPointerException with Xalan which was caused by a bug in Xalan.
Jesper -
Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html. After
repeatedly
using the same Transformer object to transform different xml documents, the Transformer
eventually becomes corrupt – sometimes after 20 or so transforms, sometimes only
after
thousands.
Once the Transformer object becomes corrupt, any additional attempt to call the
transform
method results in the following exception:
=============================
javax.xml.transform.TransformerException: -1
at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
at … <snip>
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
at … <snip>
=============================
Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl yields:
Method: applyTemplateToNode:
try
pushElemTemplateElement(elemtemplateelement1);
m_xcontext.pushCurrentNode(node);
<snip>
catch(SAXException saxexception)
throw new TransformerException(saxexception);
finally
m_xcontext.popCurrentNode();
<snip>
So what appears to be happening is that one of the two push calls at the beginning
of the try
block is throwing an Exception, causing the pop method to be called in the finally
block without
first having had a successful call to push. The corresponding NodeVector inside
m_xcontext
thereupon becomes corrupt, and it is only a matter of time before the above
ArrayIndexOutOfBoundsException appears.
Unfortunately, we are unable to consistently reproduce this Transformer corruption
and
currently have no idea how it happens in the first place. We figure there’s probably
some sort
of error in our xsl stylesheet which is at the root of all this, but have had
no luck in finding it.
So, two questions:
1.) Has anyone encountered this problem of having a bad xsl stylesheet which,
when applied
repeatedly on certain xml documents, can cause the Transformer to become corrupt
as a result
of calling NodeVector.pop without a corresponding call to NodeVector.push? If
so, do you have
a simple example of the type of xsl template and/or xml document which might reproduce
the
scenario.
2.) Would not the above code snippet in TransformerImpl be considered buggy in
any case,
since it should not be possible for an invalid xsl stylesheet to permanently corrupt
the
Transformer? If there’s agreement that this represents a bug in TransformerImpl,
has it been
fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic Server?
Thanks,
Johnhi,
I've just recently started getting this error too. It's completely random as
to when it occurs. My system can process hundreds of translations with no problems
and then once and awhile I get this exact error.
I'm using WebLogic v7.0 sp2. I've noticed however that this only happens on my
Windows system - I've got it running on a solairs box with no problems.
Has anyone else seen this ?
Thanks.
Jerry
"John Lame" <[email protected]> wrote:
>
Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html.
After
repeatedly
using the same Transformer object to transform different xml documents,
the Transformer
eventually becomes corrupt – sometimes after 20 or so transforms, sometimes
only
after
thousands.
Once the Transformer object becomes corrupt, any additional attempt to
call the
transform
method results in the following exception:
=============================
javax.xml.transform.TransformerException: -1
at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
at … <snip>
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
at … <snip>
=============================
Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl
yields:
Method: applyTemplateToNode:
try
pushElemTemplateElement(elemtemplateelement1);
m_xcontext.pushCurrentNode(node);
<snip>
catch(SAXException saxexception)
throw new TransformerException(saxexception);
finally
m_xcontext.popCurrentNode();
<snip>
So what appears to be happening is that one of the two push calls at
the beginning
of the try
block is throwing an Exception, causing the pop method to be called in
the finally
block without
first having had a successful call to push. The corresponding NodeVector
inside
m_xcontext
thereupon becomes corrupt, and it is only a matter of time before the
above
ArrayIndexOutOfBoundsException appears.
Unfortunately, we are unable to consistently reproduce this Transformer
corruption
and
currently have no idea how it happens in the first place. We figure
there’s probably
some sort
of error in our xsl stylesheet which is at the root of all this, but
have had
no luck in finding it.
So, two questions:
1.) Has anyone encountered this problem of having a bad xsl stylesheet
which,
when applied
repeatedly on certain xml documents, can cause the Transformer to become
corrupt
as a result
of calling NodeVector.pop without a corresponding call to NodeVector.push?
If
so, do you have
a simple example of the type of xsl template and/or xml document which
might reproduce
the
scenario.
2.) Would not the above code snippet in TransformerImpl be considered
buggy in
any case,
since it should not be possible for an invalid xsl stylesheet to permanently
corrupt
the
Transformer? If there’s agreement that this represents a bug in TransformerImpl,
has it been
fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic
Server?
Thanks,
John -
ALSB 3.0 : java.lang.NullPointerException with MFL Transform on runtime
Hi,
I try to insert an action "MFL Transform" in a message flow in a proxy service. (ASLB 3.0 Linux)
The configuration of the message flow and proxy works well.
When I try to test the proxy I get a java.lang.NullPointerException on stages.transform.runtime.MFLTransformRuntimeStep.
Any ideas ?How are you sure of the MFL configuration when this is the component that is causing the issue. The MFL configuration could be 100% but if the variable that is writing to the MFL is not the right datatype or not initilised then this could cause a NullPointerException error.
This is common and usually seen when the conversion is set to be binary to xml (default) when infact you want it to be xml to binary. Which way are you converting and what is the data type of the variable writing to the MFL?
cheers
James -
Org.apache.xalan.transformer.TransformerImpl
I have an ecr.index servlet which is run on Tomcat, here is the part of it's code:
javax.xml.transform.sax.SAXTransformerFactory factory = ( javax.xml.transform.sax.SAXTransformerFactory ) javax.xml.transform.TransformerFactory.newInstance();
Source ss = new StreamSource( new FileInputStream( context.getRealPath( xsl_file ) ) );
ss.setSystemId( context.getRealPath( xsl_file ) );
javax.xml.transform.sax.TransformerHandler handler = factory.newTransformerHandler( ss );
131:handler.setResult( new StreamResult( response.getOutputStream() ) );When I access the page the exception is thrown:
org.apache.xml.utils.WrappedRuntimeException: The output format must have a '{http://xml.apache.org/xalan}content-handler' property!
at org.apache.xalan.serialize.SerializerFactory.getSerializer(SerializerFactory.java:142)
at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:1048)
at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:975)
at org.apache.xalan.transformer.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:209)
at ecr.index.service(index.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:339)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:415)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:716)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:650)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:829)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:534)But I don't use org.apache.xalan.transformer.TransformerImpl, even the package org.apache.xalan.transformer isn't imported, but this package is present in classpath, where is the error?Here is the reason for this problem....
JDK 1.4 comes with a version of Xalan...
Somewhere around 1.4.2_03 the Xalan version that shipped with the JDK was upgraded because the XSLT spec was completed/revised or something like that.. When this happend the namespace identifier for xalan custom 'tags' changed. The content-handler tag used to be in the xslt name space.. now it is in the xalan namespace.
Problem is many stylesheets don't specifically set the output format so the defaults are used and the values are initialized from a properties file. However.... and this is where the problems comes in...
The Namespaces are used as prefixes to the keys in the file... AND... Tomcat''s WebappClassLoader is not safe about ensuring that a resource is loaded from the same Jar file as the classes that use it....
So what is happening is... the Xalan from your JVM is being used... but it is loading the formatting properties from a Xalan that is included in your Webapp.... which of course don't match....
All you need to do is remove the xalanXXX.jar from WEB-INF/lib and this problem will go away...
Matt Brozowski
The OpenNMS Group, Inc... -
Teachers:
How can I Serialize the Object of org.apache.xalan.transformer.TransformerImpl.org.apache.xalan.transformer.TransformerImpl doesn't appear to be serializable... what do you try to achieve?
-
Standalone deployment & the Xalan transformer
Hi,
I'm using JDev and deploying/running against to a standalone instance.
Everything was fine until I upgraded my XSL transformer to the latest version of Xalan ( from the default Oracle Provided transformer).
Now I am getting an error when I deploy.
"Neither this XML document's public nor system id's could be resolved: java.net.UnknownHostException: java.sun.com java.sun.com"
The top line of my ejb-jar.xml has the following line
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
so I think the standalone instance is trying to access the internet for the DTD during the deployment process & failing.
I note that I am not having this problem when I deploy to a real 9iAS Applicvation server.
It is not an option to roll back to the Oracle XSL transformer as it is too slow for our application ( with Xalan & using translets we get a throughput increase of approx 350%).
Can anyone help we with this?
thanks in advance,
KevinAre you transforming the ejb-jar.xml with an XSLT?
The DOCTYPE declaration is not required for the transformation; and may be removed from the ejb-jar.xml. -
Stop Xalan Transform From Resolves Entities
I'm trying to write a DOM tree to an XML file, so I've been using Xalan to do a transformation. My code is quite simple:
DOMSource source = new DOMSource( domDocument );
StreamResult result = new StreamResult( new File( "out.xml" ));
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty( OutputKeys.METHOD, "xml" );
transformer.setOutputProperty( OutputKeys.ENCODING, "utf-8" );
transformer.transform( source, result )
The problem is that my DOM document has character entity references that the transformer seems intent on converting. For example XML that looks like this in the DOM tree:
<value>Here is a weird character: é</value>
Gets output like this in the xml file:
<value>Here is a weird character: ?</value>
Since I'm not actually transforming anything, just outputting the XML, I need to preserve any character entity references. Oddly enough the source XML file contains the & entity, which gets converted to a regular & character when the file is parsed into the DOM tree. It's the only character entity that isn't stored as an actual EntityReference object in the tree, but the only one that gets converted back to & on a transform. Any help would be greatly appreciated.Yes, the character entities are declared in the DTD. At one point in development I was including it with:
transformer.setOutputProperty( OutputKeys.DOCTYPE_PUBLIC,domDocument.getDoctype().getPublicId());
transformer.setOutputProperty( OutputKeys.DOCTYPE_SYSTEM,domDocument.getDoctype().getSystemId());
transformer.transform( source, result );
(I'm writing this code from memory; sorry if there are any syntax errors)
The code compiled and did correctly add the DOCTYPE entry to the file, but the references are still being converted. It does matter for us that the references remain intact. Eventually the XML will go into a publishing system that uses a different set of proprietary character codes for that software; utf-8 won't work :-( -
Error with xalan xsltc transformation
Hi Everybody,
I am currently working on a performance enhancement change for my project which uses xsl for jsp html display. Due to some client requirement, we have decided to convert all our xsl stylesheets to XSLTC translet class files. Although I have managed to compile all the stylesheets to java classes, I am getting a strange runtime error for some of the xsl-jsp pages. please kindly help me as I have no clue about this error. It has now become a showstopper issue for my project delivery. I am using Websphere 5.1 jre and xml jar libraries for doing the transform. The tranformation works fine with the default xalan transformer(not xsltc). The XSLTC version is 4.0 .
[2/6/06 17:41:33:979 IST] beb3ed2 WebGroup E SRVE0026E: [Servlet Error]-[(class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Incompatible object argument for method call]: java.lang.VerifyError: (class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Incompatible object argument for method call
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java(Compiled Code))
at java.lang.Class.getConstructor1(Class.java(Compiled Code))
at java.lang.Class.newInstance3(Class.java(Compiled Code))
at java.lang.Class.newInstance(Class.java(Compiled Code))
at org.apache.xalan.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:345)
at org.apache.xalan.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:374)
at org.apache.xalan.xsltc.trax.TemplatesImplProxy.newTransformer(TemplatesImplProxy.java:106)
at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:570)
at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:296)
at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:243)
at com.synergy.service.XSLTTransformServiceHelper.transform(XSLTTransformServiceHelper.java:155)
at com.synergy.tags.xslt.XSLTTransformTag.doEndTag(Unknown Source)
at org.apache.jsp._mmtoolb._jspService(_mmtoolb.java:2392)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:683)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:61)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Please reply incase you need more information about the error.
Thanks and Regards,
sunil kumar
Polaris software lab ltd
IndiaThe XSLTC version is 4.0Is that the version under which you compiled the classes, or the version in Websphere where you are running the classes? The error message seems to suggest there is some incompatibility happening.
-
Xalan.jar ----- javax.xml.transform.TransformerException
Hi,
I am using Pramati 4.1 Server.
My application is working fine for a single or few more users. But In Performance Testing when more than 100 users hit the same link at a time, it throws lots of Transformer Exception such as �
Exception in quicklinks.jsp: javax.xml.transform.TransformerException: java.net.SocketException: Connection reset
javax.xml.transform.TransformerException: java.lang.ArrayIndexOutOfBoundsException: 8195
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
at com.niit.cliks.control.web.tagext.viewmenu.doStartTag(Unknown Source)
at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._pramati_tag_var_cliks_viewmenu12_method(jsp_p2f_common_p2f_menu.java:315)
at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._jspService_delegate(jsp_p2f_common_p2f_menu.java:599)
at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._jspService(jsp_p2f_common_p2f_menu.java:623)
at com.pramati.jsp.runtime.HttpJspSuper.service(HttpJspSuper.java:64) ....
.....................Can anybody please help me out to resolve this problem?
Thank you.I've found that using the document() function in XSL is the trigger for this bug.
The Xalan JAXP implementation caches any document() calls. A workaround apparerently is to put in the processing instruction <?xalan-doc-cache-off?>. -
Hello,
I have a strange problem... I have a XML and a XSL. Sometimes it works, sometime not....
I'm working with xalan 2.3.4
here is my XSL:<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:variable name="uDocuments" select="//object[object_name='uDocuments']" />
<root>
<UploadRootfolder name="{$uDocuments/object_name}" id="{$uDocuments/@ID}" isUploadFolder="true">
<xsl:call-template name="createTreeLevel">
<xsl:with-param name="level" select="0" />
<xsl:with-param name="node" select="//object[i_folder_id=$uDocuments/@ID]" />
</xsl:call-template>
</UploadRootfolder>
<xsl:call-template name="createTreeLevel">
<xsl:with-param name="level" select="0" />
<xsl:with-param name="node" select="//object[i_folder_id=$uDocuments/i_folder_id and object_name != 'uDocuments']" />
</xsl:call-template>
</root>
</xsl:template>
<xsl:template name="createTreeLevel">
<xsl:param name="level" />
<xsl:param name="node" />
<xsl:for-each select="$node">
<xsl:sort select="object_name" order="ascending"/>
<xsl:variable name="LevelId" select="@ID" />
<xsl:choose>
<xsl:when test="r_object_type = 'wcm_folder'">
<xsl:choose>
<xsl:when test="a_is_upload_doc_folder = 1">
<Uploadfolder name="{object_name}" id="{@ID}" isUploadFolder="true">
<xsl:call-template name="createTreeLevel">
<xsl:with-param name="level" select="$level" />
<xsl:with-param name="node" select="//object[i_folder_id=$LevelId]" />
</xsl:call-template>
</Uploadfolder>
</xsl:when>
<xsl:otherwise>
<folder name="{object_name}" id="{@ID}">
<xsl:call-template name="createTreeLevel">
<xsl:with-param name="level" select="$level" />
<xsl:with-param name="node" select="//object[i_folder_id=$LevelId]" />
</xsl:call-template>
</folder>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="wcm_object_type = 'uploaded'">
<Uploaddocument name="{object_name}" id="{@ID}" currentstate="{r_current_state}" language="{wcm_language}">
<xsl:attribute name="isUploaded">
<xsl:choose>
<xsl:when test="wcm_object_type = 'uploaded'">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="checkedoutstatus">
<xsl:choose>
<xsl:when test="r_lock_owner != ''">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</Uploaddocument>
</xsl:when>
<xsl:otherwise>
<document name="{object_name}" id="{@ID}" currentstate="{r_current_state}" r_lock_owner="{r_lock_owner}" language="{wcm_language}">
<xsl:attribute name="checkedoutstatus">
<xsl:choose>
<xsl:when test="r_lock_owner != ''">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="isWorkflowEnabled">
<xsl:choose>
<xsl:when test="isworkflowenabled = 1">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="isUploaded">
<xsl:choose>
<xsl:when test="wcm_object_type = 'uploaded'">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>false</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</document>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
with that XML it works<root>
<object ID="0900348b8003df71">
<object_name>LogoCountry_fr_FR.gif</object_name>
<r_object_type>wcm_copy_document</r_object_type>
<r_object_id>0900348b8003df71</r_object_id>
<i_folder_id>0b00348b8003df5f</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>uploaded</wcm_object_type>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df72">
<object_name>LogoCountry_nl_NL.gif</object_name>
<r_object_type>wcm_copy_document</r_object_type>
<r_object_id>0900348b8003df72</r_object_id>
<i_folder_id>0b00348b8003df5f</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>uploaded</wcm_object_type>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0b00348b8003e247">
<object_name>Parfait</object_name>
<r_object_type>wcm_folder</r_object_type>
<r_object_id>0b00348b8003e247</r_object_id>
<i_folder_id>0b00348b8003df60</i_folder_id>
<r_current_state>0</r_current_state>
<a_is_upload_doc_folder>1</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df76">
<object_name>constantlib.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df76</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df70">
<object_name>site_const.asp</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df70</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df6e">
<object_name>siteinfo.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df6e</r_object_id>
<i_folder_id>0b00348b8003df64</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df6f">
<object_name>sitevisual.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df6f</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0b00348b8003df60">
<object_name>uDocuments</object_name>
<r_object_type>wcm_folder</r_object_type>
<r_object_id>0b00348b8003df60</r_object_id>
<i_folder_id>0c00348b8003df5e</i_folder_id>
<r_current_state>0</r_current_state>
<a_is_upload_doc_folder>1</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003e211">
<object_name>yo_fr_FR.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003e211</r_object_id>
<i_folder_id>0c00348b8003df5e</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>page</wcm_object_type>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language>fr_FR</wcm_language>
</object>
<object ID="0900348b8003df74">
<object_name>z_20060321a.css</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df74</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
</root>
Result<root>
<UploadRootfolder isUploadFolder="true" id="0b00348b8003df60" name="uDocuments">
<Uploadfolder isUploadFolder="true" id="0b00348b8003e247" name="Parfait"/>
</UploadRootfolder>
<document language="fr_FR" r_lock_owner="" currentstate="3" id="0900348b8003e211" name="yo_fr_FR.xml" checkedoutstatus="false" isWorkflowEnabled="false" isUploaded="false"/>
</root>
with that one it does not<root>
<object ID="0b00348b8003e248">
<object_name>FolderVide</object_name>
<r_object_type>wcm_folder</r_object_type>
<r_object_id>0b00348b8003e248</r_object_id>
<i_folder_id>0b00348b8003df60</i_folder_id>
<r_current_state>0</r_current_state>
<a_is_upload_doc_folder>1</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df71">
<object_name>LogoCountry_fr_FR.gif</object_name>
<r_object_type>wcm_copy_document</r_object_type>
<r_object_id>0900348b8003df71</r_object_id>
<i_folder_id>0b00348b8003df5f</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>uploaded</wcm_object_type>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df72">
<object_name>LogoCountry_nl_NL.gif</object_name>
<r_object_type>wcm_copy_document</r_object_type>
<r_object_id>0900348b8003df72</r_object_id>
<i_folder_id>0b00348b8003df5f</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>uploaded</wcm_object_type>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df76">
<object_name>constantlib.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df76</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df70">
<object_name>site_const.asp</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df70</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df6e">
<object_name>siteinfo.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df6e</r_object_id>
<i_folder_id>0b00348b8003df64</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003df6f">
<object_name>sitevisual.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df6f</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0b00348b8003df60">
<object_name>uDocuments</object_name>
<r_object_type>wcm_folder</r_object_type>
<r_object_id>0b00348b8003df60</r_object_id>
<i_folder_id>0c00348b8003df5e</i_folder_id>
<r_current_state>0</r_current_state>
<a_is_upload_doc_folder>1</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>1</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
<object ID="0900348b8003e211">
<object_name>yo_fr_FR.xml</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003e211</r_object_id>
<i_folder_id>0c00348b8003df5e</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type>page</wcm_object_type>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language>fr_FR</wcm_language>
</object>
<object ID="0900348b8003df74">
<object_name>z_20060321a.css</object_name>
<r_object_type>wcm_document</r_object_type>
<r_object_id>0900348b8003df74</r_object_id>
<i_folder_id>0b00348b8003df61</i_folder_id>
<r_current_state>3</r_current_state>
<a_is_upload_doc_folder>0</a_is_upload_doc_folder>
<wcm_object_type/>
<isworkflowenabled>0</isworkflowenabled>
<r_lock_owner/>
<wcm_language/>
</object>
</root>
Result:0 [main] WARN com.documentum.fc.common.DfLogger - Failed to load log4j.properties. Using default log4j configuration
Warning: popContextNodeList when stack is empty!
2812 [main] ERROR com.aventis.wcm.xmlhandler.Transformation - javax.xml.transform.TransformerException: java.lang.NullPointerException
; Line#: 30; Column#: 34
javax.xml.transform.TransformerException: java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2263)
at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:432)
at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:273)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2081)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1137)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:600)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1054)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1032)
at com.aventis.wcm.xmlhandler.Transformation.applyStyleSheet(Transformation.java:599)
at com.sanofiaventis.documentum.CreateNavTree.applyXslFromString(CreateNavTree.java:150)
at com.sanofiaventis.documentum.CreateNavTree.getFolderContentStructure(CreateNavTree.java:98)
at com.sanofiaventis.documentum.CreateNavTree.main(CreateNavTree.java:211)
Caused by: java.lang.NullPointerException
at org.apache.xpath.axes.DescendantIterator.nextNode(DescendantIterator.java:250)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.axes.FilterExprWalker.getNextNode(FilterExprWalker.java:235)
at org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java:400)
at org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:165)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.objects.XNodeSet.compare(XNodeSet.java:538)
at org.apache.xpath.objects.XNodeSet.equals(XNodeSet.java:736)
at org.apache.xpath.operations.Equals.operate(Equals.java:84)
at org.apache.xpath.operations.Operation.execute(Operation.java:150)
at org.apache.xpath.axes.PredicatedNodeTest.executePredicates(PredicatedNodeTest.java:326)
at org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:458)
at org.apache.xpath.axes.DescendantIterator.nextNode(DescendantIterator.java:264)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.axes.NodeSequence.runTo(NodeSequence.java:474)
at org.apache.xalan.templates.ElemForEach.sortNodes(ElemForEach.java:340)
at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:383)
at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:300)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
... 16 more
java.lang.NullPointerException
at org.apache.xpath.axes.DescendantIterator.nextNode(DescendantIterator.java:250)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.axes.FilterExprWalker.getNextNode(FilterExprWalker.java:235)
at org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java:400)
at org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:165)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.objects.XNodeSet.compare(XNodeSet.java:538)
at org.apache.xpath.objects.XNodeSet.equals(XNodeSet.java:736)
at org.apache.xpath.operations.Equals.operate(Equals.java:84)
at org.apache.xpath.operations.Operation.execute(Operation.java:150)
at org.apache.xpath.axes.PredicatedNodeTest.executePredicates(PredicatedNodeTest.java:326)
at org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:458)
at org.apache.xpath.axes.DescendantIterator.nextNode(DescendantIterator.java:264)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at org.apache.xpath.axes.NodeSequence.runTo(NodeSequence.java:474)
at org.apache.xalan.templates.ElemForEach.sortNodes(ElemForEach.java:340)
at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:383)
at org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:300)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:432)
at org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:273)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2258)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2081)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1137)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:600)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1054)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1032)
at com.aventis.wcm.xmlhandler.Transformation.applyStyleSheet(Transformation.java:599)
at com.sanofiaventis.documentum.CreateNavTree.applyXslFromString(CreateNavTree.java:150)
at com.sanofiaventis.documentum.CreateNavTree.getFolderContentStructure(CreateNavTree.java:98)
at com.sanofiaventis.documentum.CreateNavTree.main(CreateNavTree.java:211)
com.aventis.wcm.exception.WcmSystemException: error while applying stylesheet
at com.aventis.wcm.xmlhandler.Transformation.applyStyleSheet(Transformation.java:605)
at com.sanofiaventis.documentum.CreateNavTree.applyXslFromString(CreateNavTree.java:150)
at com.sanofiaventis.documentum.CreateNavTree.getFolderContentStructure(CreateNavTree.java:98)
at com.sanofiaventis.documentum.CreateNavTree.main(CreateNavTree.java:211)Thanks for your help
Patrickthis seems to be a bug in your xalan version - i tried with xalan 2.6.1 - it worked fine.
-
Problem transforming SAX events
The following code parses a CSV file creating SAX events. If no XSL file is passed, it correctly does an identity transform and creates output so my assumption is that the parsing is working OK. However if I pass an xsl file containing the identity transfromation, I get no output and no exceptions. This is frustrating. Any ideas would be appreciated.
String csvFileName = args[0];
String xsltFileName = (args.length < 2)?null:args[1];
TransformerFactory tranFactory = TransformerFactory.newInstance();
tranFactory.setErrorListener(new SimpleErrorListener());
if (!tranFactory.getFeature(SAXTransformerFactory.FEATURE)){
System.out.println("SAXTransformerFactory is not supported");
System.exit(1);
SAXTransformerFactory saxTranFactory = (SAXTransformerFactory)tranFactory;
TransformerHandler tranHandler = null;
try{
if (xsltFileName == null){
tranHandler = saxTranFactory.newTransformerHandler();
else{
StreamSource s = new StreamSource(new File(xsltFileName));
tranHandler = saxTranFactory.newTransformerHandler(s);
catch(javax.xml.transform.TransformerConfigurationException e){
e.printStackTrace();
System.exit(1);
try{
FileWriter f = new FileWriter(new File(xsltFileName+".out"));
StreamResult r = new StreamResult(f);
tranHandler.setResult(r);
CSVXMLReader reader = new CSVXMLReader();
reader.setContentHandler(tranHandler);
reader.parse(new InputSource(new FileReader(csvFileName)));
f.flush();
}first problem solved. The parse method was missing endDocument().
Now i get the following Exception:
java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3174) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:433)
at dpak.xml.CSVXMLReader.parse(CSVXMLReader.java:71)
at dpak.xml.CSVXMLReader.main(CSVXMLReader.java:120)
I am using XML Winter Pack release with xalan.jar and xerces.jar in the jre/ext directory.
Stuck again. Any help would be appreciated. -
Getting crazy with new Xalan J 2 3 1!!! HELP!
I am using the following code with new Xalan for XSL Transformations:
public static String transform (Node xmlNode,Node xslNode)
throws XPTOException{
StringWriter writer = new StringWriter();
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer;
StreamResult result = new StreamResult(writer);
try {
transformer = tFactory.newTransformer(
new DOMSource(xslNode));
transformer.transform(new DOMSource(xmlNode),
result);
}catch (TransformerException e) {
String s= ServletUtils.getStackTraceAsString(e);
throw new XPTOException (res.getString("Msg_3"),s);
return writer.toString();
My XSL is ok, at least it always worked with old version of Xalan:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
</xsl:stylesheet>
So I declare output method...
But I got this error:
java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:1003)
at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:934)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1083)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
at xpto.util.XSLTEngine.transform(XSLTEngine.java:93)
that by my research seems to be related with the output method for xsl....
I don't know what's going on!
Help!How did you solve this problem?
-
Problem with Xalan and JDK and Tomcat
hi all,
i have a webapplication under Apache Tomcat 4.1.30/Linux which use an XML/XSL transformation.
I got the following error:
org.apache.xml.utils.WrappedRuntimeException: The output format must have a '{http://xml.apache.org/xalan}content-handler' property!
at org.apache.xalan.serialize.SerializerFactory.getSerializer(SerializerFactory.java:142)
at org.apache.xalan.transformer.TransformerImpl.createResultContentHandler(TransformerImpl.java:1048)
at
Any suggestion ?
Cheers.
StefanoHere is an anwser for you
http://testdrive.mapinfo.com/TECHSUPP/MIPROD.NSF/0/4a9bc2a8f684237f85256e63006f9ad4?OpenDocument
JDK 1.4 and above, I believe, is packaged with an old version of Xalan jar. So sometimes, like when trying to run XSLTC, you have to override the JDK 1.4 Xalan version with the newer Xalan.jar. Or else your newer Xalan.jar classes are not looked at. You do this by putting your Xalan.jar in the /lib/endorsed directory. or /common/endorsed in this case.
http://xml.apache.org/xalan-j/faq.html#faq-N100CC
Hope this helps
Maybe you are looking for
-
How do I connect to server (my other computer)?
I did this years ago but I don't remember the address I used. CMD/K opens the dialog box. My computer I want to connect is behind a modem and a router. What do I type in the for address? There is more than one computer on my home network. All ha
-
MacBook Pro Randomnly started Overheating badly
Hey There, I have a Mid 2011 Macbook Pro 15" Which i've had since Summer of 2011. I primarily use it for Music Production and DJing. Last week, my mbp started acting funny as i was watching a movie using VLC player. The screen was covered in Light gr
-
I have a situation where we have to transfer an CREMAS idoc,along with it I have to transer Contact Person Details( like Telephone no, Mobile no,fax, email etc). I have used the ADR2MAS message type (Idoc) to transer these details based on change poi
-
Kernal panic fixed by hardware change??
Hello, I have a G4 that I've upgraded quite a bit* and during the last month it has been randomly** suffering from kernel panics, sometimes when I'm using it, sometimes when it's left on its own. When I reboot (as the screen instructs me), the comput
-
Why are my open tab thumbnails missing?
Samsung Galaxy S3. Until today I could see a "stack" of thumbnails representing my open tabs when I click the "page" icon in the upper right corner of the browser window. This would allow me to easily jump from one tab to another. Now when I click on