Coder Social home page Coder Social logo

seckill's Introduction

实验中遇到的问题:

1、 问题:Junit4在pom.xml中已经配置完成,但用快捷键生成Test时没有找到Junit4

解决方法:手动下载

2、 问题:连接不上数据库

解决方法:1、延长连接等待时间  spring-dao.xml 中的checkoutTimeout 属性
         2、window下的username会出现异常 ,在jdbc.properties中把username 该为user即可

3、 问题:多个参数的查询方法无法执行

原因:因为Java的语法不会报错形参的记录,所以例如queryAll(int offset,int limit)的方法,会被记录成queryAll(argv0,argv1)
      所以mybatis无法通过xml中的SQL语句中的offset属性找到对应的值

解决方法:修改方法为queryAll(@Param("offset")int offset,@Param("limit")int limit)即可

4、 问题:transactionManagerBeanName这个bean无法创建,getter或setter方法异常

原因:在Google上都没有找到相同的问题,查了一下transactionManagerBeanName的源码所在的包,在pom.xml中已经正确导入了,而我在
      配置文件中又没有手动定义这个bean的装配,那么就是Spring自动装配的,那一般就不是我们代码的问题,加上Google上其他人类似
      的问题,觉得可能是jar冲突引发的问题。所以清空了maven的本地仓库,reimport,后就没有这个错误了(千万不要手痒去拓展maven
      的仓库,血的教训)
解决方法:手动删除在/m2/repository下的所有文件,project->maven->reimport

5、问题:在MySQL是上测试了存储过程之后,发现有一点小问题,在seckill.sql上修改完成,后来执行发现这个错误还是一直存在。

原因:程序后来在运行SecKill.sql中的存储过程时,本地MySQL中已经有该存储过程了,MySQL根据存储过程名来判断存储过程,
      所以后来执行的存储过程其实还是第一次执行的错误的存储过程。
解决方法:删除本地MySQL中的存储过程。  drop procedure ***;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.