On Apr 16, 2009, at 1:17 PM, Ludovic Champenois wrote:
> I am new to this project. Wanted to see what would be the generated
> code from a wadl file.
>
> First issue: the script points to the wrong jar:
> Macintosh-269:v3 ludo$ /Users/ludo/Documents/downloads/wadl-dist-1.1-
> SNAPSHOT/bin/wadl2java
> Unable to access jarfile /Users/ludo/Documents/downloads/wadl-
> dist-1.1-SNAPSHOT/lib/wadl-cmdline-1.0-SNAPSHOT.jar
>
> changed the 1.1 jar name to 1.0
>
Oops, I'll fix that.
> Second issue (from a generated WADL from Jersery in GlassFish v3
> nightly builds)
> :
> Macintosh-269:v3 ludo$ /Users/ludo/Documents/downloads/wadl-dist-1.1-
> SNAPSHOT/bin/wadl2java -o gen-src -p com.ludo http://localhost:9998/application.wadl
> Processing: http://localhost:9998/application.wadl
> javax.xml.bind.UnmarshalException: unexpected element (uri:"http://research.sun.com/wadl/2006/10
> ", local:"application"). Expected elements are <{http://wadl.dev.java.net/2009/02
> }application>,<{http://wadl.dev.java.net/2009/02}doc>,<{http://wadl.dev.java.net/2009/02
> }grammars>,<{http://wadl.dev.java.net/2009/02}include>,<{http://wadl.dev.java.net/2009/02
> }link>,<{http://wadl.dev.java.net/2009/02}method>,<{http://wadl.dev.java.net/2009/02
> }option>,<{http://wadl.dev.java.net/2009/02}param>,<{http://wadl.dev.java.net/2009/02
> }representation>,<{http://wadl.dev.java.net/2009/02}request>,<{http://wadl.dev.java.net/2009/02
> }resource>,<{http://wadl.dev.java.net/2009/02}resource_type>,<{http://wadl.dev.java.net/2009/02
> }resources>,<{http://wadl.dev.java.net/2009/02}response>
> at
> com
> .sun
> .xml
> .bind
> .v2
> .runtime
> .unmarshaller
> .UnmarshallingContext.handleEvent(UnmarshallingContext.java:556)
> at
> com
> .sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
> 199)
> at
> com
> .sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
> 194)
> at
> com
> .sun
> .xml
> .bind
> .v2
> .runtime
> .unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)
>
> Maybe I should revert to the firt release (pretty old?)
>
The problem is that there are two versions of WADL and the schema's
are slightly incompatible. You are trying to run the 1.1 draft code
against a 1.0 WADL. Currently Jersey produces 1.0 WADL so I suggest
you switch to the previous release, see:
https://wadl.dev.java.net/servlets/ProjectDocumentList?folderID=7152&expandFolder=7152&folderID=0
Marc.