From: Systema S. <fal...@gm...> - 2016-06-03 03:01:47
|
I've been trying for a few days now to obtain a response with RESTeasy, only with very little success--I was able to receive a request on my Resource class when explicitly adding said resource class as a singleton in my Application-extending class, but I've had no luck in trying to make RESTeasy scan for these classes automatically, even with resteasy.scan set to true in web.xml My web.xml file is empty except for a resteasy.logger.type context-param specifying LOG4J. Here's a basic application class (apologies for lack of formatting, seems like any font change leads to my email getting bounced): import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath("/rest") public class RootApplication extends Application { } And here's a basic resource class: import java.util.Date; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @Path("/hello") public class HelloWorld { @GET @Produces("text/plain") public String helloResource() { return "Hello! It's "+new Date(); } } I don't use Maven, so I have no pom.xml, though to my knowledge this isn't relevant if I just grab the needed jars myself. These are the jars I've added: httpclient-4.3.jar annotations.jar jars-api-3.0.9.Final.jar resteasy-jaxrs-3.0.17.Final.jar I feel as though this would be easier to diagnose if restEASY logged anything, however it's not doing so despite having this property in my log4j.properties: log4j.logger.org.jboss.resteasy=INFO Visiting http://localhost/rest/hello after all this just returns a basic Tomcat 404 page, "The requested resource is not available". I really have no idea what's going on under the hood with logging not working. My tomcat is functioning otherwise, also. Any help would be greatly appreciated. |