zoukankan      html  css  js  c++  java
  • HTTP Status 500

    今天遇到一个问题,IntelliJ IDEA 开发Spring-mvc +mybits 项目,本机配置jetty没为题,但是配置tomcat8竟然错误了。

    问题如下:

    HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
    
    
    type Exception report
    
    message Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
    
    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 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
        org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause
    
    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo

    网上搜了一下,问题出在没找到Mapper XML 文件

    查看applicationcontent.xml 文件发现:

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="configLocation" value="classpath:sqlmap-config.xml"/>
       
        </bean>

    添加如下配置:

    <property name="mapperLocations" value="classpath:com/creditease/proxymanager/dao/*.xml"/>
    com/creditease/proxymanager/dao/*.xml 就是xml文件地址

    正确配置如下
      <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="configLocation" value="classpath:sqlmap-config.xml"/>
            <property name="mapperLocations" value="classpath:com/creditease/proxymanager/dao/*.xml"/>
        </bean>
    sqlmap-config.xml 配置如下,
    com.creditease.proxymanager.dao.dto 是数据库表对应的实体类路径
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE configuration
            PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
            "http://mybatis.org/dtd/mybatis-3-config.dtd">
    <configuration>
        <typeAliases>
            <package name="com.creditease.proxymanager.dao.dto"/>
          </typeAliases>
    </configuration>

    所有配置信息我就不贴了。

  • 相关阅读:
    .NET使用ICSharpCode.SharpZipLib压缩/解压文件
    在vs2005中使用AnkhSvn服务端IP改变无法连接
    repeater标签双重循环的使用
    在vs2005中使用SVN进行版本管理
    jmeter--响应断言
    jmeter--十三种断言方式介绍
    jmeter--参数化的四种方法
    jmeter--元件的作用域与执行顺序
    jmeter--使用badboy录制脚本
    jmeter--基本组件介绍
  • 原文地址:https://www.cnblogs.com/zhangzhi19861216/p/6429225.html
Copyright © 2011-2022 走看看