zoukankan      html  css  js  c++  java
  • 日常开发自己遇到异常(BUG未完待续!!!)

    在面试的时候经常会被问到你在项目中遇到的bug有哪些,或者你感觉你解决什么问题让你感觉有成就感。以此类似的面试问答,楼主现在开始不断更新日常遇到的BUG汇总

      1:ConcurentModificationException异常,这个异常在当你用迭代器去add或者remove一个collection接口下的某个类时报的异常。(一般人都不知道)

      

     2:NumberFormatException异常。这个一行当数字格式化错误,如果你的参数字符串不是数字的话,经过Integer.valueOf(argument)就会抛出NumberFormatException异常。表示将字符串解析成int类型数字出现异常。

    3:StackOverflowError异常。如果一个线程在计算时所需要用到栈大小 > 配置允许最大的栈大小,那么Java虚拟机将抛出StackOverflowError(内存不足错误)

    4: invocation TargetException(反射异常) 

    5:JDBCConnectionException

    6:ArrayIndexOutOfBoundsException数组下标越界异常

    7:FileNotFoundException文件未找到异常

    8:IndexOutOfBoundsException 索引越界异常。

    9:java.lang.Throwable: STACKTRACE  堆栈跟踪异常。(忘记关数据库连接资源)

    10:java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long(连接mysql数据库是报错)原因是:jar包问题将 mysql-connector-java-5.1.24.jar 换成了        mysql-connector-java-5.1.46.jar 就解决了

     11:.NoSuchMethodException:com.rj.auction.product.action.ProductAction.recordSave()

    12:org.apache.ibatis.exceptions.PersistenceException()

     Properties→Resource中 Text file encoding修改项目编码 格式问题

    13:java.text.ParseException(处理前面传过来的日期,后台接收到后想通过SimpleDateFormat转换日期格式)

          String timeString="Thu Apr 25 00:00:00 CST 2019";
         SimpleDateFormat sfEnd = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat sfStart = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",java.util.Locale.ENGLISH);
         String format = sfEnd.format(sfStart.parse(timeString));
         System.out.println(format);

     

    1.8换成1.7后eclipse需要改的地方

    https://blog.csdn.net/miaokezhang/article/details/85609662

    14、com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.isClosed()Z

     

  • 相关阅读:
    HDU 1022 Train Problem I
    HDU 1702 ACboy needs your help again!
    HDU 1294 Rooted Trees Problem
    HDU 1027 Ignatius and the Princess II
    HDU 3398 String
    HDU 1709 The Balance
    HDU 2152 Fruit
    HDU 1398 Square Coins
    HDU 3571 N-dimensional Sphere
    HDU 2451 Simple Addition Expression
  • 原文地址:https://www.cnblogs.com/sjzxs/p/10069054.html
Copyright © 2011-2022 走看看