org.apache.catalina.core.StandardContext loadOnStartup SEVERE:Servlet / github抛出load()异常

时间:2016-04-07 18:53:17

标签: java spring tomcat servlets

我正在尝试在Tomcat 7服务器上使用STS创建一个Spring MVC应用程序。我在服务器启动时遇到以下错误:

Apr 07, 2016 11:29:28 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getDeclaredConstructors(Unknown Source)
    .
.
.
.
.

Apr 07, 2016 11:29:28 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /github threw load() exception
java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
.
.
.

INFO: Server startup in 3495 ms

servlet的context.xml中

    <?xml version="1.0" encoding="UTF-8"?>

<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->

    <!-- Enables the Spring MVC @Controller programming model -->
    <context:annotation-config />



    <beans:bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>


    <context:component-scan base-package="com.assignment.github" />
        <beans:bean id="jacksonObjectMapper" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>

    <beans:bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
        <beans:constructor-arg>
            <beans:bean class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory">
                <beans:property name="readTimeout" value="600000" />
                <beans:property name="connectTimeout" value="600000" />
            </beans:bean>
        </beans:constructor-arg>
        <beans:property name="messageConverters">
            <beans:list>
                <beans:bean id="byteArrayMessageConverter" class="org.springframework.http.converter.ByteArrayHttpMessageConverter">
                </beans:bean>
                <beans:bean id="jacksonObject" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
                    <beans:property name="objectMapper">
                        <beans:ref bean="jacksonObjectMapper" />
                    </beans:property>
                    <beans:property name="supportedMediaTypes">
                        <beans:list>
                            <beans:value>text/plain</beans:value>
                            <beans:value>application/json</beans:value>
                        </beans:list>
                    </beans:property>
                </beans:bean>


            </beans:list>
        </beans:property>
    </beans:bean>


</beans:beans>

Httpurirequest类是httpclient.jar的一部分,它不在我项目的库中。任何帮助是什么原因导致这个问题以及如何通过。对不起,发帖很长。

0 个答案:

没有答案