Hi Gilles,
Sorry I didn't reply faster to your original posting. You shouldn't need any kind of recursive function to handle this, and I've tested similar combinations - but if it gives you an IllegalStateException for your binding the workaround may be the best approach for now. This exception indicates an error in the code generation logic. I'm restructuring that logic for beta 4 in hopes of eliminating this type of problem.
- Dennis
Gilles Devaux wrote:
Solved with a recursive custom binding function.
-----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Gilles Devaux Envoy� : mardi 31 ao�t 2004 16:51 � : [EMAIL PROTECTED] Objet : [jibx-users] Strange binding
Hi, sorry for the poor title of the message but I can't find another one.
Here is my problem:
I'm trying to map the following object:
public class CategoryTree { private String ID=null; private java.util.ArrayList childs = null; }
where childs is an ArrayList containing CategoryTree objects. my binding is the following:
<mapping name="category" class="com.webraska.vulcan.pack.server.response.CategoryTree"> <value name="id" get-method="getID" set-method="setID"/> <collection field="childs" item-type="com.webraska.vulcan.pack.server.respsonse.CategoryTree"/> </mapping>
And I get the following error message at the end of the build:
BUILD FAILED: java.lang.IllegalStateException: Stack size mismatch on branch in method JiBX_MungeAdapter.JiBX_etc_binding_marshal generated by [EMAIL PROTECTED] from stack: 0: org.jibx.runtime.impl.MarshallingContext 1: com.webraska.vulcan.pack.server.respsonse.CategoryTree to stack: 0: org.jibx.runtime.impl.MarshallingContext
Wich seems logical since "com.webraska.vulcan.pack.server.respsonse.CategoryTree" is not fully mapped when I call the <collection> tag.
Does someone know how to bind this kind of pattern ?
Thanks a lot Gilles
------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
