為什么sqlSession的值總是為空?
運(yùn)行的時(shí)候拋出異常:
嚴(yán)重:?Servlet.service()?for?servlet?[ListServlet]?in?context?with?path?[/MicroMessage]?threw?exception?[Servlet?execution?threw?an?exception]?with?root?cause java.lang.ClassNotFoundException:?org.apache.ibatis.io.Resources
調(diào)試的時(shí)候發(fā)現(xiàn),執(zhí)行以下代碼時(shí)直接跳過(guò)第二句,導(dǎo)致sqlSession為null,到底哪里出了問(wèn)題?
sqlSession?=?dbAccess.getSqlSession(); messageList?=?sqlSession.selectList("Message.queryMessageList");//這一段沒(méi)有執(zhí)行
接著提示:
Source?not?found?for?ApplicationFilterChain.internalDoFilter(ServletRequest,?ServletResponse)?line:?310
該怎么解決T_T
2018-02-26
java.lang.NullPointerException
com.imooc.dao.MessageDao.queryMessageList(MessageDao.java:25)
com.imooc.service.ListService.queryMessageList(ListService.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
emmm也是報(bào)了這個(gè)?debug發(fā)現(xiàn)sqlSession的值為空?
可是我的代碼沒(méi)問(wèn)題呀?剛開始以為是jar包?加進(jìn)去了還是一樣
2016-02-09
這個(gè)問(wèn)題怎么解決???
2016-01-03
解決了 ?哎 ?
2015-12-25
直接拷貝進(jìn)去進(jìn)行了嗎??我的還是不行啊~
2015-09-03
知道問(wèn)題出在哪兒了,無(wú)法讀取配置文件。mybatis的jar包不僅要導(dǎo)入到工程中,還需要拷貝一份放在tomcat的lib文件夾下,(:3[____]