commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Goetz <>
Subject [betwixt] setting false object when parsing xml
Date Thu, 04 Sep 2008 16:22:31 GMT

Hi list!

I try to get betwixt 0.8 up and running and would like to map Java objects
to RSS 2.0 XML. It works fine up to the Item class, but then I can not get
the Category objects. Here is my Item.betwixt: 
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
  <element name="item">
    <element name="title" property="title" />
    <element name="category" property="category" />

And the Category.betwixt: 
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
  <element name="category" property="name">
    <attribute name="domain" property="domain" />

As you can see, my Item class has a property of Category, which itself has a
name and a domain member. When I run the serialisation I can see that my
Items are constructed, that the Category objects are constructed, but then I
get this in the log file: 
DEBUG [org.apache.commons.betwixt.expression.MethodUpdater] Calling setter
method: setName on bean: [...].Item@143c8b3 with new value:
WARN [org.apache.commons.betwixt.expression.TypedUpdate] cannot evaluate:
MethodUpdater [method=public void [...].Category.setName(java.lang.String)]
on bean: [...].Item@143c8b3 of type: [...].Item with value:
[...].Category@1feca64 of type: [...].Category

It looks as if betwixt would try to call setName on the Item class instead
of Category. Can anyone explain me why this is happening? Am I missing
something in my mapping files? 

Thanks a lot for your help!

View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message