sun.io.MalformedInputException与webshpere6.1.0.21与spring

1、问题描述

在webshpere6.1.0.21部署war包,启动报错sun.io.MalformedInputException。

出现的位置是解析spring配置文件的时候。

{

[12-10-31 19:01:24:642 CST] 00000026 SystemErr     R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

[12-10-31 19:17:49:892 CST] 00000027 SystemErr     R org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for [ServletContext resource [/WEB-INF/db/db_hibernate_ctl.xml]]: an error occurred whilst reading from the InputStream.; nested exception is sun.io.MalformedInputException

Caused by: sun.io.MalformedInputException

at sun.io.ByteToCharGB18030.convert(ByteToCharGB18030.java:171)

at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:314)

at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:364)

}

2、网上有人说

需要升级到6.1.0.43,在通过控制台配置jvm

1.打开管理控制台,找到并选择运行这个JSP的应用服务器
2.依次选择进程定义,java虚拟机,一般JVM自变量
3.添加-Dibm.stream.nio=true
4.确定,保存
5.重新启动该服务器

 3、最好的解决方案是"把spring配置文件中的注释中的中文去掉"(已测试)

{

不论Spring或Hibernate再或者是iBatis等等的xml等配置文件如果是以<?xml version="1.0" encoding="UTF-8"?>作为开头,最好都不要加入中文。websphere的jdk和标准的jdk在实现上还是存在着不一样的地方,websphere的jdk对xml的校验非常严格,如果存在中文,到websphere上解析会出现问题。properties文件也一样不能出现中文,,不然会报着错误

}参考(http://gymayong.blog.163.com/blog/static/39794282012176026483/)

4、在webshpere8.5试用版上不存在该问题

猜你喜欢

转载自zoutuo1986.iteye.com/blog/1709759