InvocationTargetException

I'm getting this error when unmarshalling, but there really doesn't seem to be a 
problem, i.e. unmarshalling apprently continues successfully.
I strongly suspect that Castor or Xerces has a static initialization problem (read 
below), but I'm totally new to Castor, so perhaps I'm wrong. 

Windows 2000 SP3
Sun j2sdk1.4.2_01
Castor-0.9.5.2
xercesImpl 2.6.1

DETAILS
Specific complaint is:
java.lang.IllegalStateException: Field access error: CertUUID(java.lang.String) access 
resulted in exception: java.lang.reflect.InvocationTargetException

A method DOES exist for "public void setCertUUID(java.lang.String)", and it is 
successfully invoked later, that's why I say this exception is nonsensical.

Mapping file reads in part:

<mapping>
    <class name="com.nokia.cips.cadmin.configserver.protocol.RequestPkiServices">
        <map-to xml="pki_services_msg"/>
        <field name="MessageCode" type="short">
                <bind-xml name="messageID" location="response"/>
        </field>
        <field name="CaUUID" type="string">
                <bind-xml name="caUUID" location="response/parameters"/>
        </field>
        <field name="DataCnt" type="int">
                <bind-xml name="count" location="response/data"/>
        </field>
        <field name="CertUUID" type="string" required="false">
            <bind-xml name="certUUID" 
location="response/data/certStatusList/certStatus"/>
        </field>
    </class>
</mapping>

The XML (#1) input results in exception. It reads in part:
<pki_services_msg>
  <response>
    <messageID>2</messageID>
    <parameters>
        <caUUID>4572e42722c3e68bc108a01b2fc59b96</caUUID>
    </parameters>
    <data>
        <count>1</count>
    </data>
  </response>
</pki_services_msg>

XML (#2) input has no exception. It reads in part:
  <response>
    <messageID>3</messageID>
    <parameters>
        <caUUID>4572e42722c3e68bc108a01b2fc59b96</caUUID>
    </parameters>
    <data>
        <certStatusList>
            <certStatus>
                <certUUID>7c7d61a577d8ed6b2f75db2188e2b8d0</certUUID>
  <... closing tags>

Notice that certUUID does not even appear in the XML (#1) input. A second XML (#2) 
input that does specify certUUID is successfully unmarshalled, so there is no problem 
mapping to public method setCertUUID.

As an experiment, when I eliminate CertUUID specification from the mapping file, the 
first XML unmarshals with no exception, but the second one naturally throws a 
(different) error.

Just for laughs I swapped the order of the input unmarshalling. NO ERRORS! Each time I 
unmarshall an input XML, I create a new Mapping and a new Unmarshaller, so I suspect 
there is a problem with some static initialization of Castor or Xerces.

STACK TRACE:
java.lang.IllegalStateException: Field access error: CertUUID(java.lang.String) access 
resulted in exception: java.lang.reflect.InvocationTargetException
        at 
org.exolab.castor.mapping.loader.FieldHandlerImpl.getValue(FieldHandlerImpl.java:383)
        at org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:190)
        at 
org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:886)
        at org.exolab.castor.xml.Validator.validate(Validator.java:122)
        at org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:756)
        at org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:918)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown 
Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.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 org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:583)
        at 
com.nokia.cips.cadmin.configserver.protocol.RequestXML.parseMsgBlob(RequestXML.java:158)
        at 
com.nokia.cips.cadmin.configserver.protocol.RequestPkiServices.readRequest(RequestPkiServices.java:200)
        at 
com.nokia.cips.cadmin.cluster.DebugPkiSimulateCmd.execute(DebugPkiSimulateCmd.java:159)
        at com.nokia.cips.common.base.CommandExec._executeCommand(CommandExec.java:103)
        at com.nokia.cips.common.base.CommandExec.access$000(CommandExec.java:16)
        at com.nokia.cips.common.base.CommandExec$1.run(CommandExec.java:130)
        at java.lang.Thread.run(Thread.java:534)


------
Glenn Nelson in Scotts Valley
mailto:[EMAIL PROTECTED]
Office: 831-440-6484
Mobile: 831-419-8929

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to