java.lang.NumberFormatException: For input string: "1" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang
java.lang.NumberFormatException: For input string: "1"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
在把字符串转换成整型的时候老是报错,因为数据是从excel表复制到文本文档里进行处理的。
我在控制台输出,也显示字符串就是1,看似没什么问题。
然后,我怀疑其中除了数字之外,还有其他不可见的字符,就通过StringEscapeUtils工具来把字符串连转义字符也输出,就发现了看似为1的字符串,实际为"\uFEFF1"
所以发现表面为1的字符串,还夹杂了其他字符,从而导致转换失败。


java.lang.NumberFormatException: For input string: "1" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang的更多相关文章
- java.lang.NumberFormatException: For input string: "1608020001 " 错误
错误: java.lang.NumberFormatException: For input string: "1608020001 " at java.lang.Numbe ...
- java.lang.NumberFormatException: For input string: "Y"
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. ...
- mybatis 报错:Caused by: java.lang.NumberFormatException: For input string
mybatis的if标签之前总是使用是否为空,今天要用到字符串比较的时候遇到了困难,倒腾半天,才在一个论坛上找到解决方法.笔记一下,如下: 转自:https://code.google.com/p/m ...
- java.lang.NumberFormatException: For input string:"filesId"
做项目时候,页面获取出现了这个问题.找了好久一直以为是我字段或者是数据库字段问题导致引起的. 最后才发现是 struts2中jsp我写错了一个参数,一直导致报错.后来改了就好了. 当大家遇到这个问题的 ...
- 解决java.lang.NumberFormatException: For input string: "id"
今天,项目突然报"java.lang.NumberFormatException:For input string:"id"",项目框架是spring,spri ...
- MyBatis报错:Caused by: java.lang.NumberFormatException: For input string: "XX"
<select id="sltTreatment" resultType="com.vitaminmd.sunny.core.bo.Treatment"& ...
- Caused by: java.lang.NumberFormatException: For input string: "18446744073709551615"
问题:Caused by: java.lang.NumberFormatException: For input string: "18446744073709551615" 原因 ...
- Redis集群环境使用的是redis4.0.x的版本,在用java客户端jedisCluster启动集群做数据处理时报java.lang.NumberFormatException: For input string: "7003@17003"问题解决
java.lang.NumberFormatException: For input string: "7003@17003" at java.lang.NumberFormatE ...
- hadoop ha环境下的datanode启动报错java.lang.NumberFormatException: For input string: "10m"
hadoop ha环境启动start-dfs.sh的时候datanode启动不了,并且报错. [hadoop@datanode2 ~]$ cat /home/hadoop/hadoop-2.7.3/l ...
- java.lang.NumberFormatException: For input string: "${jdbc.maxActive}"
一.问题 使用SpringMVC和MyBatis整合,将jdbc配置隔离出来的时候出现下面的错误,百度了很久没有找到解决方法,回家谷歌下,就找到解决方法了,不得不说谷歌就是强大,不废话,下面是具体的错 ...
随机推荐
- centos 安装erlang rpm包互相依赖问题
在项目中使用 centos 6.5 mini 版本(网络隔离,无法上外网),因测试需要使用到 erlang 环境. erlang rpm 包下载地址:https://www.erlang-soluti ...
- ubuntu 跑.net core 2.0
安装.net core参考地址:http://www.microsoft.com/net/core/preview#linuxubuntu 服务器版本 UBbuntu 16.04 执行命令 ...
- 如何使用jQuery + css3制作绚丽的网页经验总结
常见的网页特效有:轮播,滚动,闪烁,渐变,图标GIF效果,翻转,折叠,3D变换,主视觉等.以前没有CSS3时一些复杂的特效都要借助Flash来实现,Flash为什么会被淘汰,个人认为有以下几点: 1. ...
- python-自定义异步非阻塞爬虫框架
api import socket import select class MySock: def __init__(self, sock, data): self.sock = sock self. ...
- vim 插入时间戳的方法
这里主要说明用内置函数 strftime 来插入,而不用 :r!date 或类似方法. 用命令 "=strftime('%c')<Ret>p ,或<C-r>=strf ...
- 【Android 多媒体应用】使用MediaCodec解码使用AudioTrack播放音频数据
1.MainActivity.java import android.app.Activity; import android.os.Bundle; import android.os.Environ ...
- 一键生成ssl自签名证书脚本
#!/bin/bash -e # * 为必改项 # * 更换为你自己的域名 CN='' # 例如: demo.rancher.com # 扩展信任IP或域名 ## 一般ssl证书只信任域名的访问请求, ...
- scrapy框架基于CrawlSpider的全站数据爬取
引入 提问:如果想要通过爬虫程序去爬取”糗百“全站数据新闻数据的话,有几种实现方法? 方法一:基于Scrapy框架中的Spider的递归爬取进行实现(Request模块递归回调parse方法). 方法 ...
- [Swift实际操作]八、实用进阶-(5)通过间接代理进行对象间的消息传递
本文将为你演示,如何通过简介代理的方式,进行对象间的消息传递在左侧的项目导航区,打开自定义视图的代码文件(CustomView.swift). import UIKit class CustomVie ...
- 虚拟机CentOS防火墙设置
CentOS6关闭防火墙使用以下命令, 开启防火墙 systemctl start firewalld //临时关闭 # service iptables stop //禁止开机启动 # chkcon ...