Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RESTEasy Configuring Issue  RSS feed

 
Sarvarth Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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.




 
g tsuji
Ranch Hand
Posts: 697
3
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!