Comments (9)
Hi,
I had been trying to make it work, but couldn't.
And there is another attempt which also didn't succeed.
https://github.com/hoserdude/spring-boot-mybatis-profile-sandbox
As MapperScan annotation works fine with plain Spring, maybe you should ask it on Spring-Boot's forum.
Regards,
Iwao
from spring.
I am encountering the same problem.
One workaround is to define the datasource in a parent context and the mappers in a child.
Is this related to https://code.google.com/p/mybatis/issues/detail?id=414?
from spring.
Hi @alexmiller422,
It's similar, but no. That issue was resolved long time ago and the problem reported here occurs only with spring-boot.
from spring.
Hi @harawata,
After stepping through code, this would appear be a bug in Spring's DefaultListableBeanFactory(AbstractBeanFactory).getTypeForFactoryBean(String, RootBeanDefinition). It is calling DefaultListableBeanFactory(AbstractBeanFactory).doGetBean(String, Class, Object[], boolean) which is trying to instantiate an instance of the bean itself, rather than the factory.
from spring.
I have raised https://jira.spring.io/browse/SPR-11582 against the Spring Framework.
from spring.
Thanks for the feedback and forwarding the issue to spring!
from spring.
Thank you very much for the investigation, @alexmiller422 !
I will watch the issue.
from spring.
I think we have fixed an underlying issue in Spring Boot which was causing early instantiation of BeanFactory objects. Can you try again with Spring Boot 1.1.6.BUILD-SNAPSHOT.
from spring.
Thank you @philwebb !
To @mreiterer @alexmiller422
I have verified that updating spring-boot version fixed the issue for @mreiterer 's project.
See mreiterer/spring-boot-mybatis#1 for the actual changes.
Please let me know in case you are still experiencing the issue.
from spring.
Related Issues (20)
- The query cache is not cleared after transaction rolls back to a savepoint HOT 3
- mapperLocations is overwritten HOT 1
- SqlSessionFactoryBean single resource, using wildcard causes a IOException HOT 4
- When Spring has multiple ApplicationContexts, it may throw BeanCreationNotAllowedException HOT 1
- Update dependency org.mybatis:mybatis to v3.5.13 on 2.1.x
- fix: change the event type that SqlSessionFactory is listening to on 2.1.x
- Drop support 1.3.x and 2.0.x
- Support processPropertyPlaceHolders option in mapper:scan and @MapperScan
- does mybatis-spring support to use customized mapper excludeFilters? HOT 1
- The logic regarding transaction rollback seems incorrect HOT 3
- The latest springboot using mybatis-spring-stater 3.0.2 throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 6
- The first query of maybatis takes longer than the second query. How to warm up in advance? HOT 1
- Switch baseline to Spring 6.1 and Spring Batch 5.1
- Support JDK 22 on CI
- why not override postProcessBeanDefinition method in ClassPathMapperScanner
- The latest springboot using mybatis-spring-stater 3.0.3-SNAPSHOT throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 5
- An idea to adapt to Spring 6.1 HOT 3
- MyBatisSystemException message is null
- Why @MapperScan scan all interface? Maybe only scan annotated with @Mapper is better? HOT 2
- mybatis-spring official docs for english responds 404 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring.