其他分享
首页 > 其他分享> > Ms_Ems异常整理

Ms_Ems异常整理

作者:互联网

Ms_Ems异常整理

问题描述
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.lv.dao.UserDAO.quaryUser
	at com.lv.test.TestUserDAO.testquaryUser(TestUserDAO.java:20)

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.lv.dao.UserDAO.quaryUser

问题分析
UserDAO中是quaryUser方法
UserDAOMapper的ID是UserDAO中是queryUser方法
问题描述
Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.lv.dao.UserDAO.rmUser


问题分析
根本就没有配Parameter Maps 
还写parameterMap
问题描述
org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'name' in 'class com.lv.entity.User'
### The error may exist in com/lv/mapper/UserDAOMapper.xml
### The error may involve com.lv.dao.UserDAO.queryUser-Inline
### The error occurred while setting parameters
### SQL: select u.u_id,u.u_password,u.u_name,u.u_birthday,u.u_img,u.r_id from ems_User u   where u_name=? and u_password=?
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'name' in 'class com.lv.entity.User'

Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'name' in 'class com.lv.entity.User'
问题分析
<select id="queryUser" parameterType="User" resultMap="rmUser">
select u.u_id,u.u_password,u.u_name,u.u_birthday,u.u_img,u.r_id from ems_User u
where u_name=#{u_name} and u_password=#{u_password}
</select>

老师上课说#{}中不要有 _  可能会报错
我为了避免这个错 写成name 根本不行 
反而带 _ 的可以
问题描述
org.apache.ibatis.binding.BindingException: Type interface com.lv.dao.RoleDAO is not known to the MapperRegistry.
问题分析
RoleDAOMapper.xml中的mapper的namespace忘改了
<mapper namespace="com.lv.dao.RoleDAO">
问题描述
前台上传的数据------u_id=120, u_password=null, u_name=天天, u_birthday=Sun Feb 01 00:00:00 CST 1998, u_img=null, r_id=2, role=null
问题分析
password 没有 
隐藏起来传个参数就好了
问题描述
文件下载--------------------
ERROR [http-apr-8989-exec-1] - Exception occurred during processing request: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\directory (系统找不到指定的文件。)
java.io.FileNotFoundException: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\directory (系统找不到指定的文件。)
问题分析
name没有获取到
问题描述
ERROR [http-apr-8989-exec-1] - Exception occurred during processing request: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\directory\daihu.jsp (系统找不到指定的路径。)
java.io.FileNotFoundException: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\directory\daihu.jsp (系统找不到指定的路径。)
问题分析
<!-- 下载文件的配置 -->
<param name="directory">/upload</param>
  <result type="stream">
	<param name="contentType">image/png</param>
	 <!-- 缓冲大小 -->
	<param name="bufferSize">2048</param>
 <!-- 将文件以附件的形式下载 -->   <!-- 文件名使用成员变量动态获取 -->
	<param name="contentDisposition">attachment;filename=${name}     </param>
 </result>

(1);写成:
(2)String realPath = context.getRealPath("directory");//文件夹
不要引号亲爱的~~~~~~~
问题描述
ERROR [http-apr-8989-exec-7] - Exception occurred during processing request: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\upload (拒绝访问。)
java.io.FileNotFoundException: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\upload (拒绝访问。)
问题分析

bapps\Sm_Ems\upload (拒绝访问。)
java.io.FileNotFoundException: D:\apache-tomcat-7.0.79\webapps\Sm_Ems\upload (拒绝访问。)


##### 问题分析

```html

标签:Sm,Ems,lv,apache,Ms,整理,com,name
来源: https://blog.csdn.net/LvJinYang/article/details/95400788