You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stefano Orselli <st...@postecom.it> on 2006/05/31 09:47:11 UTC
betwixt:
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.
thanks for the help
Ciao
Stefano Orselli
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: betwixt:
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
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
invocations.
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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org