Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Exception then trying to run wadl2java on Fedora #52

Open
glassfishrobot opened this issue Oct 27, 2012 · 15 comments
Open

Exception then trying to run wadl2java on Fedora #52

glassfishrobot opened this issue Oct 27, 2012 · 15 comments

Comments

@glassfishrobot
Copy link
Contributor

Tried to run the Yahoo example:

./wadl2java -o tst -s jaxrs20 -p test.yahoo YahooSearch.wadl

And got the exception:

Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
at org.jvnet.ws.wadl2java.Wadl2Java.generateEndpointClass(Wadl2Java.java:618)
at org.jvnet.ws.wadl2java.Wadl2Java.process(Wadl2Java.java:472)
at org.jvnet.ws.wadl2java.Main.main(Main.java:143)
Caused by: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155)
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105)
... 6 more

Affected Versions

[1.1.3]

@glassfishrobot
Copy link
Contributor Author

Reported by walec51

@glassfishrobot
Copy link
Contributor Author

Issue-Links:
blocks
WADL-58
is duplicated by
WADL-53

@glassfishrobot
Copy link
Contributor Author

walec51 said:
You need to:

  • add the jersey-client-1.13.jar to the wadl distributions lib directory
  • add jersey-client-1.13.jar and jersey-core-1.13.jar to the MANIFEST.MF file in wald-cmdline-1.1.3.jar

Please correct the bundle in the next release

@glassfishrobot
Copy link
Contributor Author

@pavelbucek said:
jersey-client is not needed for client generation, problem was with missing UriBuilder impl. Anyways, thanks for the hint!

fixed in the trunk.

@glassfishrobot
Copy link
Contributor Author

jkidd said:
No works - I did a compile of trunk version through maven - same issue again, so it is not fixed in trunk AFAIK.

C:\Users\jkv\Desktop\wadl-dist-1.1.4-SNAPSHOT-bin\wadl-dist-1.1.4-SNAPSHOT\bin>w
adl2java.bat -o here -p com -a http://funk314i:8081/fapi/security-1.0.0/applicat
ion.wadl
Info: Processing: http://funk314i:8081/fapi/security-1.0.0/application.wadl
Info: Processing: http://funk314i:8081/fapi/security-1.0.0/application.wadl/xsd0.xsd
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
at org.jvnet.ws.wadl2java.Wadl2Java.generateEndpointClass(Wadl2Java.java:669)
at org.jvnet.ws.wadl2java.Wadl2Java.process(Wadl2Java.java:523)
at org.jvnet.ws.wadl2java.Main.main(Main.java:143)
Caused by: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155)
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105)
... 6 more

@glassfishrobot
Copy link
Contributor Author

@pavelbucek said:
sorry, looks like commit failed for some reason and I haven't noticed; can you please try again with latest trunk?

@glassfishrobot
Copy link
Contributor Author

jkidd said:
Still no works. New error, but no works - stacktrace is as follows:

C:\Users\jkv\Desktop\wadl-dist-1.1.4-SNAPSHOT-bin\wadl-dist-1.1.4-SNAPSHOT\bin>wadl2java.bat -o here -p com -a http://funk314i:8081/fapi/security-1.0.0/application.wadl
Info: Processing: http://funk314i:8081/fapi/security-1.0.0/application.wadl
Info: Processing: http://funk314i:8081/fapi/security-1.0.0/application.wadl/xsd0.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/core/MultivaluedMap
at org.jvnet.ws.wadl.ast.WadlAstBuilder.addMethodToParent(WadlAstBuilder.java:375)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.addMethodToResource(WadlAstBuilder.java:330)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildResourceTree(WadlAstBuilder.java:225)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildResourceTree(WadlAstBuilder.java:222)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildAst(WadlAstBuilder.java:150)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildAst(WadlAstBuilder.java:113)
at org.jvnet.ws.wadl2java.Wadl2Java.process(Wadl2Java.java:426)
at org.jvnet.ws.wadl2java.Main.main(Main.java:143)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.MultivaluedMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 8 more

@glassfishrobot
Copy link
Contributor Author

@pavelbucek said:
can you share your application.wadl and xsd0.xsd files? I can't reproduce locally, so looks like there is something special/not yet covered in your wadl.

@glassfishrobot
Copy link
Contributor Author

File: xsd0.xsd
Attached By: jkidd

@glassfishrobot
Copy link
Contributor Author

jkidd said:
Files attached to give Pavel a better change to debug

@glassfishrobot
Copy link
Contributor Author

File: application.wadl
Attached By: jkidd

@glassfishrobot
Copy link
Contributor Author

@pavelbucek said:
thanks for the testcase! however, I'm not able to reproduce on my laptop:

$ ./bin/wadl2java -o tst -p tst -a application.wadl 
Info: Processing: file:/Users/pavel/wadl/wadl~svn/trunk/wadl/wadl-dist/target/wadl-dist-1.1.4-SNAPSHOT/application.wadl
Info: Processing: file:/Users/pavel/wadl/wadl~svn/trunk/wadl/wadl-dist/target/wadl-dist-1.1.4-SNAPSHOT/xsd0.xsd

$ find ./tst/
./tst/
./tst/generated
./tst/generated/ObjectFactory.java
./tst/generated/SecurityToken.java
./tst/tst
./tst/tst/Funk314i_FapiSecurity100.java

I think this might be related to windows/wadl2java.bat..

@glassfishrobot
Copy link
Contributor Author

jkidd said:
Same goes for cygwin
jkv@STOUT /cygdrive/c/Users/jkv/Desktop/wadl-dist-1.1.4-SNAPSHOT-bin/wadl-dist-1.1.4-SNAPSHOT/bin
$ ./wadl2java -o here -p com -a http://localhost:8081/fapi/user-1.0.0/application.wadl
Info: Processing: http://localhost:8081/fapi/user-1.0.0/application.wadl
Info: Processing: http://localhost:8081/fapi/user-1.0.0/application.wadl/xsd0.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/core/MultivaluedMap
at org.jvnet.ws.wadl.ast.WadlAstBuilder.addMethodToParent(WadlAstBuilder.java:375)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.addMethodToResource(WadlAstBuilder.java:330)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildResourceTree(WadlAstBuilder.java:225)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildResourceTree(WadlAstBuilder.java:222)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildAst(WadlAstBuilder.java:150)
at org.jvnet.ws.wadl.ast.WadlAstBuilder.buildAst(WadlAstBuilder.java:113)
at org.jvnet.ws.wadl2java.Wadl2Java.process(Wadl2Java.java:426)
at org.jvnet.ws.wadl2java.Main.main(Main.java:143)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.MultivaluedMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 8 more

@glassfishrobot
Copy link
Contributor Author

ashleyross said:
wadl-cmdline-1.1.3.jar's MANIFEST.MF file contains:

Class-Path: wadl-core-1.1.3.jar localizer-1.0.jar comresrcgen-1.0.jar 
 activation-1.1.jar jaxb-xjc-2.2.jar jaxb-impl-2.2.jar jaxb-api-2.1.ja
 r stax-api-1.0-2.jar jsr311-api-1.1.1.jar

I believe it should contain:

Class-Path: wadl-core-1.1.3.jar localizer-1.0.jar comresrcgen-1.0.jar 
 activation-1.1.jar jaxb-xjc-2.2.jar jaxb-impl-2.2.jar jaxb-api-2.1.ja
 r stax-api-1.0-2.jar jsr311-api-1.1.1.jar jersey-core-1.13.jar jersey
 -client-1.13.jar

Note the addition of jersey-client-1.13.jar, without which I receive:

Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA WADL-52

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants