springMVC+mybatis框架报错

这些错误很多时候都不细心引起的,如果大家也有出现些问题,希望能给大家一下提示,同时也提醒自己不要再犯相同的错误了.

使用eclipse编译项目的时候一直在报这个错误,但是项目都是可以通过编译的,到网上找的,说jdk换成1.8的,换了这后还是没有用

com/mysql/jdbc/JDBC42ResultSet : Unsupported major.minor version 52.0

----最后解决------- 我的tomcat里面有一个jdbc的驱动,比我自己项目下的jar包版本要高.把tomcat那个驱动删除即可.


下面是部分ssm框架的错误
 Caught exception while allowing TestExecutionListener
 [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@e03bd6]
 to prepare test instance [org.seckill.dao.SeckillDaoTest1@6a776719]
 java.lang.IllegalStateException: Failed to load ApplicationContext

解决
其中user写成username

Bean property 'checkoutTimeOut' is not writable or has an invalid setter method. Did you mean 'checkoutTimeout'?

解决: name写错了checkoutTimeOut … nested exception is


 java.io.FileNotFoundException: class path resource
   [classPath:mybatis-config.xml] cannot be opened because it does not
   exist	

解决: classPath 改成小写就可以了

   com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7edeaabc --
   Acquisition Attempt Failed!!! Clearing pending acquires. While trying
   to acquire a needed new resource, we failed to succeed more than the
   maximum number of allowed acquisition attempts (2). Last acquisition
   attempt exception: 	

解决: 数据库,表名不对

   runtime name="com.genuitec.runtime.generic.jee60

解决: 别人项目,打开报错,删除setting文件中runtime即可

  org.mybatis.spring.MyBatisSystemException: nested exception is
  org.apache.ibatis.exceptions.PersistenceException: 
  ### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
  get JDBC Connection; nested exception is java.sql.SQLException: An
  attempt by a client to checkout a Connection has timed out.

解决: jdbc.properties 跟.xml的连接账号没对上

 org.apache.ibatis.binding.BindingException: Invalid bound statement  (not found): org.seckill.dao.SeckillDao.queryAll

解决: 程序包org.junit.runner不存在
junit 换为4.x版本即可

maven项目运行注意 http://www.tuicool.com/articles/fm6nay
Servlet.init() for servlet seckill-dispacherServlet threw exception

原因: web.xml配置不对

   Allocate exception for servlet seckill-dispacherServlet

原因: springmvc.xml的转发路径不对

 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):  	select id 

原因: 上在是方法不对,ALl All 由于字体原因一直没看出来

元素类型 "set" 必须后跟属性规范 ">" 或 "/>"。 Nested exception: 元素类型 "set" 必须后跟属性规范 ">" 或 "/>"。 		

原因: 配置文件set位置没有加空格

A different object with the same identifier value was already associated with the session : [cn.entity.Employee#1]

原因: 主键重复

org.mybatis.spring.MyBatisSystemException: nested exception is
   org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: java.lang.UnsupportedOperationException
   ### The error may exist in file [C:\Users\Administrator.USER-20160618MA\seckill\target\classes\mapper\SeckillDao.xml]
   ### The error may involve org.seckill.dao.SeckillDao.queryAll
   ### The error occurred while handling results
   ### SQL: select seckill_id,name,number,start_time,end_time,create_time  from seckill 
   order by create_time desc  limit ?,?;

原因: dao的映射mapping.xml中,resultType类型的问题:dao接口里写的方法返回是一个List集合,这个resultType类型是直接表示返回类型的(对应着我们的model对象中的实体)

引入js文件,访问资源时还提示404

先创建resources这个文件夹,名字不对的话mvc:default-servlet-handler/
就算配置文件都对了,页面也是引不进来的

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值