opensubscriber
   Find in this group all groups
 
Unknown more information…

j : jibx-users@lists.sourceforge.net 6 May 2012 • 4:36PM -0400

[jibx-users] problem with binding.. Help needed
by Rajesh Khan

REPLY TO AUTHOR
 
REPLY TO GROUP




I have the following binding file in a folder called example 24

<binding xmlns:tns="ns" package="example24" name="binding"
trim-whitespace="true">
  <namespace uri="ns" default="elements" prefix="tns"/>

<mapping abstract="true" type-name="tns:item" class="example24.Item">
    <value style="attribute" name="id" get-method="getId"
set-method="setId"/>
    <value style="attribute" name="quantity" get-method="getQuantity"
set-method="setQuantity"/>
    <value style="attribute" name="price" get-method="getPrice"
set-method="setPrice"/>
  </mapping>
</binding>

and the code for Item (Item.java) is placed next to binding.xml
package example24;
public class Item
{
    private String id;
    private int quantity;
    private Float price;

    public String getId()
    { return id; }


    public void setId(String id)
    {  this.id = id;    }

    public int getQuantity()
    {  return quantity; }


    public void setQuantity(int quantity)
    {  this.quantity = quantity; }


    public Float getPrice()
    { return price; }

    public void setPrice(Float price)
    {   this.price = price;   }
}

And to generate the binding here is what i do and the output i get
C:\jibx\tutorial>java -jar C:\jibx\lib\jibx-bind.jar example24\binding.xml
Error: Cannot find information for class example24.Item; on mapping element
at (
line 4, col 71, in binding.xml)
Error running binding compiler
org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of
valid
ation errors
        at org.jibx.binding.Utility.loadBinding(Utility.java:358)
        at org.jibx.binding.Utility.loadFileBinding(Utility.java:420)
        at org.jibx.binding.Compile.compile(Compile.java:217)
        at org.jibx.binding.Compile.main(Compile.java:384)

Any suggestions ??

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.