Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc 每当我添加ContentNegotingViewResolver bean时,我的所有其他jsp页面都停止工作_Spring Mvc - Fatal编程技术网

Spring mvc 每当我添加ContentNegotingViewResolver bean时,我的所有其他jsp页面都停止工作

Spring mvc 每当我添加ContentNegotingViewResolver bean时,我的所有其他jsp页面都停止工作,spring-mvc,Spring Mvc,每当我添加ContentNegotiatingViewResolver bean时,我的所有其他jsp页面都停止工作,我会得到以下错误-Servlet fitTrackerServlet抛出异常的HTTP状态500-Servlet.init() org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.web.servlet.view.ContentNegotiatingViewSolver#

每当我添加ContentNegotiatingViewResolver bean时,我的所有其他jsp页面都停止工作,我会得到以下错误-Servlet fitTrackerServlet抛出异常的HTTP状态500-Servlet.init()

org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.web.servlet.view.ContentNegotiatingViewSolver#0”的bean时出错,该名称在ServletContext资源[/web-INF/config/servlet config.xml]中定义:初始化bean失败;嵌套的异常是java.lang.NoClassDefFoundError:com/fasterxml/jackson/core/JsonGenerator

这是我的servlet-config.xml

<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="0"/>


<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="order" value="1"/>
    <property name="contentNegotiationManager">
        <bean class="org.springframework.web.accept.ContentNegotiationManager">
            <constructor-arg>
                <bean class="org.springframework.web.accept.PathExtensionContentNegotiationStrategy">
                    <constructor-arg>
                        <map>
                            <entry key="json" value="application/json"/>
                            <entry key="xml" value="application/xml"/>
                        </map>
                    </constructor-arg>
                </bean>
            </constructor-arg>
        </bean>
    </property>

    <property name="defaultViews">
        <list>
            <bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"/>
            <bean class="org.springframework.web.servlet.view.xml.MarshallingView">
                <constructor-arg>
                    <bean class="org.springframework.oxm.xstream.XStreamMarshaller">
                        <property name="autodetectAnnotations" value="true"/> 
                    </bean>
                </constructor-arg>
            </bean>         
        </list>
    </property>
</bean>