dev@wadl.java.net

Re: Java 6 & scripts

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 12 Nov 2007 09:31:38 -0500

This occurs when you build with JAXB 2.1 but then try to run using the
JAXB 2.0 that is built into JDK 6. The simplest solution is to build
using JAXB 2.0 since the code doesn't use anything that is new in 2.1.
I believe that 2.1 is scheduled to appear in a future update to the
JDK but I don't know off hand when that is - I'll try to find out.

Marc.

On Nov 11, 2007, at 1:16 AM, Wilfred Springer wrote:

> Guys,
>
> In order to fix the problems with the copyrights in the scripts, I
> copied
> over a couple of scripts to the repository, and customized them to
> fit our
> needs. I haven't tried the Windows batch file yet though.
>
> I don't like the results all that much yet though. The shell script
> requires
> you to set JAVA_HOME, which is something that - I think - wasn't
> required
> before.
>
> Anyhow, while I was working on it, I ran into trouble using Java 6.
>
> Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is
> being
> loaded from the bootstrap classloader, but this RI (from
> jar:file:/home/wilfred/workspace/wadl-mavenized/source/wadl-dist/
> target/wadl-
> dist-1.0-SNAPSHOT/lib/jaxb-
> impl-2.1.4.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class)
> needs 2.1API. Use the endorsed directory mechanism to place
> jaxb-api.jar in the bootstrap classloader. (See
> http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
> at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(
> ModelBuilder.java:172)
> at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(
> JAXBContextImpl.java:422)
> at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(
> JAXBContextImpl.java:286)
> at com.sun.xml.bind.v2.ContextFactory.createContext(
> ContextFactory.java:139)
> at com.sun.xml.bind.v2.ContextFactory.createContext(
> ContextFactory.java:117)
> at com.sun.xml.bind.v2.ContextFactory.createContext(
> ContextFactory.java:188)
> 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:597)
> at
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
> at org.jvnet.ws.wadl2java.Wadl2Java.process(Wadl2Java.java:116)
> at org.jvnet.ws.wadl2java.Main.main(Main.java:120)
>
> Question is how we are going to deal with this. I could be passing the
> endorsed dir option, but then people using the Ant example would
> still be in
> trouble. Would there be an easy way to work around that problem? (
> http://weblogs.java.net/blog/kohsuke/archive/2007/02/running_jaxbws.html)

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.