Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
JDK 1.4 - All OK
JDK 1.3 - Compiles OK but fails testTransformSchematron
Runtime error at
[junit] Testcase: testTransformSchematron(org.apache.commons.jelly.tags.xml.TestXMLTags): Caused an ERROR
[junit] file:/C:/Work/commons-jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/schematron/transformSchematronExample.jelly:22:29: <x:transform> java.lang.NoSuchMethodError
[junit] org.apache.commons.jelly.JellyTagException: file:/C:/Work/commons-jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/schematron/transformSchematronExample.jelly:22:29: <x:transform> java.lang.NoSuchMethodError
[junit] at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:712)
[junit] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:282)
[junit] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
[junit] at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
[junit] at org.apache.commons.jelly.tags.core.JellyTag.doTag(JellyTag.java:45)
[junit] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:262)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:706)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:670)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:579)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.evaluteScriptAsText(TestXMLTags.java:309)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.evaluteScriptAsText(TestXMLTags.java:283)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.testTransformSchematron(TestXMLTags.java:231)
[junit] Root cause
[junit] java.lang.NoSuchMethodError
[junit] at org.apache.commons.jelly.tags.xml.TransformTag$1.resolve(TransformTag.java:221)
[junit] at org.apache.xalan.processor.ProcessorInclude.parse(ProcessorInclude.java:235)
[junit] at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInclude.java:192)
[junit] at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
[junit] at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
[junit] at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
[junit] at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
[junit] at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(Unknown Source)
[junit] at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
[junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
[junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[junit] at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
[junit] at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
[junit] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[junit] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[junit] at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:983)
[junit] at org.apache.xalan.processor.TransformerFactoryImpl.newTransformerHandler(TransformerFactoryImpl.java:700)
[junit] at org.apache.commons.jelly.tags.xml.TransformTag.doTag(TransformTag.java:124)
[junit] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:262)
[junit] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
[junit] at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
[junit] at org.apache.commons.jelly.tags.core.JellyTag.doTag(JellyTag.java:45)
[junit] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:262)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:706)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:670)
[junit] at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:579)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.evaluteScriptAsText(TestXMLTags.java:309)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.evaluteScriptAsText(TestXMLTags.java:283)
[junit] at org.apache.commons.jelly.tags.xml.TestXMLTags.testTransformSchematron(TestXMLTags.java:231)
Fix:
Subtitute
/**
- Creates a new URI Resolver so that URIs inside the XSLT document can be
- resolved using the JellyContext
* - @return a URI Resolver for the JellyContext
*/
protected URIResolver createURIResolver() {
return new URIResolver()Unknown macro: { public Source resolve(String href, String base) throws TransformerException { ... return new StreamSource(context.getResourceAsStream(href)); } };
}
by
/**
- Creates a new URI Resolver so that URIs inside the XSLT document can be
- resolved using the JellyContext
* - @return a URI Resolver for the JellyContext
*/
protected URIResolver createURIResolver() {
final JellyContext ctx = context;
return new URIResolver()Unknown macro: { public Source resolve(String href, String base) throws TransformerException { .... return new StreamSource(ctx.getResourceAsStream(href)); } };
}
Or put context public in TagSupport.