gogomi
495
2019-04-17 21:57:01 작성 2019-04-17 22:30:14 수정됨
0
159

스프링에서 RequestMappingHandlerAdapter 사용 시 에러입니다..


스프링 버전은 4.3이고


에러: Servlet [dispatcher] in web application [/mvcexam3] threw load() exception

java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.RequestMappingHandlerAdapter

입니다.


annotation-driven이나 component-scan을 사용하면 HandlerAdapter를 읽어온다고 들었는데

왜 안될까요?





그리고 MessageConverter 등록 시 꼭 RequestMappingHandlerAdapter을 사용해야 하나요??



dispatcher-servlet.xml 은 다음과 같습니다. 



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

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context" 
	xmlns:mvc="http://www.springframework.org/schema/mvc" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans     
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/mvc
       http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
   
	<context:component-scan
		base-package="kr.or.connect.mvcexam" />
	

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

	<bean class="org.springframework.web.servlet.mvc.annotation.RequestMappingHandlerAdapter">	
		<property name="messageConverters">
			<list>
				<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
			</list>	 
		</property>
	</bean>
	<!-- 파일을 업로드 할 때 그 파일이 저장될 실제 위치. -->

	
   <!--  applicationContext와 동일한경로에 있는 mvc dispatcher를 검색해 옴. -->
</beans>



0
0
  • 답변 0

  • 로그인을 하시면 답변을 등록할 수 있습니다.