users@jersey.java.net

[Jersey] Jersey WadlGeneratorTask

From: jason calton <jasoncalton_at_hotmail.com>
Date: Mon, 11 Apr 2011 22:47:39 -0400

I am trying to make an Ant task build a WADL file and apply xsl to it, but the WadlGeneratorTask is failing.
 
Below is my ant task and the error I receive. Does anybody see something wrong in my ant task?
 
Thanks.
Jason
 
 
 
 
    <target name="-post-compile">
        <path id="module.enhancer.classpath">
            <pathelement path="${javac.classpath}"/>
            <pathelement location="${build.classes.dir}"/>
        </path>
        <echo message="WADL Generation"/>
        <taskdef name="generatewadl" classpathref="module.enhancer.classpath" classname="com.sun.jersey.api.wadl.WadlGeneratorTask" />
        <generatewadl classpathref="module.enhancer.classpath" destfile="${webinf.dir}/wadl.xml" baseUri="http://www.whatever.com" />
    </target>
 
 
 

WADL Generation
build.xml:41:
java.lang.NullPointerException
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:275)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
        at com.sun.jersey.api.wadl.WadlGeneratorTask.execute(WadlGeneratorTask.java:142)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:281)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
BUILD FAILED (total time: 7 seconds)