org.apache.ibatis.exceptions.persistenceexception
时间: 2023-05-01 21:00:12 浏览: 121
"org.apache.ibatis.exceptions.PersistenceException" 是 MyBatis 框架中的一个异常类,它表示持久层操作发生了异常。这可能是由于数据库连接问题,SQL 语句错误或其他错误导致的。应该检查错误日志并尝试解决问题。
相关问题
org.apache.ibatis.exceptions.PersistenceException
org.apache.ibatis.exceptions.PersistenceException是MyBatis框架中的一个异常类。它是一个通用的持久化异常,当在执行数据库操作时发生错误时,MyBatis会抛出该异常。通常,它是由底层数据库操作引起的,比如SQL语法错误、连接问题、事务问题等。开发者可以通过捕获该异常来处理相关的持久化操作错误。
org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in SQL Mapper Configuration ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.datasource.DataSourceException: Unknown DataSource property: maxPoolPreparedStatementPerConnectionSize org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64) com.ks.Servlet.loginServlet.doGet(loginServlet.java:28) javax.servlet.http.HttpServlet.service(HttpServlet.java:655) javax.servlet.http.HttpServlet.service(HttpServlet.java:764) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 根本原因。 org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.datasource.DataSourceException: Unknown DataSource property: maxPoolPreparedStatementPerConnectionSize org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121) org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:99) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64) com.ks.Servlet.loginServlet.doGet(loginServlet.java:28) javax.servlet.http.HttpServlet.service(HttpServlet.java:655) javax.servlet.http.HttpServlet.service(HttpServlet.java:764) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 根本原因。 org.apache.ibatis.datasource.DataSourceException: Unknown DataSource property: maxPoolPreparedStatementPerConnectionSize org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory.setProperties(UnpooledDataSourceFactory.java:55) org.apache.ibatis.builder.xml.XMLConfigBuilder.dataSourceElement(XMLConfigBuilder.java:326) org.apache.ibatis.builder.xml.XMLConfigBuilder.environmentsElement(XMLConfigBuilder.java:280) org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:116) org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:99) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78) org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64) com.ks.Servlet.loginServlet.doGet(loginServlet.java:28) javax.servlet.http.HttpServlet.service(HttpServlet.java:655) javax.servlet.http.HttpServlet.service(HttpServlet.java:764) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
这个错误出现在使用 MyBatis 框架时,可能是因为配置文件中的数据源属性 maxPoolPreparedStatementPerConnectionSize 被认为是未知的。可以检查配置文件中的数据源属性是否正确,或者尝试将其删除并测试是否能够解决问题。如果问题仍然存在,可能需要检查 MyBatis 和数据库驱动程序的版本是否兼容。
阅读全文