Menu

#1 Invalid call to invoke

open
nobody
None
5
2002-11-05
2002-11-05
Anonymous
No

When executing the Importer against an XML file with
a BioSequence_package I recieve a
java.lang.IllegalArgumentException (full stack trace
given below)

The bug was traced down to the line 326 in class
org.biomage.tools.xmlutils.MAGEContentHandler

At this point the attempt is made to invoke a method
called 'addToBioSequence_list' but there are two
methods with this name. They have however differing
arguments and in my case the method with two arguments
is taken rather than the method with one argument.

A simple fix is to check the number of arguments of the
parentMethod that is taken eg:

if (( parentMethods[i].getName().equals(methodName) ||
parentMethods[i].getName().equals(methodName +
"_list")) &&
parentMethods[i].getParameterTypes().length == 1)
{
setMethod = parentMethods[i];
}

java.lang.IllegalArgumentException: wrong number of
arguments
at java.lang.reflect.Method.invoke(Native Method)
at
org.biomage.tools.xmlutils.MAGEContentHandler.makeAssoc
iation(MAGEContentHandler.java:328)
at
org.biomage.tools.xmlutils.MAGEContentHandler.startElem
ent(MAGEContentHandler.java:232)
at
org.apache.xerces.parsers.AbstractSAXParser.startElemen
t(Unknown Source)
at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartEl
ement(Unknown Source)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(
Unknown Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement
(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.s
canStartElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.s
canDocument(Unknown Source)
at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknow
n Source)
at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknow
n Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unkno
wn Source)
at
org.biomage.tools.xmlutils.Importer.main(Importer.java:
90)
Exception in thread "main"

Discussion


Log in to post a comment.