Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The latest springboot using mybatis-spring-stater 3.0.2 throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" #855

Closed
aalx opened this issue Sep 15, 2023 · 6 comments · Fixed by #865
Assignees

Comments

@aalx
Copy link

aalx commented Sep 15, 2023

Springboot Version 3.2.0-M2,spring-boot-starter 3.0.2
In this version ,FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes() method has been changed,throw a IllegalArgumentException when "factoryBeanObjectType" not ResolvableType、Class type。But in ClassPathMapperScanner.processBeanDefinitions() menthod ( line 277) set a String type with beanClassName,

@harawata
Copy link
Member

Hello @aalx ,

Could you share a small project that reproduces the exception?
There is a project template for mybatis-spring-boot in this repo.

Also, please post a link to the relevant commit (or issue) in the Spring repo if you can.
I would like to understand the details about the change.

@StreamLuna
Copy link

I had the same problem when I wanted to use spring-boot 3.2.0-M2 and mybatis-spring-boot-starter 3.0.2, spring-boot 3.2.0-M2 depends on spring-beans 6.1.0-M4. Changing the spring.version in pom.xml file to <spring.version>6.1.0-M4</spring.version> and then running the test can reproduce the problem. It throws an exception when running into ResolvableType getTypeForFactoryBeanFromAttributes(AttributeAccessor attributes) method. I don't know much about mybatis-spring, maybe it can be fixed when the spring-beans 6.1 is released.

@harawata
Copy link
Member

The doc states that mybatis-spring-boot-starter 3.0 is not compatible with spring-boot 3.2, so @kazuki43zoo is aware of the issue probably.
https://mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/#requirements

@kazuki43zoo
Copy link
Member

kazuki43zoo commented Oct 23, 2023

@aalx @StreamLuna (cc: @harawata )
Thanks for your feedback! I'll fix this issue ASAP.

@kazuki43zoo kazuki43zoo added enhancement Improve a feature or add a new feature and removed waiting for feedback labels Oct 23, 2023
@kazuki43zoo kazuki43zoo self-assigned this Oct 23, 2023
@kazuki43zoo kazuki43zoo added this to the 3.0.3 milestone Oct 23, 2023
kazuki43zoo added a commit to kazuki43zoo/spring that referenced this issue Oct 23, 2023
@kazuki43zoo kazuki43zoo removed this from the 3.0.3 milestone Oct 23, 2023
kazuki43zoo added a commit to kazuki43zoo/spring that referenced this issue Oct 23, 2023
kazuki43zoo added a commit that referenced this issue Oct 23, 2023
Corrected to set bean class instead of bean class name to factoryBeanObjectType of BeanDefinition attribute
@kazuki43zoo
Copy link
Member

@aalx @StreamLuna
I've fixed via #865. Please try 3.0.3-SNAPSHOT! and we will release 3.0.3 as GA version ASAP.

@kazuki43zoo kazuki43zoo removed the enhancement Improve a feature or add a new feature label Oct 23, 2023
@techwn
Copy link

techwn commented Nov 24, 2023

I noticed that spring boot 3.2 GA is published, I think the 3.0.3 GA should be scheduled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants