Skip to content

Combability with Spring Boot 3 #971

@MartinAlexanderKrul

Description

@MartinAlexanderKrul

Hello there.

I have a compatibility issue.
Before I was using Spring Boot v2.7.18, Spring v5.3.31 with mybatis-spring-boot-starter v3.0.1 and everything was perfect.

Due to policy, I had to upgrade to Spring Boot v3.2.3, Spring v6.1.4, which led to a problem with factoryBeanObjectType so I updated the starter to version 3.0.3 and here it comes my problem.

Even with the exact same configuration, ibatis can not find jdcb connection
Message: null, cause: org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection\r\n### The error may exist in .../Mapper.java (best guess)\r\n### The error may involve ...Mapper.getAll\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection

Did anyone have the same problem? Is there any solution for it?

I have standard database connection properties in application.properties

spring.datasource.url=jdbc:sqlserver://myServer;databaseName=myDatabse;encrypt=false;integratedSecurity=true;
spring.datasource.driverclassname=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.max_active=20
spring.datasource.minimum_idle=1
spring.datasource.maximum_pool_size=20

Thank you all for your time.

Activity

harawata

harawata commented on May 17, 2024

@harawata
Member

Hello @MartinAlexanderKrul ,

Please edit the issue detail and include the entire stack trace.

sepe81

sepe81 commented on May 17, 2024

@sepe81

@MartinAlexanderKrul I guess you are referring to mybatis/spring#855 – for me mybatis-spring-3.0.3 solved the issue. Maybe you could further update to Spring Boot v3.2.5.

If you also use ehcache-cache, mybatis/ehcache-cache#61 could be another issue.

hazendaz

hazendaz commented on Jul 12, 2025

@hazendaz
Member

@MartinAlexanderKrul I believe issue is now solved, we have released 3.0.5 that also supports spring boot 3.5.x. Please check and let us know if this was solved for you.

@sepe81 I think we need a redesign to even pick up ehcache 3 and from what I've heard around that never really worked out well. I'm pretty sure jcache even died and was not migrated to jakarta, could be wrong but that is what I've heard and also that ehcache 3 has serious flaws. I'd suggest using caffeine cache or some other caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sepe81@harawata@hazendaz@MartinAlexanderKrul

        Issue actions

          Combability with Spring Boot 3 · Issue #971 · mybatis/spring-boot-starter