I have a Maven project with the dependencies listed below:

wink.version = 1.1.3-incubation and spring.version = 3.0.5.RELEASE
Spring application context includes:
<bean class="org.apache.wink.spring.Registrar"> <property name="classes"> <set value-type="java.lang.Class"> </set> </property> <property name="instances"> <set> <ref local="restexample" /> </set> </property> </bean> <bean id="restexample" class="com.example.rest.ExampleRest"></bean>
web.xml includes:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:META-INF/wink/wink-core-context.xml classpath:applicationContext.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>restServlet</servlet-name> <servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>restServlet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping>
The rest of the Java class includes:
@Path("/ex") public class ExampleRest { @GET @Produces(MediaType.APPLICATION_JSON) public String example() throws IOException { return "{ 'id':'test' }"; } }
Looking at the logs, I see no exceptions or problems, a "restexample" bean is created, but ... I get 404 when I try to call the REST service.
I think ExampleRest is not registered with Apache Wink.
Any idea?
UPDATE 02/14 : Running into the logs, I noticed that ExampleRest is not registering Apache Wink. Perhaps the problem is declaring beans, or maybe the dependencies I'm using. I also set up another project without Spring, and it works there. I really need Spring to use its IoD for daos and services.
source share