要在websphere上部署一个应用,websphere版本6.0
应用中用到了ibatis作为数据访问层,ibatis的xml文件中有一些中文注释,像这样的<!-- 注释 -->,两边都空有两个空格
war包在本机tomcat 5.0上部署和访问都没有错误,但是部署在websphere上就报错,错误信息如下:
[08-12-27 9:09:21:375 CST] 0000003e SystemErr R org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.abchina.csas.sch.service.impl.SchManagerServiceImpl#2409fc51' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-sch.xml]: Can't resolve reference to bean 'schManagerDAO' while setting property 'schManagerDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schManagerDAO' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-sch.xml]: Can't resolve reference to bean 'schSqlMapClient' while setting property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schSqlMapClient' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-resources.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schManagerDAO' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-sch.xml]: Can't resolve reference to bean 'schSqlMapClient' while setting property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schSqlMapClient' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-resources.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schSqlMapClient' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-resources.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: sun.io.MalformedInputException Caused by: sun.io.MalformedInputException at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:81) at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62) at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:258) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
解决办法:
MalformedInputException造成的原因就是IBM JDK重写了IO通道。原来1.4当中就有过类似的问题,原来解决方法是: 1.打开管理控制台,找到并选择运行这个JSP的应用服务器 2.依次选择进程定义,java虚拟机,一般JVM自变量 3.添加-Dibm.stream.nio=true 4.确定,保存 5.重新启动该服务器