Problema com xml

Pessoal, n sei mais o que fazer com meu problema aqui.
Ja tentei usar JDOM, XStream, Jaxb eo carai a 4.

preciso salvar este objeto em xml.

public class Relatorio {

    private List<Band> bands;
    private List<Tabela> tabelas;
    private List<OrderBy> orderBy;
    private List<String> restricao;

    public Relatorio() {
        this.bands = new ArrayList<Band>();
        this.tabelas = new ArrayList<Tabela>();
        this.orderBy = new ArrayList<OrderBy>();
        this.restricao = new ArrayList<String>();        
    }
}
public class Band {

    private String nome;
    private List<Function> functions;
    private List<StaticText> staticTexts;
    private List<TextField> textFields;
    private List<Group> groups;
    private CheckListItem item;    
    private boolean isGroup = false;

    public Band(){
        this.nome = "";
        this.functions = new ArrayList<Function>();
        this.staticTexts = new ArrayList<StaticText>();
        this.textFields = new ArrayList<TextField>();
        this.groups = new ArrayList<Group>();
        this.item = new CheckListItem("");
        this.isGroup  = false;
        
    }
}

//esse é o codigo que salva o objeto
Writer w = null;

        try {
            JAXBContext context = JAXBContext.newInstance(Tabela.class);
            Marshaller m = context.createMarshaller();
            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            m.marshal(this.relatorio.getTabelas(), System.out);


            w = new FileWriter(pathOpen);
            m.marshal(this.relatorio.getTabelas(), w);
        } catch (JAXBException ex) {
            Logger.getLogger(FormPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        } catch(Exception e){
        }finally {
            try {
                w.close();
            } catch (Exception e) {
            }
        }

//e este é o erro
GRAVE: null
javax.xml.bind.JAXBException: class java.util.ArrayList nor any of its super class is known to this context.
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:554)
	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:470)
	at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314)

já n sei mais o qeu fazer
alguma luz nessa bagaça??
abrass

Cara,

Se vc quer usar o JAXB vc tem que anotar as classes e os atributos com p. ex @XmlType, @XmlElement.

Dê uma olhada: http://www.devmedia.com.br/articles/viewcomp.asp?comp=11547

luiz tem dado outro erro pq algumas da minhas classes deste objeto implementam interfaces e o jaxb n consegue controlar estas interfaces…
ao menos foi o que me pareceu no erro.

vc conhece alguma API de processamento xml que de suporte a interfaces?
segue o erro a baixo

GRAVE: null
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 15 counts of IllegalAnnotationExceptions
javax.swing.Icon is an interface, and JAXB can’t handle interfaces.
this problem is related to the following location:
at javax.swing.Icon
at public javax.swing.Icon javax.swing.JLabel.getDisabledIcon()
at javax.swing.JLabel
at br.com.topsoft.topBI.Entidade.Function
at public java.util.List br.com.topsoft.topBI.Entidade.Band.getFunctions()
at br.com.topsoft.topBI.Entidade.Band
javax.swing.Icon does not have a no-arg default constructor.
this problem is related to the following location:
at javax.swing.Icon
at public javax.swing.Icon javax.swing.JLabel.getDisabledIcon()
at javax.swing.JLabel
at br.com.topsoft.topBI.Entidade.Function
at public java.util.List br.com.topsoft.topBI.Entidade.Band.getFunctions()
at br.com.topsoft.topBI.Entidade.Band

Eu nunca tentei usar interfaces com o JAXB , pela mensagem não aceita.
Esse post http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html explica porque.
Algumas das suas classes implementam interfaces?
No caso vc tem como atributo javax.swing.JLabel ou componentes Swing??? Se sim acredito que não seja possível (até onde sei - se alguém souber pode dizer)…

Acho que posso te ajudar,
mas só depois das 10:00 que agora to trampando.

[code]//Já trabalho XStream, então fica mais facil de vc entender, bom vo deixar aqui para vc ver.

XStream xStream = new XStream(); // vc já deve ter os jar, bom assim fico facil é só colocar fazer o mesmo no seu codigo e rodar

// Aqui tem de passar o objeto que deseja salvar
String objetoToString = xStream.toXML( objetoQueDesejaSalvar ); // Transforma o meu objeto para uma String XML

// Local onde deseja salvar
PrintWriter gravador = new PrintWriter(new FileWriter(“Local onde desejo salvar”)); // local a salvar, não pode esquecer de colocar um nome ao seu arquivo kkkk

// Grava o teu objeto
gravador.print(objetoToString);
gravador.close();[/code]

Espero ter ajudado