users@jaxb.java.net

Re: JAXB RI 1.0 -> 1.0.2 - package name change?

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Fri, 12 Mar 2004 11:03:31 -0500

Tom.Kerigan_at_td.com wrote:

>
>
>
> Hey Ryan,
>
> In lieu of sending a post to the JAXB mailing list, I was hoping that you
> could answer a quick question. We recently re-generated our classes with
> JAXB RI 1.0.2 and noticed that the code that was produced wasn't like the
> code produced by the 1.0 version. Our major concern is that our
> 1.0-generated code doesn't run against the 1.0.2 jars ... things like
> package names have been moved around ... is there any sort of backwards
> compatibility flag that we have to turn on that allows us to drop in the
> new jar files for JAXB and not have to re-generate our classes? If we do
> have to re-generate our classes, is this something we'll have to do every
> time we want to upgrade our version of JAXB? This could become rather
> arduous as our collection of JAXB-specific assets continues to grow in size
> and complexity.
>

Hi Tom,

There is no backwards compatibility switch on xjc that would cause the
1.0.2 compiler to generate 1.0 code, for example. We run our entire unit
testsuite nightly to make sure that code generated by older versions of
xjc run in the current build. What this means is that we compile all
of the schemas with xjc v1.0 and then run all of the code in the current
build of the upcoming 1.0.3 release. Then we do the same thing for the
1.0.1, and 1.0.2 versions of the compiler. In this way, we are confident
that you can deploy older generated code on the latest runtime.

As you pointed out, there have been some changes in the way the code is
generated. I think the most significant change was between 1.0.1 and
1.0.2 when we migrated some of our compiler code down into the generated
impl.runtime package. However, none of these changes should impact your
ability to deploy old code on a new runtime. If it doesn't work, then
it is a bug that we'd like to investigate. I assume the differences in
code generation you mentioned are in the impl sub-packages, right? I
wouldn't expect there to be any differences in the generated interfaces
or their package names (modulo bug fixes) since the specification hasn't
changed.

The only time you would want to regenerate your code with a newer version
of the compiler is to get a bug fix in the code generation. If you're
happy with the code, then I see no reason that you would need to regenerate
it.

> As well, how can we tell if we have the 1.0 beta jars vs. the 1.0 RCS jars?
>

I think the easiest way is to look at one of your generated ObjectFactory
classes. If the factory methods are static, then you're running 1.0 beta.
We neglected to bake any kind of versioning info into the generated code
or compiler until 1.0.1. If you are running the old beta code, then I
don't think we can guarantee backwards compatibility. We had to make
some significant changes to the specification and implementation between
beta and FCS and I'm not sure beta code will work in any of the later
runtimes.

Read through the changelog[1] for more detail about the release deltas,
especially between beta and fcs (if you're using beta).

> Thanks in advance for any help you can provide - also, if we really
> *should* be posting this to the mailing list, please let me know and I will
> do so, accordingly.
>

I'll send a Cc: to the list in case anyone else is interested.

Let us know if you have any other questions...

Thanks,

--Ryan

[1] http://java.sun.com/webservices/docs/1.3/jaxb/changelog.html


> Cheers,
>
> Thomas Kerigan
> Consultant, Technology & Architecture
> TD Canada Trust Technology Solutions, TDBFG
> 905.293.5222
> tom.kerigan_at_td.com
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net