sun.io.MalformedInputException IBM Websphere 中間件異常

sun.io.MalformedInputException  IBM Websphere 中間件異常

[13-12-2 18:09:21:923 CST] 00000015 WebApp        E   Exception caught while initializing context
org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for [file [/opt/IBM/WebSphere/AppServer/profiles/Appserver02/installedApps/Appserver02/sinoom_v1_0_0_war.ear/sinoom_v1.0.0.war/WEB-INF/classes/spring/applicationContext-quartz.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)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:250)
    at java.io.InputStreamReader.read(InputStreamReader.java:212)
    at java.io.BufferedReader.fill(BufferedReader.java:157)
    at java.io.BufferedReader.readLine(BufferedReader.java:320)
    at java.io.BufferedReader.readLine(BufferedReader.java:383)
    at org.springframework.util.xml.XmlValidationModeDetector.detectValidationMode(XmlValidationModeDetector.java:79)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.detectValidationMode(XmlBeanDefinitionReader.java:468)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.getValidationModeForResource(XmlBeanDefinitionReader.java:438)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:294)
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:641)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:298)
    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:289)
    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)
    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)
    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1301)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1138)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:817)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:950)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2120)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

此問題爲xml配置文件編碼問題,通常出現的websphere、weblogic等中間件上。
一、解決方法將xml文件的編碼格式,注意是文件,改爲GB18030。此外還要將內部編碼格式encoding="GB18030"。
這裏說明一下修改方法:
1)、建立一個xml文件,將其文件格式改成GB18030
2)、將原來出問題的編碼格式的文件全部內容copy到記事本中,注意是記事本,而不是其餘編輯器。
3)、將xml中編碼格式改成encoding="GB18030"

二、若是上邊的第一種方法解決不了,咱們能夠將xml配置文件裏的全部中文字符刪掉,再試試。

三、有的人認爲是ibm io的問題,他們是這樣解決問題的。
這個問題產生的緣由是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)、從新啓動該服務器


參考文檔

http://blog.csdn.net/xiangnideshen/article/details/7469400 html

http://www.cnblogs.com/keer/archive/2007/07/11/814225.html java

相關文章
相關標籤/搜索