users@jaxb.java.net

Re: JAXB 1.0.1 Sealing Violation

From: Prashant <prashant_at_pramati.com>
Date: Wed, 07 Dec 2005 15:44:37 +0530

>> I have a thrid party code which uses jaxb RI 1.0.1 classes from a
>> sealed jar, where as other parts of my code are generated using JAXB
>> 1.0.4 that is distributed with JWSDP.
>
>
>
> JAXB RI ver.X can run applications that are developed with JAXB RI
> ver.Y as long as X>Y. So you can put jaxb-impl.jar from JAXB 1.0.4,
> throw away all JAXB 1.0.1 jars, and it should work.


I had tried that too. I copied all the 4 jaxb jars from 1.0.4
distribution (jaxb-apis, jaxb-impl, jaxb-libs, and jaxb-xjc) to replace
those 4 jars from 1.0.1 version.

In that case I get the following exception

javax.xml.bind.JAXBException: The specified package
"com.sun.ts.lib.porting.web" is incompatible with the current JAXB runtime.
   at
com.sun.xml.bind.ContextFactory_1_0_1.createContext(ContextFactory_1_0_1.java:43)

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:324)
   at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:96)
   at
javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:229)
   at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)
   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
   at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
   at
com.sun.ts.lib.porting.DeploymentInfo.unmarshalFile(DeploymentInfo.java:315)

.....

Sure enough when i check the jaxb-impl.jar (1.0.4) version it does
package the ContectFactory_1_0_1.class

$ jar -tvf jaxb-impl.jar | grep ContextFactory
  720 Thu Jul 07 09:23:24 IST 2005 com/sun/xml/bind/ContextFactory.class
 3504 Thu Jul 07 09:23:24 IST 2005
com/sun/xml/bind/ContextFactory_1_0_1.class

-Prashant

>
>> Is jaxb 1.0.1 and other jars needed to XJCTask available for download
>> anywhere ? I looked here
>> <https://jaxb.dev.java.net/servlets/ProjectDocumentList?folderID=3952&expandFolder=3952&folderID=3956>.
>> :(
>
>
>
> Back in the old days, we didn't use to have the JAXB RI standalone
> distribution, so that's probably why we don't have 1.0.x bundles in
> the downloads section.
>
> There should be download for older versions of JWSDP (that includes
> JAXB), so I'll find out where they are and link them to the downloads
> section.
>