Hi Sergei,

There were a lot of internal changes since beta3c. If you can enter this 
in Jira and attach your sample build I'll take a look at getting it 
fixed. As a quick workaround, I suggest you try moving the name="a" 
attribute from the <mapping> to the <structure> that references the 
mapping. This is the preferred way of doing things now.

I realize there've been some confusing changes to the way the binding 
definitions work along the way to 1.0. The problem is that some of the 
component elements (mapping and structure, in particular) are just being 
used in too many different ways at present. My plan has always been to 
restructure this for 2.0 so that there are separate elements for 
abstract mappings (a <template> element) and for structure elements that 
reference mappings (perhaps a <mapref> element).

  - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Sergei Bobovich wrote:
> I am working on migrating from jibx beta3c version to
> 1.1. The binding definition that used to work before
> now generates 
> java.lang.IllegalStateException: Stack size mismatch
> on branch
>
> Same code/definition works fine with beta3c binding
> compiler.
>
> Is something wrong with the binding definition and I
> need to adjust it for version 1.1? Any idea/help is
> appreciated.
>
>
> binding.xml
> -----------------------------------------------------------------
> <binding>
>     <mapping name="a" class="test.A" abstract="true">
>       <value name="val-a" field="valA"/>
>     </mapping>
>     <mapping name="b" class="test.B" ordered="false">
>         <structure  map-as="test.A" usage="optional"
> />
>       <value name="val-b" field="valB" usage="optional"
> />
>     </mapping>
> </binding>
> -----------------------------------------------------------------
>
> A.java
> -----------------------------------------------------------------
> package test;
> public class A
> {
>       String valA;
> }
> -----------------------------------------------------------------
>
> B.java
> -----------------------------------------------------------------
>
> package test;
> public class B
>       extends A
> {
>       String valB;
> }
> -----------------------------------------------------------------
>
> Binding output:
> -----------------------------------------------------------------
>  
>     [bind] Running binding compiler version jibx_1_1
>      [bind] Warning: Using a name on an abstract
> mapping is deprecated; on mapping element at (line 3,
> col 54, in jibx-test/bind.xml)
>      [bind] binding jibx_test_bind:
>      [bind] context (mp#=2) (cv#=0) (fm#=0)
>      [bind] mapping class test.A to element a (#0)
> (abstract)
>      [bind] context (cv#=0) (fm#=0)
>      [bind] element wrapper a
>      [bind] object binding for test.A create class
> test.A
>      [bind] structure ordered
>      [bind] element val-a from property valA
> (java.lang.String)
>      [bind] mapping class test.B to element b (#1)
>      [bind] context (cv#=0) (fm#=0)
>      [bind] element wrapper b
>      [bind] object binding for test.B create class
> test.B
>      [bind] structure unordered
>      [bind] mapping reference to test.A using optional
> property "this" (test.B)
>      [bind] element val-b from optional property valB
> (java.lang.String)
>      [bind] Generating code for mapping test.A
>      [bind] Generating code for mapping test.B
>      [bind] Error running binding compiler
>      [bind] *** Error during code generation - please
> enter a bug report for this error in Jira if the
> problem is not listed as fixed on the online status
> page ***
>      [bind] java.lang.IllegalStateException: Stack
> size mismatch on branch
>      [bind] in method
> test.B.JiBX_jibx_test_bind_unmarshal
>      [bind] generated by
> [EMAIL PROTECTED]
>      [bind] from stack:
>      [bind] 0: test.B
>      [bind] 1: test.A
>      [bind] to stack:
>      [bind] 0: test.B
>      [bind] at
> org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrapper.java:183)
>      [bind] at
> org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrapper.java:200)
>      [bind] at
> org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure.java:262)
>      [bind] at
> org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding.java:795)
>      [bind] at
> org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.java:940)
>      [bind] at
> org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.java:315)
>      [bind] at
> org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.java:582)
>      [bind] at
> org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.java:603)
>      [bind] at
> org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.java:661)
>      [bind] at
> org.jibx.binding.Compile.compile(Compile.java:305)
>      [bind] at
> org.jibx.binding.ant.CompileTask.execute(CompileTask.java:248)
>      [bind] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>      [bind] at
> org.apache.tools.ant.Task.perform(Task.java:364)
>      [bind] at
> org.apache.tools.ant.Target.execute(Target.java:341)
>      [bind] at
> org.apache.tools.ant.Target.performTasks(Target.java:369)
>      [bind] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>      [bind] at
> org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>      [bind] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>      [bind] at
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
>      [bind] at
> org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>      [bind] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
>      [bind] at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
>  
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to