Sun.io.malformedinput exception IBM WebSphere middleware exception

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)

This problem is the XML configuration file coding problem, which usually occurs in the middleware such as WebSphere and Weblogic.

1. The solution is to change the encoding format of the XML file, especially the file, to GB18030. In addition, the internal coding format should be encoded as “GB18030”.

Here is the modification method:

1) create an XML file and change the file format to GB18030

2) copy all the contents of the original coding format file into Notepad, and note that Notepad is not other editors.

3) change the encoding format of XML to encoding = “GB18030”

2. If the first method above can’t solve the problem, we can delete all the Chinese characters in the XML configuration file and try again.

3. Some people think it’s the problem of IBM io. This is how they solve the problem.

The reason for this problem is that in JDK 1.4, IBM changed the strategy of exception handling in io channel in JDK 1.3 in order to achieve high efficiency in io channel.

The exception handling of IO channel in IBM JDK 1.4 is more strict, so the system will report the above error.

The solution to this problem is not to use the default IO channel in IBM JDK 1.4, but to use the NiO channel. The specific methods are as follows:

1) open the management console, find and select the application server running the JSP

2) select process definition, Java virtual machine and general JVM arguments in turn

3) add – DIBM. Stream. NiO = true

4) confirm and save

5) restart the server

Reference documents

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

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

Similar Posts: