commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: betwixt:
Date Wed, 31 May 2006 20:47:01 GMT
On Wed, 2006-05-31 at 09:47 +0200, Stefano Orselli wrote:
> I've a problem with betwixt 0.7
> I work on a Apache Tomcat/5.0.28
> java 1.4.2_01-b06
> i write this java code:
>             String prefix = context.getRealPath("/");
>             String xmlpath = prefix + "xmlpdf/";
>             (new File(xmlpath)).mkdirs();
>             FileWriter fWriter = new FileWriter(xmlpath + 
> "output_"+System.currentTimeMillis()+".xml");
>             BeanWriter bWriter = new BeanWriter(fWriter);
>             bWriter.enablePrettyPrint();
>             bWriter.setIndent("\t");
>             bWriter.write("qualforn", ib);
>             bWriter.flush();
>             bWriter.close();
> when run this code for the first time i find a correct xml file,
>         <qualforn id="1">
>         <istanza__compilatore_societa_sede__xx/>
>         <istanza__data_creazione__xx>2006-05-24</istanza__data_creazione__xx>
> when from start the second time this i have an empty xml file with only the 
> first row:
>             <qualforn idref="1"/>
> If i restart the tomcat i can run the servlet and i have a correct result 
> only the first time that i run the code.

this looks to be a problem with involving id referencing. betwixt can
keep track of instances and use an id when they occur later in the
object graph. looks like the cache isn't getting cleared between

if you don't want betwixt to keep track of id's (and have an object
graph without cyclic bean references) then the easiest way to fix this
is to switch off id's (getConfiguration().setMapIDs(false)).

the cause may be a bug in betwixt or your configuration. if you're
willing to contribute a unit test to the ASF (please file a report in
JIRA) i'll take a look.

- robert

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

View raw message