Spring 프레임 웍 오류 질문입니다.
너만을
URL에 http://localhost:8080/DxPress/json.dmi 입력했을때의 오류 입니다.
오류내용입니다.
컨트롤러 입니다.
web.xml 입니다.
?xml version=1.0 encoding=UTF-8?
web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
display-nameDxPress/display-name
!-- Spring Context definition --
context-param
param-namecontextConfigLocation/param-name
param-valueclasspath:/config/spring/context/*.xml/param-value
/context-param
!-- encoding filter --
filter
filter-nameencodingFilter/filter-name
filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueUTF-8/param-value
/init-param
/filter
filter-mapping
filter-nameencodingFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping
!-- Spring Context listener --
listener
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener
!-- servlet
servlet-namecontext/servlet-name
servlet-classorg.springframework.web.context.ContextLoaderServlet/servlet-class
load-on-startup1/load-on-startup
/servlet --
!-- Handles all requests into the application --
servlet
servlet-namespring/servlet-name
servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class
init-param
param-namecontextConfigLocation/param-name
param-valueclasspath:/config/spring/common/*.xml/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
!-- Log4j Context definition --
context-param
param-namelog4jConfigLocation/param-name
param-valueclasspath:/config/log4j/log4j.xml/param-value
/context-param
!-- Log4j Context listener --
listener
listener-classorg.springframework.web.util.Log4jConfigListener/listener-class
/listener
servlet-mapping
servlet-namespring/servlet-name
url-pattern*.dmi/url-pattern
/servlet-mapping
servlet-mapping
servlet-namespring/servlet-name
url-pattern/DxPress/*/url-pattern
/servlet-mapping
!-- Maps all requests to the DispatcherServlet for handling --
servlet-mapping
servlet-namespring/servlet-name
url-pattern//url-pattern
/servlet-mapping
welcome-file-list
welcome-file/index.html/welcome-file
/welcome-file-list
/web-app
마지막으로 디스펫처서블릿에 파람으로 주입되는 설정 파일입니다.
파일명 :/config/spring/common/common-servlet.xml
?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans
xmlns:p=http://www.springframework.org/schema/p
xmlns:context=http://www.springframework.org/schema/context
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:mvc=http://www.springframework.org/schema/mvc
xmlns:tx=http://www.springframework.org/schema/tx
xmlns:jdbc=http://www.springframework.org/schema/jdbc
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/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
!-- controller init bind --
bean id=conversionService class=org.springframework.format.support.FormattingConversionServiceFactoryBean/
!-- mapping url & view --
bean it;bean id=viewNameTranslator class=org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator /
!-- @MVC & binding convert --
mvc:annotation-driven conversion-service=conversionService /
!-- component scan (Controller) --
context:component-scan base-package=com.onnet21.dmi.test.controller
context:include-filter type=annotation expression=org.springframework.stereotype.Controller /
/context:component-scan
!-- component scan (Service) --
context:component-scan base-package=com.onnet21.dmi.test.service
context:include-filter type=annotation expression=org.springframework.stereotype.Service /
/context:component-scan
!-- component scan (Dao) --
context:component-scan base-package=com.onnet21.dmi.test.dao
context:include-filter type=annotation expression=org.springframework.stereotype.Repository /
/context:component-scan
bean class=org.springframework.web.servlet.view.ContentNegotiatingViewResolver
property name=viewResolvers
list
bean class=org.springframework.web.servlet.view.BeanNameViewResolver /
bean class=org.springframework.web.servlet.view.InternalResourceViewResolver
property name=prefix value=/WEB-INF/test/ /
property name=suffix value=.jsp /
/bean
/list
/property
/bean
/beans
일단 URL 을 치고 들어갔을 때 이크립스 콘솔에서 get이 뜨는걸로 봐서는 접근은 되는데 그 다음에 모델엔 뷰로 리턴하면서 오류가 나는거 같습니다.
모델엔 뷰에 json 이라는 이름을 줬고, WEB-INF/test/json.jsp 파일이 존재 합니다.
어디가 문제인지 도통 모르겠습니다.
주의!!! : 일단 저 프로젝트는 다른피씨에서 동작되던 것인데 제가 제 이클립스에 임폴트 하고 난뒤에 발생한 문제입니다. 저 프로젝트는 jdk1.5, tomcat5 바탕으로 개발된 것입니다.
저는 jdk1.6과 톰캣6를 쓰고 있었지만, 추가로 jdk1.5를 설치해서 이클립스에 기본 컴파일러로 설정하고 톰캣5도 설치했습니다. 그 결과 프로젝트 상에 오류는 다 사라졌습니다.
하지만 서블릿 스펙에서 뭐가 문제가 발생하는지
listener
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener
이녀석이 됬다가 안됬다가 하는 듯 합니다.
-
푸른들
서블릿 맵핑 설정을 다했고 저 프로젝트가 전 피씨에선 돌아가던건데 제 노트북에 import 하니깐 저런 문제가 발생하네요 이유를 몰라 아주 환장 하겠습니다 ㅠㅠ
-
SchokoHolic
spring을 잘 모릅니다만 에러 로그만 봐서는 서블릿 이름이 문제가 있다고 보여집니다. -ㅁ-;