On Tue, Jul 10, 2007 at 11:56:24AM +0300, Eugeny N Dzhurinsky wrote:
> Hello!
> 
> Could somebody please explain, how is it possible to use custom serializer for
> serializing items in collection?
> 
> I created a class with static serialize/deserialize methods, added the format
> element to jibx-mapping, everything is compiled, but when running the
> application I'm getting 
> 
> ERROR [com.mycompany.myapp.Monitor.Monitor] java.lang.ClassCastException: 
> com.mycompany.myappmodule.hooks.auth.Credential
> java.lang.ClassCastException: com.mycompany.myappmodule.hooks.auth.Credential
>         at 
> com.mycompany.myapp.Network.JiBX_MungeAdapter.JiBX_linktiger_binding_marshal_1_0()
>         at 
> com.mycompany.myapp.Network.URLRequest.JiBX_linktiger_binding_marshal_2_0(URLRequest.java)
>         at 
> com.mycompany.myapp.Network.JiBX_linktiger_bindingURLRequest_access.marshal()


the mapping looks like this:

    ...

    <format type="com.mycompany.myappmodule.hooks.auth.Credential"
        serializer="com.mycompany.myapp.Common.CredentialSerializer.serialize"
        
deserializer="com.mycompany.myapp.Common.CredentialSerializer.deserialize"
        />
    
    .....

        <collection field='cred_list' type='java.util.ArrayList' 
usage="optional"
            item-type='com.mycompany.myappmodule.hooks.auth.Credential' 
            get-method="getCredentialsList" set-method="setCredentialsList" />

-- 
Eugene N Dzhurinsky

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to