Project

Profile

Help

ArrayIndexOutOfBoundsException w/ 8.7.2-8.7.3

Added by Anonymous almost 18 years ago

Legacy ID: #3783556 Legacy Poster: Josh Goodman (jogoodma)

I've tried upgrading to 8.7.2b and 8.7.3b from 8.7.1b and in both cases my transformations fail with an ArrayIndexOutOfBoundsException in TinyBuilder regardless of the input XML or the template being used. I'm performing my transformations via the Java API and using the method described in http://sourceforge.net/forum/message.php?msg_id=2929233 I'm at a loss for what the root cause of this could be. Here is the full stack trace: java.lang.ArrayIndexOutOfBoundsException: -1 at net.sf.saxon.tinytree.TinyBuilder.characters(TinyBuilder.java:262) at net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:182) at net.sf.saxon.event.Stripper.characters(Stripper.java:248) at net.sf.saxon.event.ReceivingContentHandler.flush(ReceivingContentHandler.java:425) at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:332) at net.flybase.chado.sax.ChadoContentHandler.endElement(ChadoContentHandler.java:246) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at net.flybase.ant.task.ChadoXsltHandler.parse(ChadoXsltHandler.java:142) at net.flybase.ant.task.ChadoXsltHandler.execute(ChadoXsltHandler.java:118) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) at org.apache.tools.ant.Main.startAnt(Main.java:187) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) Thanks for an excellent product!!! Cheers, Josh Goodman


Replies (2)

RE: ArrayIndexOutOfBoundsException w/ 8.7.2-8 - Added by Anonymous almost 18 years ago

Legacy ID: #3787082 Legacy Poster: Michael Kay (mhkay)

I think it will probably be necessary for me to run your code to get to the bottom of this (or it would be helpful if you could have a go at stepping through it with a debugger). What's happening is that endElement() is called when the current depth is 0, which should never happen unless of course you've called endElement() without a corresponding startElement(), or done something like calling endElement() after endDocument(). The change between 8.7.1 and 8.7.3 is probably a side-effect of fixing some other bug.

RE: ArrayIndexOutOfBoundsException w/ 8.7.2-8 - Added by Anonymous almost 18 years ago

Legacy ID: #3787689 Legacy Poster: Josh Goodman (jogoodma)

Michael, Thanks, you were exactly right. I was incorrectly calling endElement() on the TransformerHandler when the last XML tag was encountered. Since I'm processing the XML in chunks I've already called endDocument() on the previous tag. Sorry for not catching this before posting, the behavior between different versions threw me off the obvious trail. Thanks, Josh

    (1-2/2)

    Please register to reply