1 of 1 people found this helpful
An easy way to find out what's wrong is to take a look at the request your browser sends when listAllEnabledStrategies() is invoked on the client. You can use FireBug (click on the Net tab) or in Chrome (View->Developer Tools->Network tab).
You can also try to type the URL directly in your browser and check for the response.
A mistake I can think of is not configuring the root path of your REST endpoint properly (see here for more details).
Cool, so after setting my REST endpoint this way:
the URL would be: www.myapp.com/MyJaxRsEndpointPath/myServicePath??
Should I add some additional configuration on my web.xml?
Yes. If you've started from the errai-tutorial project you will already have a configuration in there that registers all REST endpoints under /rest:
There are multiple ways to configure RestEasy depending on what server you intend to use:
Thanks! added the following to my web.xml and is working now... The only issue I'm having is that all the injected beans in my service are null. Is this because service is not being retrieved from the container? How could I solve this?
<!-- Auto scan REST service --> <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value> </context-param> <!-- this need same with resteasy servlet url-pattern --> <context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/rest</param-value> </context-param> <listener> <listener-class> org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap </listener-class> </listener> <servlet> <servlet-name>resteasy-servlet</servlet-name> <servlet-class> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher </servlet-class> </servlet> <servlet-mapping> <servlet-name>resteasy-servlet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping>
Thank you again for replying so fast! you guys rock!