Hi Joris,

The <choice> construct in the schema might be the cause of the problem - it's difficult to say since the current Xsd2Jibx code is really a mess. Still, anything that causes this "Stack size mismatch" is a serious problem in the binding compiler that should be fixed. Can you send me the code do duplicate this problem (just the generated classes and binding, not the original schema, and preferably with an Ant build.xml to run it).

I'm hoping to get much better support for both code generation from schema and JAXB conversions (especially JAXB 2.0 conversions) within the next month or two.

 - Dennis

Joris Van den Bogaert wrote:

Hi,

I'm in the process of migrating jaxb code to jibx as part of a proof of concept 
(performance
issues with JAXB).

We use the xsd2jibx tool to generate the Java code and binding xml files.  All 
schemas are parsed
correctly, but the binding-compiler chokes on one.  I put some work into 
finding the cause of the
error and trimmed the XSD to the bare minimum, while still getting the error.

Is this a known bug?  Can I get around it without changing the XSD?

XSD:

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema attributeFormDefault="unqualified"
  elementFormDefault="qualified"
  targetNamespace="https://www.blabla.com/services/entry/1.xsd";
  version="0.9"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:cwsce="https://www.blabla.com/services/entry/1.xsd";>

<xsd:complexType name="part"> </xsd:complexType>

  <xsd:complexType name="Parts">
     <xsd:sequence>
        <xsd:choice maxOccurs="1" minOccurs="1">
           <xsd:element maxOccurs="1" minOccurs="1" name="p1Part" 
type="cwsce:p1Part"/>
           <xsd:element maxOccurs="1" minOccurs="1" name="p2Part" 
type="cwsce:p2Part"/>
        </xsd:choice>
</xsd:sequence> </xsd:complexType>

  <xsd:complexType name="p1Part">
     <xsd:sequence>
        <xsd:element maxOccurs="unbounded" minOccurs="0" name="claimPart" 
type="cwsce:part"/>
</xsd:sequence> </xsd:complexType>
  <xsd:complexType name="p2Part">
     <xsd:sequence>
        <xsd:element maxOccurs="unbounded" minOccurs="0" name="claimPart" 
type="cwsce:part"/>
</xsd:sequence> </xsd:complexType>

</xsd:schema>


Error:

    [bind] Error running binding compiler
    [bind]
    [bind] *** Error during code generation - please enter a bug report for thi
s 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 com.blabla.jibx.JiBX_MungeAdapter.JiBX_binding_unmarshal
    [bind]  generated by [EMAIL PROTECTED]
    [bind]  from stack:
    [bind]  to stack:
    [bind]   0: java.util.ArrayList

    [bind]     at org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrappe
r.java:183)
    [bind]     at org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrappe
r.java:200)
    [bind]     at org.jibx.binding.def.NestedCollection.genContentUnmarshal(Nes
tedCollection.java:148)
    [bind]     at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(Ob
jectBinding.java:787)
    [bind]     at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(Object
Binding.java:932)
    [bind]     at org.jibx.binding.def.ComponentProperty.genContentUnmarshal(Co
mponentProperty.java:245)
    [bind]     at org.jibx.binding.def.NestedStructure.genContentUnmarshal(Nest
edStructure.java:156)
    [bind]     at org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(Ob
jectBinding.java:787)
    [bind]     at org.jibx.binding.def.ObjectBinding.genContentUnmarshal(Object
Binding.java:932)
    [bind]     at org.jibx.binding.def.ElementWrapper.genContentUnmarshal(Eleme
ntWrapper.java:267)
    [bind]     at org.jibx.binding.def.MappingDefinition.generateCode(MappingDe
finition.java:592)
    [bind]     at org.jibx.binding.def.DefinitionContext.generateCode(Definitio
nContext.java:602)
    [bind]     at org.jibx.binding.def.BindingDefinition.generateCode(BindingDe
finition.java:611)
    [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.ja
va: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.jav
a:1216)
    [bind]     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

    [bind]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
    [bind]     at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
    [bind]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
    [bind]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
    [bind]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
    [bind]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)



Cheers,
Joris

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to