• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RESTEasy Configuring Issue

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to configure RESTEasy in an existing Web Project.
where the web services class files are in package com.project.web.resource

in web.xml when i use

<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>

things work fine because the api scans the entire project for annotations

but when i use below, after commenting reseasy.scan tag

<context-param>
<param-name>resteasy.resources</param-name>
<param-value>com.project.web.resource</param-value>
</context-param>

i get a java.lang.ClassNotFoundException

The reason is that RESTEasy api looks for the package in Web-Inf/Classes folder which is the default.
Is there a way i can change the default or any other work around because my resources folder is not getting detected here.




 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what the guide says
http://docs.jboss.org/resteasy/docs/1.0.0.GA/userguide/html/Installation_Configuration.html

Option Name : resteasy.resources
Default Value : no default
Description : A comma delimited list of fully qualified JAX-RS resource class names you want to register


So the immediate comment would be

<param-value>com.project.web.resource</param-value>


being the package name only wouldn't be good enough. You should, in the least, append it with the class name and, if needed, make it a comma separated list of fully qualified (with package name) class names.
 
Sarvarth Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The name i am using is fully qualified.
Also i cannot mention comma separated 20-30 classes there.

I want to configure this package as the resource folder like i was doing earlier in case of jersey.

There is something i am missing in the configuration due to which it is not able to reach for the annotations.
It could be some xml configuration or it could be some other setting by which jersey can get all the class files from that folder.
reply
    Bookmark Topic Watch Topic
  • New Topic