Ascend2015 2017-04-09 07:17 采纳率: 33.3%
浏览 2402

mybatis mapper配置路径相关



    以上是路径配置
    抛出异常如下
    org.apache.ibatis.exceptions.PersistenceException: 

Error querying database. Cause: java.sql.SQLNonTransientConnectionException: Could not create connection to database server.

The error may exist in /mapper/Message.xml

The error may involve com.imooc.dao.Message.query

The error occurred while executing a query

Cause: java.sql.SQLNonTransientConnectionException: Could not create connection to database server.

org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:136)
com.imooc.dao.daoImpl.MessageDaoImpl.query(MessageDaoImpl.java:29)
com.imooc.service.ListService.messageQuery(ListService.java:18)
com.imooc.servlet.ListServlet.doPost(ListServlet.java:39)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:26)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
com.imooc.servlet.ListServlet.service(ListServlet.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  • 写回答

1条回答 默认 最新

  • 蘑菇小包子 2017-04-09 09:26
    关注

    Message.xml,定位xml文件

    MessageDaoImpl.java:29,找到上诉对应xml文件中的sql语句组,再进一步找错

    评论

报告相同问题?