Sunday, September 26, 2010

Collection result contains a duplicate item

Got this error today using Flash Builder 4, Coldfusion 9 and a CallResponder.

Fix:

As the error reads, the ArrayCollection that was returned by the ColdFusion server contained two items with the same index. I first tried to see if I could process it within FB4 and remove the extra item. However, the solution was in looking at the source and finding out that a SQL JOIN I made was delivering duplicates because two tables were joined on only one variable. I added the second variable and the problem was fixed. End of story.

Hope it helps.

1 comment:

  1. hi
    are u still reply to this thread?
    I'm having quite similar problem.

    Error: Collection result contains a duplicate item: promo_registerRPCDataManager:#:0 exists at both position: 0 and 1
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequence()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataList.as:2691]
    at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::processSequenceResult()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataList.as:2918]
    at mx.data::DataListRequestResponder/result()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataListRequestResponder.as:102]
    at mx.data::RPCDataServiceAdapter/sendResultEvent()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1593]
    at mx.data::RPCDataServiceAdapter/executeQueryResult()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1527]
    at mx.collections::ItemResponder/result()[E:\dev\hero_private\frameworks\projects\framework\src\mx\collections\ItemResponder.as:129]
    at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\AsyncToken.as:239]
    at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\events\ResultEvent.as:207]
    at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.as:244]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:318]
    at mx.rpc::Responder/result()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
    at mx.rpc::AsyncRequest/acknowledge()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:84]
    at NetConnectionMessageResponder/resultHandler()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:552]
    at mx.messaging::MessageResponder/result()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:235]

    please help

    Kind Regards
    Shahid

    ReplyDelete