從How do I inject a Spring bean into Apache Wink?豆未註冊
繼現在,我使用眨眼彈簧支持,我想我已經建立了正確的事情。
web.xml文件包括:
<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>
META-INF /眨眼/眨眼核心的context.xml包含:
<bean class="org.apache.wink.spring.Registrar">
<property name="instances">
<set>
<ref bean="myservice" />
</set>
</property>
</bean>
<bean id="myservice" class="mystuff.ServiceImpl"/>
有一個@Autowired
註釋中mystuff.ServiceImpl
是注入其他Spring的東西,而mystuff.ServiceImpl
實現了JAX-RS註釋接口,並且其本身包含JAX-RS @Path("/services")
註釋。
我可以看到Spring加載這個東西就好了,包括myservice
bean。但是,當我請求我的資源時,我找不到404。由於眨眼開始,我看到一對夫婦的日誌條目可能表明問題:
applicationConfigLocation property was not defined
Using application classes null named in init-param applicationConfigLocation
有我錯過了什麼地方?有什麼建議?