java异常总结
王知否
to be better
展开
-
解决eclipse在SSM框架中mapper.xml配置文件没有自动提示问题
在maven项目中整合SSM的时候,发现写mapper.xml文件的时候没有自动提示,没自动提示心里很虚啊,生怕哪个标签和属性写得不对,在此分享下怎么手动设置自动提示。 1、没有自动提示是因为没有dtd文件,咱们先找到mybatis jar包的dtd文件找到,在maven的jar包里找到mybatis.jar,然后找到mybatis.jar在电脑上的路径 2、把mybatis.jar复制到一个合...原创 2019-11-06 11:01:33 · 1596 阅读 · 1 评论 -
后台向数据库插入中文的乱码问题
今天在向数据库插入“姓名”中文字段的时候,在数据库里显示的是乱码,我做了以下几点检查: 1、数据库的编码,这个没问题 2、设置jdbc配置文件的编码位utf-8,没有解决问题 3、检查tomcat-server.xml的编码配置,这个以前就设置好了,也不是这个问题 4、最后通过配置mysql里的my.ini文件才解决问题 打开mysql的安装目录,找到my.ini文件 这个文件是不能直接修...原创 2019-11-05 22:52:37 · 1035 阅读 · 2 评论 -
Uncaught Error: Bootstrap's JavaScript requires jQuery
今天用bootstrap的时候,报错如下:Uncaught Error: Bootstrap’s JavaScript requires jQuery 我检查来检查去好像没什么问题,后来发现原来问题出在bootstrap加载的顺序上。 我们要先引用jquery.min.js文件,然后再引用botstrap的js,我把两者搞反了 正确的顺序应该是: ...原创 2019-11-05 15:55:21 · 1517 阅读 · 0 评论 -
pagehelper不分页,把所有的数据都显示在了第一页
今天在用pagehelper写分页的时候,展示出来的数据没有分页效果,如下图 以下是我controller层的分页代码: @RequestMapping("/empList") public String getAllEmpWithDept(@RequestParam(value="pageNum",defaultValue="1")Integer pageNum,Model model){ ...原创 2019-11-03 22:33:59 · 4923 阅读 · 2 评论 -
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
今天用eclipse在maven项目里测试jsp页面时报了如下错误: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application 我测试了一下,不加<c:forEach>标...原创 2019-11-03 19:12:07 · 754 阅读 · 0 评论 -
javax.servlet.jsp.JspException cannot be resolved to a type
今天在写jsp页面的时候,明明没什么问题,但是页面报错javax.servlet.jsp.JspException cannot be resolved to a type 原因缺少jsp-api.jar和servlet-api.jar两个jar包 我们可以有2个方法解决: 第一是在maven的pom.xml里配置这两个jar包的坐标 <dependency> <gro...原创 2019-11-03 17:13:34 · 455 阅读 · 0 评论 -
the user operation is waiting for "buiding workspace" to complete问题
在逆向工程时候遇到the user operation is waiting for “buiding workspace” to complete问题,并且页面一直不停加载但就是加载不动,出现假死现象。这是因为Eclipse要完成的工作太多了,导致软件假死了。 解决问题步骤: 1、点击上方 Project–去掉BuildAutomatically的对勾 2、关闭eclipse,重启eclipse...原创 2019-10-29 21:46:20 · 306 阅读 · 0 评论 -
You have an error in your SQL syntax
org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual th...原创 2019-10-25 22:19:55 · 417 阅读 · 0 评论 -
java.lang.Exception: No tests found matching
今天JUnit测试的时候报错如下 java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testGetAllOrder], {ExactMatcher:fDisplayName=testGetAllOrder(com.leo.test.OrderMapperTest)], {LeadingIdentifie...原创 2019-10-25 22:14:51 · 431 阅读 · 0 评论 -
Setting autocommit to false on JDBC Connection 自动提交失败
今天在执行mybstis的测试时,明明已经写好了插入语句但是数据库没有插入数据成功 这段报错的意思是“自动提交失败”,原因是我没有提交事务,后面加上一句 sqlSession.commit()就可以了 也可以在 SqlSession session = MybatisUtil.getSqlSessionFactory().openSession(); 的openSession()方法里加上一个 ...原创 2019-10-25 14:16:58 · 4997 阅读 · 1 评论 -
Error parsing SQL Mapper Configuration:Could not find resource
练习Mybatis根据id查询一个user信息,运行Run as JUnit Test的时候报错org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. The error may exist in /MybatisTest/src/com/leo/mapper/studentMapper.xml C...原创 2019-10-25 00:06:24 · 673 阅读 · 0 评论