users@jaxb.java.net

Changing JAXB version

From: EBAStep2 <ebastep2_at_sia.it>
Date: Tue, 27 May 2003 19:34:25 +0200

hi,
I've changed my JAXB version from beta to 1.0 simply changing "jar" files
with the new ones (jwsdp-1.1), but now my marshal doesn't work anymore with
this exception :

DefaultValidationEventHandler: [ERROR]: null
com.sun.xml.bind.serializer.AbortSerializationException
        java.lang.Throwable(java.lang.String)
        java.lang.Exception(java.lang.String)
        org.xml.sax.SAXException(java.lang.String)

com.sun.xml.bind.serializer.AbortSerializationException(java.lang.String)
        void
com.sun.xml.bind.marshaller.SAXMarshaller.reportError(javax.xml.bind.Validat
ionEvent)
        void
com.sun.xml.bind.marshaller.Util.handlePrintConversionException(java.lang.Ob
ject, java.lang.Exception, com.sun.xml.bind.serializer.XMLSerializer)
        void
FvrSchema.impl.XctFvrSTPPlusBlkCdtTrfTypeImpl.serializeElements(com.sun.xml.
bind.serializer.XMLSerializer)
        void
FvrSchema.impl.XctFvrSTPPlusBlkCdtTrfImpl.serializeElements(com.sun.xml.bind
.serializer.XMLSerializer)
        void
com.sun.xml.bind.marshaller.MarshallerImpl.write(com.sun.xml.bind.serializer
.XMLSerializable, org.xml.sax.ContentHandler)
        void
com.sun.xml.bind.marshaller.MarshallerImpl.marshal(java.lang.Object,
javax.xml.transform.Result)
        void
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(java.lang.Object,
java.io.OutputStream)
        void fvrgenerator.JaxbFvr.createFvr()
        void fvrgenerator.FvrGenerator.main(java.lang.String [])

--------------- linked to ------------------
javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.serializer.AbortSerializationException]
        java.lang.Throwable(java.lang.String)
        java.lang.Exception(java.lang.String)
        javax.xml.bind.JAXBException(java.lang.String, java.lang.String,
java.lang.Throwable)
        javax.xml.bind.MarshalException(java.lang.String, java.lang.String,
java.lang.Throwable)
        javax.xml.bind.MarshalException(java.lang.Throwable)
        void
com.sun.xml.bind.marshaller.MarshallerImpl.write(com.sun.xml.bind.serializer
.XMLSerializable, org.xml.sax.ContentHandler)
        void
com.sun.xml.bind.marshaller.MarshallerImpl.marshal(java.lang.Object,
javax.xml.transform.Result)
        void
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(java.lang.Object,
java.io.OutputStream)
        void fvrgenerator.JaxbFvr.createFvr()
        void fvrgenerator.FvrGenerator.main(java.lang.String [])

JAXBExceprion :null

This is an extract of my code:



JAXBContext oj = JAXBContext.newInstance("my.schema");
ObjectFactory objfactory = new ObjectFactory();
MySchema xmlFvr = objfactory.createMyschema();
Field1 F1 = objfactory.createField1();
F1.setaaa("aaa");
...
...
...

//Meggison classes to supports namespace prefix
XMLWriter writer = new XMLWriter();
writer.setPrefix("urn:XctFvr:xsd:$Schema1", "s1");
writer.setPrefix("urn:sw:xsd:$Schema2", "s2");
writer.forceNSDecl("urn:sw:xsd:$Ns1");


try {
        writer.setOutput(
                new PrintWriter(
                new BufferedWriter(new FileWriter(FvrGenerator.pathFvr +
fvrFlNm + ".xml"))));
} catch (FileNotFoundException ioe) {
        FvrGenerator.traceErrore = ioe.getMessage();
        throw ioe;
}


Marshaller m = oj.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,"urn:XctFvr:xsd:$Schema1
Schema1.xsd");

m.marshal(xmlFvr, writer);

} catch (JAXBException je) {
        je.printStackTrace();
        FvrGenerator.traceErrore = je.getMessage();
        throw je;



Is there anything more than "jar" files do I need to change to upgrade my
version or something is changed al coding-level ?

Thanks,

Tito


*******************Internet Email Confidentiality Footer*******************
Qualsiasi utilizzo non autorizzato del presente messaggio nonche' dei suoi
allegati e' vietato e potrebbe costituire reato. Se lei ha ricevuto
erroneamente il presente messaggio, Le saremmo grati se, via e-mail, ce ne
comunicasse la ricezione e provvedesse alla distruzione del messaggio stesso
e dei suoi eventuali allegati. Le dichiarazioni contenute nel presente
messaggio nonche' nei suoi eventuali allegati devono essere attribuite
esclusivamente al mittente e non possono essere considerate come trasmesse o
autorizzate da SIA S.p.A.; le medesime dichiarazioni non impegnano SIA
S.p.A. nei confronti del destinatario o di terzi.
SIA S.p.A. non si assume alcuna responsabilita' per eventuali
intercettazioni, modifiche o danneggiamenti del presente messaggio e-mail.

Any unauthorized use of this e-mail or any of its attachments is prohibited
and could constitute an offence. If you are not the intended addressee
please advise immediately the sender by using the reply facility in your
e-mail software and destroy the message and its attachments. The statements
and opinions expressed in this e-mail message are those of the author of the
message and do not necessarily represent those of SIA. Besides, The contents
of this message shall be understood as neither given nor endorsed by SIA
S.p.A..
SIA S.p.A. does not accept liability for corruption, interception or
amendment, if any, or the consequences thereof.