4

As described here: http://wikis.sun.com/display/Jersey/WADL

I'm using Jersey 1.4 in Tomcat 6.

I have tried every possible URI with a "/application.wadl" and all I get is a 404 (not available). I'm obviously not understanding something, but every blog I read makes it sound like this is "out of the box" functionality. I'm using Tomcat 6..should this matter?

I was able to use Pavel's example on using the WadlResource object here, but it seems I shouldn't need to do this: http://markmail.org/message/lbeaw5vyr4qergdd#query:+page:1+mid:fo4dt7tbd6rb3gvi+state:results

thanks.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
ChrisO
  • 424
  • 1
  • 5
  • 12
  • did you find any solution to this? i have the same problem with the note that it works just fine when deployed to jetty but it does not in tomcat. – Cristian Vrabie Jun 06 '11 at 13:52
  • 1
    I think I forgot to add the web application's name in the URL. For example, if the web context name (name of your project directory in $TOMCAT_HOME/webapps) is "foo", then I had to use http://localhost:8080/foo/servletMappingPattern – ChrisO Jun 08 '11 at 20:09

4 Answers4

4

I think that ChrisO most likely has the answer in that your wadl would be available at http://localhost:{port}/{warname}/application.wadl

Ben Mathews
  • 2,939
  • 2
  • 19
  • 25
3

I had the same problem, and found out that default application.wadl was only working when configured at the root of the app

My conf included several url patterns like the following

  <filter-mapping>
    <filter-name>jersey-spring</filter-name>
    <url-pattern>/admin/rest/*</url-pattern>
  </filter-mapping>

And I had to add this to make it work :

  <filter-mapping>
       <filter-name>jersey-spring</filter-name>
       <url-pattern>/application.wadl</url-pattern>
  </filter-mapping>

Hope it helps

Samuel EUSTACHI
  • 3,116
  • 19
  • 24
2

If you are using Jersey, the WADL will be given automatically when you suffix the application.wadl to your url.

Here all the /rest/ is the <url-pattern> for the <servlet-mapping>

http: // yourmacine:8080 / RESTfulExample/rest/application.wadl
Anver Sadhat
  • 3,074
  • 1
  • 25
  • 26
0

You need to specify the display-name and url-pattern of the sevlet mapping(if any) before application.wadl

Hector Barbossa
  • 5,506
  • 13
  • 48
  • 70