---
title: "sun.io.MalformedInputException"
author: "imshare"
date: "2011-05-25T14:37:34Z"
tags: []
categories: ["编程语言"]
slug: "sun-io-malformedinputexception"
draft: false
lastmod: "2011-05-25T14:37:34Z"
id: 1058196
url: "https://imshare.iteye.com/blog/1058196"
---

**问题描述:**
   (ups.system.banktx.server.BankPreInitialization.contextInitialized(BankPreInitialization.java)) - 银行前置系统初始化异常
org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for ]: 

an error occurred whilst reading from the InputStream.; nested exception is sun.io.MalformedInputException
<span style="color:red">Caused by: sun.io.MalformedInputException
	at sun.io.ByteToCharGB18030.convert(ByteToCharGB18030.java:171)</span>

注意：ByteToCharEUC这部分可能会由于所选定的字符集的不同而不同,比如ByteToCharGB18030。

解答：
这个问题产生的原因是IBM在JDK 1.4版本中为了追求对io通道的高效率改变了JDK 1.3中对io通道中异常处理的策略。IBM JDK 1.4中对于io通道的异常处理更加严格，因此系统中会报上面的错误。
解决这一问题的办法是不使用IBM JDK 1.4中默认的io通道，而使用nio通道。具体的做法如下：
1.打开管理控制台,找到并选择运行这个JSP的应用服务器
2.依次选择进程定义，java虚拟机，一般JVM自变量
3.添加-Dibm.stream.nio=true
4.确定，保存
5.重新启动该服务器

我是在Main方法中运行报错，则解决办法应该为
1.选择Run --> Open Run Dialog
2.Argument中的 VM argument中加入<span style="color:red">-Dibm.stream.nio=true</span>
3.Apply
4.重新运行即可