标签:Sm Ems lv apache Ms 整理 com name
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
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。