[CMA-7] ActionService.executeAction cannot return a java.util.Map as a result, throws exception Created: 09/Apr/08  Updated: 14/May/08  Resolved: 10/Apr/08

Status: Closed
Project: Remote Alfresco API rivet
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: vjalilov Assignee: sumer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
My code:
Map<String,NodeRef> allNodeRefs = new HashMap<String, NodeRef>(10);
                ....
         action.setParameterValue(PARAM_RESULT, (Serializable) allNodeRefs);


thrown exception:

com.rivetlogic.core.cma.exception.CmaRuntimeException: org.exolab.castor.xml.MarshalException: element "result" occurs more than once. (parent class: com.rivetlogic.core.cma.mapping.CmaResult)
 location: /cmaResult/result{File: [not available]; line: 12; column: 46}
at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:58)
at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.processResponse(RestExecuterImpl.java:214)
at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.processResponse(RestExecuterImpl.java:182)
at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:70)
at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:51)
at com.rivetlogic.core.cma.impl.ActionServiceImpl.execute(ActionServiceImpl.java:324)
at com.rivetlogic.core.cma.impl.ActionServiceImpl.executeAction(ActionServiceImpl.java:170)
at com.hbsp.migration.Migrate.processProduct(Migrate.java:279)
at com.hbsp.migration.Migrate.access$3(Migrate.java:258)
at com.hbsp.migration.Migrate$ProductElementHandler.onEnd(Migrate.java:188)
at org.dom4j.io.DispatchHandler.onEnd(DispatchHandler.java:202)
at org.dom4j.io.SAXContentHandler.endElement(SAXContentHandler.java:268)
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 org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at com.hbsp.migration.Migrate.main(Migrate.java:122)
Caused by: org.exolab.castor.xml.MarshalException: element "result" occurs more than once. (parent class: com.rivetlogic.core.cma.mapping.CmaResult)
 location: /cmaResult/result{File: [not available]; line: 12; column: 46}
at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:727)
at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:56)
... 23 more
Caused by: ValidationException: element "result" occurs more than once. (parent class: com.rivetlogic.core.cma.mapping.CmaResult)
 location: /cmaResult/result
at org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:984)
at org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:1159)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
... 24 more

 Comments   
Comment by hlim [ 10/Apr/08 ]
we need to serialize property values before passing them to castor. update mapping files to map them as String. the receiving end should de-serialize before returning result. write a util function for de-serialization.
Comment by schalasani [ 10/Apr/08 ]
Vagif download the new amp and test it
Generated at Sat Feb 10 05:51:15 GMT 2024 using Jira 8.1.3#801003-sha1:6b6f07cffadda9a0d6efe24639daed8ce94dcdd6.