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)
时间: 2023-06-13 19:07:04 浏览: 215
这个错误出现在使用 MyBatis 框架时,可能是因为配置文件中的数据源属性 maxPoolPreparedStatementPerConnectionSize 被认为是未知的。可以检查配置文件中的数据源属性是否正确,或者尝试将其删除并测试是否能够解决问题。如果问题仍然存在,可能需要检查 MyBatis 和数据库驱动程序的版本是否兼容。
相关问题
org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.
org.apache.ibatis.exceptions.PersistenceException是一个错误,表示在构建SqlSession时出现了问题。这个错误可能有多种原因,比如找不到定义的类、不包含指定的值等等。根据提供的引用内容,可以看到有一些错误提示和解决方法被提供了。一种解决方法是找到相关的代码文件,检查是否有错误或未修改的代码。另一种解决方法是对错误信息进行分析,并寻找解决办法。
请在回答完问题后再提出几个相关问题。
相关问题:
1. org.apache.ibatis.exceptions.PersistenceException有哪些常见的原因和解决方法?
2. 怎样找到并修改定义的类文件?
3. 如何处理不包含指定值的错误?
Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.
Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession是Mybatis在构建SqlSession时发生的异常。
根据引用,错误可能存在于com/guangyou/dao/UserMapper.xml文件中。这可能是由于配置文件无法正确导出导致的。根据引用,这个问题可能是由于将配置文件放在了错误的目录下,比如将配置文件放在了java目录而不是resources目录。请确保配置文件的位置和路径正确,并且可以被正确导出。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法](https://download.csdn.net/download/weixin_38500709/13701351)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.](https://blog.csdn.net/weixin_43654123/article/details/121446434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文