我试图将 atmosphere websockets maven 项目集成到 spring ant 项目中。但是在配置时,似乎在 bean 实例化中引发了一些冲突。
这是我的调度程序 servlet
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>
</list>
</property>
</bean>
<mvc:annotation-driven>
<mvc:argument-resolvers>
<beans:bean class="com.project.AtmosphereArgumentResolver" />
</mvc:argument-resolvers>
</mvc:annotation-driven>
这是显示的错误:
Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.atmosphere.cpr.AtmosphereResource]: Specified class is an interface
最佳答案
没错! org.atmosphere.cpr.AtmosphereResource
是一个接口(interface)所以异常(exception)。 Spring 正在尝试实例化 bean org.atmosphere.cpr.AtmosphereResource
,它应该是一个类,但它是一个接口(interface)。您不能实例化接口(interface)。您需要提供org.atmosphere.cpr.AtmosphereResource
的实现类。
关于java - mvc :annotation-driven in dispatcher servlet configuration 内的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12507854/