遇到问题 解决方法
更换jdk或者Tomcat 项目名上右击选择Properties—>Java Build Path—>Libraries—>选择自己的JRE或者Tomcat 先Remove —>Add Library选择自己的需要的添加的东西 ---->Finish
如果注解使用不了 忘记导jar
启动报错配置文件有关
1.non-transactional 【南】 applicationContext.xml没有找到事务 切点路径不对
或者spring-mvc.xml中扫描控制器路径不对
2.Could not autowire field 有关 类上没有加注解
-
No qualifying bean of type 有关
(1)No qualifying bean of type [org.springframework.orm.hibernate3.HibernateTemplate] applicationContext.xml没有HibernateTemplate模板(2)No qualifying bean of type [org.fh.jq.service.TanimalService] applicationContext.xml中扫描包路径不对
或者 web.xml中没有spring监听
4.No bean named ‘transactionManager’ is defined applicationContext.xml没有找到事务管理器
5.No bean named ‘sessionFactory’ is defined applicationContext.xml没有找到将sessionFactory的创建交由spring管理
6.No servlet class has been specified for servlet [springMVC] web.xml没有springMVC核心控制器
7.not initialized - call ‘refresh’ before multicasting web.xml没有加载spring配置文件
8.Expected MultipartHttpServletRequest: is a MultipartResolver configured? spring-mvc.xml中 没有文件解析器
9.Invalid bean name ‘txAdvice’ in bean reference for bean property ‘adviceBeanName’ applicationContext.xml没有找到事务传播特性
10.class org.fh.jq.model.Tanimal not found while looking for property: animalId hbm.xml没有找到id
11.composite-id class must implement Serializable因为在映射文件.hbm.xml中定义为联合主键使用联合主键时,bean类必须序列化,在项目中定位到com.xxx.pojo包下的类Organization,在封装类上添加代码
import java.io.Serializable 实现这个接口;
404报错有关
1.使用ajax在控制器中没有加@ResponseBody或者@RequestMapping
2.web.xml没配置核心控制器
3.控制器类上没加@Controller或者方法
4.地址栏路径
5.上传图片404时,没有文件控制器
6. spring-mvc.xml中没有视图解析器
400报错有关
1.时间 封装类中没有加时间注解
或者使用时分秒是在新增页面使用f标签去吊.0 使用<f:>
2.外键 name值中只加属性没加属性的属性id (注:这个是属性是外键所以需要对象.对象id)
3.封装类Date包导成sql了
500报错有关
1.null 1. 后台@Autowired没加
2. 后台有某个类没有写返回值
3.当网页报null,后台控制台不报时,dao类连接数据库错误
4. 批量删除null ajax中没有加traditional:true 踹得什No
5.封装类Date包导成sql了
2.在网页修改报Failed to load resource: the server responded with a status of 500 ()
类型[org.fh.jq.model.Tanimal]上找不到属性[chaid] 有一个属性或说过属性值不对或者contains写错
3.object is not an instance of declaring class 条件查询外键值没有id
4.java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject poi报错 缺少一个包xmlbeans-2.3.0.jar
后台不报错误信息有关
1.网页中下拉外键undefined dao类查询时外键Class查询成主键Class了
或者新增或查询页面 for循环中的外键name值不对
2.网页中 Uncaught TypeError: Cannot read property ‘style’ of undefined 【四代儿】 属性有错误
Uncaught TypeError: Cannot read property ‘length’ of undefined 表格内容与属性数量对不上
3.下拉框不回显 在ajax外面定义变量 var 外键属性=‘{回显名.外键属性.外键属性ID}’
在for循环中加 ‘+(外键属性==arr[i].外键属性ID?‘selected’:’’)+’
4.查询页面时间显示1605783213000 1605783213000是时间戳 封装类加@JsonFormat(pattern = “yyyy-MM-dd HH:mm:ss”,timezone = “GMT+8”)
5.网页外键显示Array[ ]数组 导封装类包倒错了
6.查询页面有时间,新增页面没有时间 在封装类时间get方法中 if(属性==null) {
return new Date();//当前时间
}
批量上上传文件报错 Cannot call sendError() after the response has been committe 死循环(用户中有附件,附件中有用户) 在User类中一对多属性上加@JsonIgnore
封装类配置集合时加上加@JsonIgnore 不然会死循环
163邮箱报错 554 MI:SPB UserReject 0,smtp3,DdGowEDJGndqX9BPJ9biDA–.206S2 1339055979 垃圾邮件 在邮箱中设置自己的白名单
级联关系删除时报错 数据库打开,右击多的衣服的表—>设计表–>外键–>删除时–>改成CASCADE—>保存