dev@wadl.java.net

Java 6 & scripts

From: Wilfred Springer <wilfredspringer_at_gmail.com>
Date: Sun, 11 Nov 2007 07:16:47 +0100

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)