콩은

2012-02-07 3 views
0

내가 지금 윙크 스프링 지원을 사용하고 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"/> 

다른 봄 물건을 주입 mystuff.ServiceImpl@Autowired 주석이있다, mystuff.ServiceImpl은 JAX-RS 주석이 첨부 된 인터페이스를 구현하며 자체에는 JAX-RS @Path("/services") 주석이 포함됩니다.

myservice 빈을 포함하여이 내용을 잘로드하는 스프링을 볼 수 있습니다. 그러나 내 리소스를 요청하면 404 찾을 수 없습니다.

applicationConfigLocation property was not defined

Using application classes null named in init-param applicationConfigLocation

가 어디 선가 뭔가를 놓친 : 윙크 시작, 나는이 문제를 나타낼 수있는 로그 항목의 몇 가지를 볼 수 있습니까? 어떤 충고?

답변

0

문제점은 문서를 오해 한 것이 었습니다.

wink-spring-support과 함께 제공되는 META-INF/server/wink-core-context.xml 스프링 구성이 있습니다. 이것은 실제로 설정을 수행하는 BeanPostProcessors를 등록하며 contextConfigLocation에서 참조해야합니다.

제가 구성을 거기에 넣었을 때 응용 프로그램이 시작시 윙크에 등록되지 않은 이유가 설명되어 있다고 생각했습니다.