So, two things that finally made the code work: 1. Betwixt can not handle private static inner classes as beans, only public static inner classes. This is true even if the marshalling is done in the outer class which has immediate access to its private static class. Is it a bug?
2. Using ByteArrayOutputStream as an underlying stream for BeanWriter requires closing the BeanWriter (unlike the case with StringWriter) to produce the XML. Is it a bug? 3. Why the default configuration of BeanReader produces INFO messages? Why do i need to see them, and how do i change the log level *programatically (without property file)* not to see them? Thanks Kirill --- Kirill Grouchnikov <[EMAIL PROTECTED]> wrote: > Robert > > > i think that dion was trying to establish whether it's > > the local > > environment. if you're building from source then > running > > the tests is a > > good way to discover whether everything's ok. since > > you're using a > > binary, is it the latest release (0.7)? > > I'm using 0.7 binaries. > > > which sample code? > > The one from > http://jakarta.apache.org/commons/betwixt/guide/examples.html > > I've just put everything in one class, and the mian > function performs both marshalling and unmarshalling. > > > it doesn't look like the code on the getting start > page, > > not like the > > tutorial. i'm going to guess that you're running one > from > > the example > > page (please correct me if i'm wrong)... > > You are correct. In addition, the code from the example > page uses 3 deprecated functions. > > > > The writing didn't produce values for subelements, > and > > the > > > unmarshaling failed completely with two error > messages. > > > > i've just pulled the code from the website and run it > in > > ecplise. i get > > the following trace from the read sample: > > > > INFO: Cannot pop options off empty stack > > PersonBean[name='James Smith',age='25']04-Aug-2005 > > 22:50:30 > > org.apache.commons.betwixt.expression.Context > popOptions > > INFO: Cannot pop options off empty stack > > > > which is right (the person bean is populated) > > > > for the write i get; > > > > <?xml version='1.0' ?> <person> > > <age>21</age> > > <name>John Smith</name> > > </person> > > > > which is also correct. > > > > so, these examples work fine for me. so, i think that > > it's probably some > > kind of environmental or setup issue. the best thing to > > do would be to > > run again with logging turned up nice and high. > > How do i set up the logging nice and high? Not all the > world is using commons, you know. > > > > > this bit of the trace: > > > > Could not create instance of type: > > org.jvnet.bindmark.CheckBetwixtPersonBean > > > > suggests to me that you have an issue with your > > classpath, access > > permissions on the bean or don't have an empty > > constructor for the bean, > > This class is inner private static and has public > constructor. > > Kirill > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
