Skip to main content

JAXB 2.0 with JDK 1.4

3 replies [Last post]
Joined: 2005-01-17

After evaluating all the xml binding products out there, we decided to go with JAXB 1.0.

Couple of main reasons were

1) Industry support - evolving standard; this knocked out Jibx.
2) Speed - 3 times that of XMLBeans & 3 times less memory usage.

Even though JAXB 2.0 is getting out, unfortunately we can't use it as we deploy our app on weblogic 8, which till now doesn't have support for jdk1.5.

Is there anyway we can use JAXB 2.0 with JDK 1.4 by getting third-party annotation compiler? We are looking for Apache license style products...

Thanks a bunch.

Reply viewing options

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

Unfortunately it's probably impossible. For one thing, the API jar is heavily using Tiger features. Those classes won't even load in JDK 1.4.

I agree that in theory, the RI might be able to use xdoclet-like annotation compiler to store annotations externally, and then read it back at the runtime, but I think this API class file version issue is critical.

I think people agree that the value that J2SE 5.0 brings to JAXB is tremendous, and we are hoping that by the time JAXB 2.0 ships, it will be more wide-spread.

Joined: 2003-06-17

Codehaus has backported jdk1.5 annotations to jdk1.4!

Could we now have jaxb2.0 with jdk1.4?


Joined: 2003-06-09

I saw that news and I was thinking about that, too.

One possible approach would be:

1. retroweave the JAXB API jar. It also needs to change the annotation types so that they become ordinary interfaces that doesn't derive from java.lang.Annotation (because it won't be there in the runtime.)

2. The JAXB RI has an internal abstraction layer to work with other sources of annotations. We need to add a new implementation of this that uses backport175.

3. We have to make sure that we don't rely on newly introduced functionalities in JDK1.5 (at least such dependency needs to be isolated). This is more work, but this should be possible.

4. retroweave the JAXB RI.

In this way, I think you can write applications with 1.5, retroweave it, and ship that with those modified JAXB RI. The runtime aspect of backport175 is still unclear to me, so there could be some pieces that I'm missing.

Another concern is that I'm not sure if the JCP allows you to modify the API jar in such a substantial way. Perhaps you need to rename the package, too. But then, you have to program differently for 1.4 and 1.5, which isn't nice.