今天,项目突然报“java.lang.NumberFormatException:For input string:"id"”,项目框架是spring,springmvc,hibernate,大致意思是类型转换错误,我的id是Integer类型,报错在<c:foreach>里的option里获取值得时候出问题,说明数据类型不对,就去后台dao去找,查看我的sql,一看我查的是表的部分字段,用的hibernate框架,返回的一个List<object[]>类型,我已经定义了List<指定的类型>,想让它返回指定对象类型,经过查询google,发现查询部分字段用对应类的构造函数来弄,完美解决这个异常。参考http://blog.csdn.net/yaerfeng/article/details/8514008,谢谢博主的分享。

解决java.lang.NumberFormatException: For input string: "id"的更多相关文章

  1. SpringBoot整合Swagger2案例,以及报错:java.lang.NumberFormatException: For input string: ""原因和解决办法

    原文链接:https://blog.csdn.net/weixin_43724369/article/details/89341949 SpringBoot整合Swagger2案例 先说SpringB ...

  2. 执行Hive时出现org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.lang.NumberFormatException: For input string: "1s"错误的解决办法(图文详解)

    不多说,直接上干货 问题详情 [kfk@bigdata-pro01 apache-hive--bin]$ bin/hive Logging initialized -bin/conf/hive-log ...

  3. 解决测试redis集群时报"java.lang.NumberFormatException: For input string: "7003@17003..7002@17002"等异常

    一.前言 关于redis5.0的集群模式下,通过客户端测试代码调试报"Exception in thread "main" java.lang.NumberFormatE ...

  4. mybatis 报错:Caused by: java.lang.NumberFormatException: For input string

    mybatis的if标签之前总是使用是否为空,今天要用到字符串比较的时候遇到了困难,倒腾半天,才在一个论坛上找到解决方法.笔记一下,如下: 转自:https://code.google.com/p/m ...

  5. java.lang.NumberFormatException: For input string: "${jdbc.maxActive}"

    一.问题 使用SpringMVC和MyBatis整合,将jdbc配置隔离出来的时候出现下面的错误,百度了很久没有找到解决方法,回家谷歌下,就找到解决方法了,不得不说谷歌就是强大,不废话,下面是具体的错 ...

  6. Java——java.lang.NumberFormatException: For input string: ""

    java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.f ...

  7. Swagger2异常 java.lang.NumberFormatException: For input string: ""

    问题在访问swagger首页时报错: java.lang.NumberFormatException: For input string: "" at java.lang.Numb ...

  8. java.lang.NumberFormatException: For input string: "Y"

    nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database.  ...

  9. MyBatis报错:Caused by: java.lang.NumberFormatException: For input string: "XX"

    <select id="sltTreatment" resultType="com.vitaminmd.sunny.core.bo.Treatment"& ...

随机推荐

  1. Day3-递归函数、高阶函数、匿名函数

    一.递归函数 定义:函数内部可以调用其它函数,如果调用自身,就叫递归. 递归特性: 1.必须有结束条件退出: >>> def calc(n): ... print(n) ... re ...

  2. pod install 出现 Unable to find a specification for `xxxxx` 解决方案

    pod repo update 更新一下repo,更新完成之后即可解决无法找到xxx第三方框架的问题了

  3. 第三章(附)mysql表类型MyISAM和InnoDB区别(决定了是否支持事务)

    mysql表类型MyISAM和InnoDB区别 MyISAM:这个是默认类型,它是基于传统的ISAM类型,ISAM是Indexed Sequential Access Method (有索引的顺序访问 ...

  4. 关于Laravel中的artisan命令

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica; color: #454545 } p.p2 { margin: 0.0p ...

  5. How-to go parallel in R – basics + tips(转)

    Today is a good day to start parallelizing your code. I’ve been using the parallel package since its ...

  6. TextView 实现跑马灯效果

    在String.xml中添加: <string name="txt">跑马灯效果,我跑啊跑</string>在layout/mian.xml中添加TextV ...

  7. 使用cnpm搭建私有NPM仓库 发布npm包

    关于如何使用cnpm搭建私有的npm仓库看这里→ http://blog.fens.me/nodejs-cnpm-npm/ 我本人还没有机会真正实践操作过,公司的npm仓库是我老大搭建的,我这里仅仅记 ...

  8. 如何使用kali的Searchsploit查找软件漏洞

    Searchsploit Searchsploit会通过本地的exploit-db, 查找软件漏洞信息 打开kali的命令行, 输入: searchsploit 查看系统帮助 查找mssql的漏洞 如 ...

  9. (转+原创)java的枚举类型Enum解释

    原文:http://www.cnblogs.com/mxmbk/articles/5091999.html 下文中还添加了个人的一些补充和理解. 在Java SE5之前,我们要使用枚举类型时,通常会使 ...

  10. DDD理论学习系列(6)-- 实体

    DDD理论学习系列--案例及目录 1.引言 实体对应的英语单词为Entity.提到实体,你可能立马就想到了代码中定义的实体类.在使用一些ORM框架时,比如Entity Framework,实体作为直接 ...