You can't use put as an add method because the add method must take only
one argument.

But the larger issue is that JiBX doesn't support Maps out of the box.

FYI I wrote a helper class to facilitate solving this problem... see
MapEntry.java<http://dellroad-stuff.googlecode.com/svn/trunk/publish/reports/javadoc/index.html?org/dellroad/stuff/jibx/MapEntry.html>.
Basically you trick JiBX into thinking each key-value pair is an element in
a collection.

-Archie

On Mon, Jul 22, 2013 at 11:43 AM, Furst, Carl <carl.fu...@mlb.com> wrote:

> So I'm trying to marshal/unmarshal a HashMap and I get the following error
> when I compile the jibx xml:
>
> Error: add-method put not found in class java.util.Map; on collection
> element at (line 12, col 283, in DepthChart.xml)
>
>
> Which we know it is. If I take out the add-method declaration, it throws
> another error saying I need an add-method or store-method.
>
> Any ideas as to what I'm doing wrong?
>
> I'm using Jibx 1.1 and I'm guessing that Jibx doesn't support the use of
> Maps? I noticed that you needed extra jars for this.
>
> Is that correct? If so, I suggest you put something explicit in your docs.
> For there is nothing that says "Jibx does not support Maps." Only that it
> does support Collections (which I think a Map would be such a thing).
>
> Many thanks,
> Carl Furst
>
>
>
>
>
>
> **********************************************************
>
> MLB.com: Where Baseball is Always On
>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>



-- 
Archie L. Cobbs
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to