Hi Dennis,

Below is the original note -- I don't know why it didn't stick to the
list the first time I sent it.  I have edited the large trace to remove
bulk and URL's (mostly namespace URI's)which may have caused it to be
rejected by the mail system (?).

As near as I can remember, I adjusted these optional collection items
(from the partial binding listing at the bottom of the original note) so
they were no longer optional (and started using the test-method pattern
instead; it works well):

      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.RequestMethod">
        <structure name="Get" map-as="GetRequestMethodType"
usage="optional"/>
        <structure name="Post" map-as="PostRequestMethodType"
usage="optional"/>
      </collection>

And that seemed to address this exception.  Although, when I look at the
binding that is working now:

  <mapping name="Operation" .... >
    ...
    <collection field="dcpList"
factory="org.jibx.runtime.Utility.arrayListFactory"
 
item-type="com.galdosinc.common.ogc.ows.capabilities.DcpTypeHttp"/> 
    ...
  </mapping>

  <mapping name="DCP"
class="com.galdosinc.common.ogc.ows.capabilities.DcpTypeHttp">
    <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
    <structure name="HTTP">
      <collection field="requestMethodList" 
         factory="org.jibx.runtime.Utility.arrayListFactory"/>
    </structure>
  </mapping>
  
  <mapping name="Get"
class="com.galdosinc.common.ogc.ows.capabilities.GetRequestMethod">
    <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
    <structure map-as="RequestMethodType"/>
  </mapping>
  <mapping name="Post"
class="com.galdosinc.common.ogc.ows.capabilities.PostRequestMethod">
    <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
    <structure map-as="RequestMethodType"/>
  </mapping>
  
  <mapping abstract="true" type-name="RequestMethodType" 
 
class="com.galdosinc.common.ogc.ows.capabilities.RequestMethodType">
    <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
    <structure map-as="com.galdosinc.common.ogc.xml.SimpleLink"/>
    <structure field="constraintList"
factory="org.jibx.runtime.Utility.arrayListFactory"
         test-method="hasConstraints" usage="optional">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.Constraint"/>
    </structure>
  </mapping>

It seems both Get and Post also had abstract="true" removed.  
Here is a sample output fragment for the DCP element:
      <DCP>
        <HTTP>
          <Get xlink:type="simple"
xlink:href="http://service.url/http/get"; 
             xlink:title="A service operation endpoint supporting
HTTP-GET requests">
            <Constraint name="Heavy-weight constraint">
              <Value>Constraint value (1)</Value>
              <Value>Constraint value (2)</Value>
              <Metadata about="This is general purpose metadata" 
                xlink:type="simple"
xlink:href="http://general.ows.metadata.url";>
              </Metadata>
            </Constraint>
          </Get>
          <Post xlink:type="simple"
xlink:href="http://service.url/http/post"; 
              xlink:title="A service operation endpoint supporting
HTTP-POST requests">
            <Constraint name="Heavy-weight constraint">
              <Value>Constraint value (1)</Value>
              <Value>Constraint value (2)</Value>
              <Metadata about="This is general purpose metadata" 
                 xlink:type="simple" 
                 xlink:href="http://general.ows.metadata.url";>
              </Metadata>
            </Constraint>
          </Post>
        </HTTP>
      </DCP>
So, there's a few clues for you - let me know you have any other
questions.

...Leif

----------[original note]----------------------------------------
 
Hi,

This error has me stumped:

     [bind] java.lang.IllegalStateException: Stack size mismatch on
branch
     [bind]  in method
com.galdosinc.common.ogc.ows.capabilities.JiBX_MungeAdapter.JiBX_WRS-Cap
abilities_unmarshal
     [bind]  generated by [EMAIL PROTECTED]
     [bind]  from stack:
     [bind]  to stack:
     [bind]   0: java.util.List
     [bind]     at
org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrapper.java:183)
     [bind]     at
org.jibx.binding.classes.BranchWrapper.setTarget(BranchWrapper.java:200)

The full trace is below along with a chunk of the binding file which
(I'm guessing) is the most likely culprit.  Any suggestions as to what
I've done wrong will be gratefully received.

Regards,      ...Leif

------[ binding compiler output ]--------

     [bind] Using the following binding paths:
     [bind]   cap-bindings_FULL_WRS_Cap-doc.xml
     [bind] Running binding compiler version jibx-rc1
     [bind] Warning: Undefined attribute class; on structure element at
(line 0, col 0)
     [bind] binding WRS-Capabilities:
     [bind]  context (mp#=23) (cv#=0) (fm#=0)
     [bind]   mapping class
com.galdosinc.common.ogc.ows.capabilities.AbstractBaseCapabilities (#0)
(abstract)

               [..... many lines omitted .....]

     [bind] Generating code for mapping
com.galdosinc.common.ogc.ows.capabilities.OperationsMetadata
     [bind] Generating code for mapping
com.galdosinc.common.ogc.ows.capabilities.Operation
     [bind] Error running binding compiler
     [bind]
     [bind] *** Error during code generation - please report this error
on the JiBX users list so that the condition can be caught during
validation ***
     [bind] java.lang.IllegalStateException: Stack size mismatch on
branch
     [bind]  in method
com.galdosinc.common.ogc.ows.capabilities.JiBX_MungeAdapter.JiBX_WRS-Cap
abilities_unmarshal
     [bind]  generated by [EMAIL PROTECTED]
     [bind]  from stack:
     [bind]  to stack:
     [bind]   0: java.util.List
     [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.NestedCollection.genContentUnmarshal(NestedCollecti
on.java:148)
     [bind]     at
org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure
.java:156)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding
.java:785)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.jav
a:930)
     [bind]     at
org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProp
erty.java:245)
     [bind]     at
org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure
.java:156)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding
.java:785)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.jav
a:930)
     [bind]     at
org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProp
erty.java:245)
     [bind]     at
org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.j
ava:272)
     [bind]     at
org.jibx.binding.def.PassThroughComponent.genContentUnmarshal(PassThroug
hComponent.java:111)
     [bind]     at
org.jibx.binding.def.NestedCollection.genContentUnmarshal(NestedCollecti
on.java:143)
     [bind]     at
org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure
.java:156)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding
.java:785)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.jav
a:930)
     [bind]     at
org.jibx.binding.def.ComponentProperty.genContentUnmarshal(ComponentProp
erty.java:245)
     [bind]     at
org.jibx.binding.def.NestedStructure.genContentUnmarshal(NestedStructure
.java:156)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genUnmarshalContentCall(ObjectBinding
.java:785)
     [bind]     at
org.jibx.binding.def.ObjectBinding.genContentUnmarshal(ObjectBinding.jav
a:930)
     [bind]     at
org.jibx.binding.def.ElementWrapper.genContentUnmarshal(ElementWrapper.j
ava:272)
     [bind]     at
org.jibx.binding.def.MappingDefinition.generateCode(MappingDefinition.ja
va:557)
     [bind]     at
org.jibx.binding.def.DefinitionContext.generateCode(DefinitionContext.ja
va:604)
     [bind]     at
org.jibx.binding.def.BindingDefinition.generateCode(BindingDefinition.ja
va: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.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(DefaultExecut
or.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)
BUILD FAILED

-------[ binding file snippet ]----------

  <mapping name="Operation"
class="com.galdosinc.common.ogc.ows.capabilities.Operation" >
    <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
    <value name="name" field="name" style="attribute" usage="required"/>
    <structure field="dcpList"
factory="org.jibx.runtime.Utility.arrayListFactory">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.DcpType">
        <structure name="DCP">
          <structure name="HTTP" map-as="HTTPType"/>
        </structure>
      </collection>
    </structure>
    <structure field="parameterList"
factory="org.jibx.runtime.Utility.arrayListFactory"
         test-method="hasParameters" usage="optional">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.Parameter"/>
    </structure>
    <structure field="constraintList"
factory="org.jibx.runtime.Utility.arrayListFactory"
         test-method="hasConstraints" usage="optional">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.Constraint"/>
    </structure>
    <structure field="metadataList"
factory="org.jibx.runtime.Utility.arrayListFactory"
         test-method="hasMetadata" usage="optional">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.OwsMetadata"/>
    </structure>
  </mapping>
  <mapping abstract="true" type-name="HTTPType"
class="com.galdosinc.common.ogc.ows.capabilities.DcpTypeHttp">
    <structure field="requestMethodList"
factory="org.jibx.runtime.Utility.arrayListFactory">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.RequestMethod">
        <structure name="Get" map-as="GetRequestMethodType"
usage="optional"/>
        <structure name="Post" map-as="PostRequestMethodType"
usage="optional"/>
      </collection>
    </structure>
  </mapping>
  <mapping abstract="true" type-name="GetRequestMethodType" 
 
class="com.galdosinc.common.ogc.ows.capabilities.GetRequestMethod">
    <structure map-as="RequestMethodType"/>
  </mapping>
  <mapping abstract="true" type-name="PostRequestMethodType" 
 
class="com.galdosinc.common.ogc.ows.capabilities.PostRequestMethod">
    <structure map-as="RequestMethodType"/>
  </mapping>
  <mapping abstract="true" type-name="RequestMethodType" 
 
class="com.galdosinc.common.ogc.ows.capabilities.AbstractRequestMethodTy
pe">
    <structure map-as="com.galdosinc.common.ogc.xml.SimpleLink"/>
    <structure field="constraintList"
factory="org.jibx.runtime.Utility.arrayListFactory"
         test-method="hasConstraints" usage="optional">
      <collection
item-type="com.galdosinc.common.ogc.ows.capabilities.Constraint"/>
    </structure>
  </mapping>
----------------[ end ]------------------


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to