users@jaxb.java.net

R: Changing JAXB version

From: EBAStep2 <ebastep2_at_sia.it>
Date: Wed, 28 May 2003 14:03:56 +0200

Sorry, I've missed some information in my previous message.I did everything
you wrote except the installation of the other "jar" files of jwsdp-1.1 . Do
I need to upgrade something even if I don't use (e.g jaxm,jaxr...) ?
Thx,
Tito

-----Messaggio originale-----
Da: Laura Ferguson [mailto:allenderl_at_acm.org]
Inviato: marted? 27 maggio 2003 19.45
A: JAXB-INTEREST_at_JAVA.SUN.COM
Oggetto: Re: Changing JAXB version


At 07:34 PM 5/27/2003 +0200, you wrote:
>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

You've got lots more work to do.
1) Create a schema from your dtd.
2) Regenerate the generated classes using the revised xjc
3) See what changes these changes cause in the rest of your code -- there
will be some.

Along the way, you'll need to do a careful installation of jwsdp-1.1, copy
new libraries into any lib folders, etc....
This could take just a few hours or a week... depending.
Good luck...
Laura



*******************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.