项目场景:

在自己练习黑马的javaweb小案例中出现

type Exception report
message
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.ibatis.exceptions.PersistenceException:
Error updating database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘CompanyName’ in ‘class com.itheima.pojo.Brand’
The error may exist in com/itheima/mapper/BrandMapper.java (best guess)
The error may involve com.itheima.mapper.BrandMapper.add-Inline
The error occurred while setting parameters
SQL: insert into tb_brand values(null,?,?,?,?,?)
Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘CompanyName’ in ‘class com.itheima.pojo.Brand’
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
org.apache.ibatis.binding.MapperProxyPlainMethodInvoker.invoke(MapperProxy.java:152)org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)com.sun.proxy.PlainMethodInvoker.invoke(MapperProxy.java:152) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) com.sun.proxy.PlainMethodInvoker.invoke(MapperProxy.java:152)org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)com.sun.proxy.Proxy32.add(Unknown Source)
com.itheima.service.BrandService.add(BrandService.java:46)
com.itheima.web.AddServlet.doGet(AddServlet.java:38)
com.itheima.web.AddServlet.doPost(AddServlet.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


原因分析:

经仔细检查,发现在form表单中有错误。因为我采用的是JavaBean的方式传送数据,所以标签iinsert into tb_brand values(null,#{brandName},#{CompanyName},#{ordered},#{description},#{status})name=“user.userName” 中CompanyName 写错


解决方案:

将CompanyName修改为companyName,确保数据库的字段名与javabean中的属性名保持一致

解决: The server encountered an internal error that prevented it from fulfilling this request.相关推荐

  1. description The server encountered an internal error that prevented it from fulfilling this request错

    以前的项目有问题需要维护,导进去之后登陆直接报错,一番折腾之后发现是sturts2自带的 antlr-2.7.2.jar出现了jar包冲突,删除后搞定. HTTP Status 500 - type ...

  2. The server encountered an internal error that prevented it from fulfilling this request 的解决方法

    在多次实验发现这个报错,我认为作为小白,最容易报错的可能是 空指针异常(NullPointerException )

  3. Tomcat遇到500 The server encountered an internal error that prevented it from fulfilling this request

    故事背景: 我使用jdk1.8和tomcat8.0但是遇到了下边两个问题 ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210603211006342.jpg? ...

  4. The server encountered an internal error () that prevented it from fulfilling this requet异常解决

    1.数据库连接配置问题 2.抓取的姓名和密码为null 看下下面的配置是否正确

  5. 记录学习Java HttpServletRequests报错The server encountered an internal error that prevented it from fulfil

    文章目录 一.错误提示 二.解决办法 一.错误提示 通过错误信息可以看出是出现空指针异常,并且报错在registerServlet.java的第26行. 二.解决办法 通过排查发现registerSe ...

  6. jsp使用session出现The server encountered an unexpected condition that prevented it from fulfilling the r

    The server encountered an unexpected condition that prevented it from fulfilling the request 解决方法 如果 ...

  7. Internal Server Error 错误 The server encountered an internal error or misconfiguration and was una...

    在家中搭一个个人的eyoucms的测试环境,安装时,前边顺利的很,但到后边,一直报以下的这个错误,让人头疼不已. Internal Server Error The server encountere ...

  8. Remoting: Server encountered an internal error

    发生这个错误的原因是Remoting的一个配置项: <customErrors> 元素  指示此应用程序域中的服务器通道是否将经筛选的或完整的异常信息返回给本地或远程调用方. <?x ...

  9. 登陆weblogic console报错 The server encountered an unexpected condition which prevented it from

    登陆weblogic console报错 The server encountered an unexpected condition which prevented it from fulfilli ...

  10. brat报错:The server encountered a serious error, please contact the administrators at ____ and give th

    The server encountered a serious error, please contact the administrators at ____ and give the id# 记 ...

最新文章

  1. C语言单向链表的实现
  2. Python 中最强大的错误重试库
  3. 构建根文件系统启动(1)
  4. java 12-3 StringBuffer的添加和删除功能
  5. CISCO专用协议CDP
  6. Java-使用JavaMail发送一封邮件给用户邮箱功能实现
  7. 笔记本控制机器人方法
  8. java虚拟机的内存模型_JVM(Java虚拟机)内存模型(转载/整理)
  9. 【bzoj 1754】【POJ - 2389 】Bull Math (高精度运算)
  10. 量子计算机网络指数时间,科普:量子计算机是这样计算的
  11. linux shell脚本关于文件存在与否的判断
  12. oracle 提取连续数字,oracle 得到连续不重复的数字序列
  13. 12.MongoDB之固定集合(Capped Collections)
  14. sw如何缩放装配体_solidworks提高大型装配体的展示、设计效率
  15. rog主板php,华硕主板有哪些系列 华硕主板各系列区别对比
  16. R语言混合线性模型包代码演示
  17. pano2vr 笔记
  18. BZOJ4134 ljw和lzr的hack比赛
  19. 案例1:文件系统ACLs
  20. C语言 队列 的基本功能和详细代码(含详细注释)

热门文章

  1. 多平台的敏感信息监测工具-GShark
  2. Python之(scikit-learn)机器学习
  3. 上海市计算机应用基础答案,计算机应用基础10统考(附答案)
  4. NAT技术与代理服务器详解
  5. jQuery下载安装详细教程,jQuery入门必备
  6. 【flask】工厂函数和蓝本的作用
  7. Win10安装.msi文件出现问题
  8. 【大连理工大学】计算机专业选修:深度学习2020期末复习
  9. 未安装360系列应用情况下,Edge浏览器主页被360篡改,一直显示360导航
  10. Modifier在java_Java-Modifier类常用方法详解