Skip to main content

Request no.1 - different filenames for JAXB and JAXB 2.0

3 replies [Last post]
kirillcool
Offline
Joined: 2004-11-17
Points: 0

Original request - All jar files should have different names from JAXB 1.0 files. This will allow using old code alongside the new (during the transition phase).
Kohsuke comment - you can override JAXB 1.0's jaxb-impl.jar with JAXB 2.0's jaxb-impl.jar and jaxb1-impl.jar, and you can have old code along side the new one. (Or maybe alternatively should we name it jaxb2-impl.jar and jaxb-impl?) Do you still feel that we should be renaming jars?

In fact, this is exactly what i have done in order to be able to run both JAXB and JAXB 2.0 in the same project. As long as JAXBContext, Marshaller and Unmarshaller of JAXB 2.0 are backward-compatible, there should be no problem, although i don't know what is ClassLoader policy when it has two classes with the same name in two different jars.

The choice is up to you, but i think it would be more apropriate to use new name for JAXB 2.0 in order not to break existing build files.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09
Points: 0

I think one of the reason we chose to call it "jaxb-impl.jar" and "jaxb1-impl.jar" is that I wanted it to be very clear that people developing against 2.0 will not need to redistribute jaxb1-impl.jar.

If we call it "jaxb2-impl.jar" and "jaxb-impl.jar", unless you read a documnetation carefully, you might get an impression that you need both.

Having 1.0 applications and 2.0 applications side-by-side in the same ClassLoader is something we do expect to happen, and I believe regardless of the naming scheme, this works.

Also, the JAXB 2.0 API jar is backward compatible.

kirillcool
Offline
Joined: 2004-11-17
Points: 0

In order to run application with JAXB 1.0, you need jaxb-api.jar, jaxb-impl.jar, jaxb-libs.jar, relaxngDatatype.jar and xsdlib.jar.
To run application with JAXB 2.0, you need jaxb-api.jar, jaxb-impl.jar and jsr173_api.jar (i guess the last one will change its name).

I understand your concern about the implicit meaning of jaxb2-impl.jar, but in my opinion a name jaxb-impl2.0.jar conveys that this is a completely new version.
In any case, i would like to see as few jars as possible to add to my application. Why have three different jars if you must have them all both for compiling the generated classes and for running the application?

And speaking about backward compatibility - are these 3 jars covering all the functionality that was available in JAXB 1.0 and does it incur some runtime overhead penalty?

Regards
Kirill

kohsuke
Offline
Joined: 2003-06-09
Points: 0

To run JAXB 1.0 applications on top of the JAXB RI 2.0, your classpath needs to have jaxb-api.jar, jaxb-impl.jar, jaxb1-impl.jar, relaxngDatatype.jar, xsdlib.jar, all from JAXB RI 2.0 distribution. (Note that there's no jaxb-libs.jar)

No need to keep around jars from JAXB RI 1.0.

> And speaking about backward compatibility - are these
> 3 jars covering all the functionality that was
> available in JAXB 1.0 and does it incur some runtime
> overhead penalty?

"3 jars" is for running JAXB 2.0 applications on to p of JAXB RI 2.0. So I'm assuming that your question is "can a JAXB 2.0 application do everything a JAXB 1.0 application can do?"

We replaced the validation functionality by using JAXP 1.3. It's somewhat different from the way JAXB 1.0 used to do validation. Other than that, everything has been retained.