오류내용
HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException
type Exception report
message Request processing failed; nested exception is java.lang.NullPointerException
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
java.lang.NullPointerException com.dt.dao.MemberDao.list(MemberDao.java:36) com.dt.controller.MemberController.list(MemberController.java:25) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
콘솔내용
MemberDao Error : org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/dt/data/MapperMember.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'memberVo'. Cause: java.lang.ClassNotFoundException: Cannot find class: memberVo
RestaurantDao Error : org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/dt/data/MapperMember.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'memberVo'. Cause: java.lang.ClassNotFoundException: Cannot find class: memberVo
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization completed in 2152 ms
---------------------------------------------------------------------------------------------------------------------------------------------------------
해결방법
dbConfig.xml 부분에서 typeAliases 부분을 설정하지 않아서 생긴 오류
--------------------------------------------------------------------
<typeAliases>
<typeAlias type="com.dt.vo.MemberVo" alias="memberVo"/>
<typeAlias type="com.dt.vo.RestaurantVo" alias="restaurantVo"/>
</typeAliases>
--------------------------------------------------------------------
이처럼 추가해 주면 된다.
밑에 스크린샷은 순서대로 구성되어있다.
1,2 번은 오류내용, 콘솔내용이며
3,4 번은 해결 전 - 후 로 보면된다.
'JAVA > 오류' 카테고리의 다른 글
오류 - JDBC 프로그래밍 연결 안된 오류 (3) | 2016.08.26 |
---|---|
git clone 관련 오류 - 해결못함 (0) | 2016.08.11 |
오류 - HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException (0) | 2016.07.27 |
Eclipse or sts 줄복사(한줄복사) 안될 때 (2) | 2016.07.27 |
오류 - the specified jre installation does not exist (0) | 2016.07.27 |