关于#java#的问题:HTTP Status 500 - Request processing failed

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
运行后一直加载然后出现这种情况,什么原因呢? tomcat7.0 mysql5.5

是不是配置的映射路径有问题?

PersistenceException问题是最常见的问题,就是找不到你的资源文件,解决方案有以下五种:
1、首先检查pom.xml文件,查看是否有:

 <build>
<resources>
  <resource>
    <directory>src/main/java</directory><!--所在目录-->
    <includes><!--包括目录下面的.properties,.xml文件都会扫描到-->
      <include>**/*.properties</include>
      <include>**/*.xml</include>
    </includes>
    <filtering>false</filtering>
  </resource>
</resources>
  </build>

2、确保文件夹是:resources/路径下 ,yyyy.xml格式的

3、使用maven clean 清理一下之前的字节码文件,若没有删除target,可手动删除,然后再重新编译;

4、点击Idea面板--Build--Build Poject重新构建一下项目

5、看一下是否是mapper的namespace的路径是否加载有错误;

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
报错含义:
HTTP状态500-请求处理失败;嵌套异常为org.mybatis.spring。MyBatisSystemException:嵌套异常为org.apache.ibatis.exeptions.PersistenceException:

主要方向:看下mysql服务,其次检查sql语句
具体步骤如下:
重启mysql服务:
1、使用 service 启动:service mysqld restart
2、使用 mysqld 脚本启动:/etc/inint.d/mysqld restart
查看mysql是否启动命令
ps -aux | grep mysqld

查看mysql是否在监 听端口命令
netstat -tl | grep mysql
sql语句主要检查:mapper.xml 配置文件的返回值的类型resultType和参数类型paramterType
  • 关于该问题,我找了一篇非常好的博客,你可以看看是否有帮助,链接:HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException
  • 除此之外, 这篇博客: HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemExc中的 Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Error preloading the connection pool 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:943)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
    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:108)
    

    root cause

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

应该是的xml文件和mapper 映射文件没有对应上,可以参考之前的文件,仔细检查是否有写错

冒号后面应该还有更细的报错吧, 完整报错发下