users@jaxb.java.net

Re: Re : Changing JAXB version

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Wed, 28 May 2003 11:18:29 -0400

Tito,

There were some significant changes between beta and fcs[1]. I'm not totally
sure that you can just replace the beta jar files with the fcs jar files and
have it work - you might be better off just installing JAXB from the JWSDP1.1
bundle. Once you've gotten that all set up, you will have to recompile your
schema(s) to generate new interfaces and implementation classes. There were
some bugs in beta where we weren't generating the correct interfaces and there
were late requirement changes from the expert group, so you will likely have
to update your client application code as well.

Thanks,

--Ryan

[1]http://java.sun.com/webservices/docs/1.1/jaxb-1.0/ReleaseNotes.html#changes

SUBSCRIBE JAXB-INTEREST Tito wrote:
> 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.ValidationEvent)
>>void com.sun.xml.bind.marshaller.Util.handlePrintConversionException(java.lang.Object, 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
>
>