关于ibatis的链接数据库错误问题,求帮助啊
Exceptioninthread"main"java.lang.RuntimeException:Erroroccurred.Cause:com.ibatis.comm...
Exception in thread "main" java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:89)
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)
at com.test.QuestionDAO1.main(QuestionDAO1.java:20)
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86)
... 2 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
... 3 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:51)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:410)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
... 7 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError 展开
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)
at com.test.QuestionDAO1.main(QuestionDAO1.java:20)
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:86)
... 2 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
... 3 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: Premature end of file.
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:51)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:410)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
... 7 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError 展开
展开全部
初步看来是你的sqlmap格式解析出错了。当然你也可以将ibatis集成到spring或者使用连接池之类的。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
参考答案: 其身正,不令而行;其身不正,虽令不从。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sqlmap格式解析出错了。建议集成到spring 上
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把sqlmap文件代码贴出来。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询