ibatis 调用存储过程部署到linux服务器启动报错,在本地window环境下是可以正常运行的,报错信息如下:
org.xml.sax.SAXParseException: Attribute "resultMap" must be declared for element type "parameter".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:785)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
【ibatis 调用存储过程启动报错】at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:163)
at com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:45)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:347)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:112)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:75)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:93)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:63)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:78)
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:62)
at com.paic.pafa.app.lwc.service.persistence.dao.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:181)
at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:718)
at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:213)
at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
at com.paic.pafa.app.lwc.core.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:172)
at com.paic.pafa.app.lwc.core.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:273)
at com.paic.pafa.app.lwc.core.context.support.ClassPathXmlApplicationContext.
at com.paic.pafa.app.lwc.core.context.support.PafaApplicationContext.
at com.paic.pafa.app.lwc.core.context.support.PafaAppContexton.getInstance(PafaAppContexton.java:58)
at com.paic.pafa.app.biz.PafaSlsSessionBean.onEjbCreate(PafaSlsSessionBean.java:55)
at com.paic.pafa.app.biz.ac.impl.ApplicationControllerBean.onEjbCreate(ApplicationControllerBean.java:46)
at com.paic.pafa.app.biz.PafaSlsSessionBean.ejbCreate(PafaSlsSessionBean.java:42)
at com.paic.pafa.app.biz.ac.impl.pafaAC_q25x5e_Impl.ejbCreate(pafaAC_q25x5e_Impl.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
排查原因,原来是ibatis包版本的问题,之前使用的是ibatis-common-2.jar、ibatis-dao-2.jar、ibatis-sqlmap-2.jar,直接更换成ibatis-2.3.0.677.jar即可