-
1. Re: How to get REST service working in Wildfly with RestEasy
sfcoy Jul 11, 2014 10:14 PM (in response to davidj)Do you have one of these?
import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath("/rest") public class JaxRsActivator extends Application { }
Also, no web.xml at all is required anymore.
-
2. Re: How to get REST service working in Wildfly with RestEasy
arungupta Jul 12, 2014 2:26 PM (in response to davidj)1 of 1 people found this helpfulThere are tons of JAX-RS samples at: https://github.com/javaee-samples/javaee7-samples/tree/master/jaxrs
All of them work using RESTEasy and WildFly.
-
3. Re: How to get REST service working in Wildfly with RestEasy
davidj Jul 14, 2014 2:25 PM (in response to sfcoy)I did not have one of those. So I created one and then removed what I had in web.xml. It still doesn't work. In-fact, I'm no longer getting the "Could not find resource for full path", instead I'm getting a 404 error when attempting to call the REST service. I think I'm having interference from something else because I tried Arun Gupta's "jaxrs-endpoint" example and it worked fine. This is an older web-app we are migrating to Wildfly and it uses Spring and Struts, so I'm wondering if one of them is interfering?
But regardless, your answer was definitely what is needed to get the REST service to work (as proved by Arun Gupta's example.... nice job Arun!).
-
4. Re: How to get REST service working in Wildfly with RestEasy
davidj Jul 14, 2014 3:28 PM (in response to arungupta)Hi Arun, you're jaxrs-endpoint example worked well (I downloaded and successfully ran it), and it proved that only an Application.java file is needed (without anything in web.xml). But I'm still unable to successfully get a REST service running. As stated above, I'm wondering if other parts of the web-app are interfering. The web-app is older, but I've upgraded to Java 8 and everything else seems to work fine. I've even added some EE 7 - JMS 2 stuff to it and that works fine. It is only the REST stuff which I can't get.
-
5. Re: How to get REST service working in Wildfly with RestEasy
ayushmathur Feb 27, 2015 3:38 AM (in response to davidj)Hi David,
I'm facing the similar issue as yours wherein I have deployed a war packaged REST service in JBOSS EAP 6.1. However, I'm not able to access my service wither through browser or my rest client. Following is the error stack while running rest client:
Exception in thread "main" javax.ws.rs.NotFoundException: HTTP 404 Not Found
at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:913)
at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:822)
at org.glassfish.jersey.client.JerseyInvocation.access$600(JerseyInvocation.java:90)
at org.glassfish.jersey.client.JerseyInvocation$3.call(JerseyInvocation.java:693)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:422)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:689)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:405)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:301)
at com.psiincontrol.alarmservice.jaxrs.client.AlarmRestClient.getAlarms(AlarmRestClient.java:55)
at com.psiincontrol.alarmservice.jaxrs.client.AlarmRestClientTest.main(AlarmRestClientTest.java:28)
Any idea how this can be resolved ? The JBOSS logs doesn't show any error and deployed the service successfully.