Code Monkey home page Code Monkey logo

Comments (9)

harawata avatar harawata commented on June 9, 2024

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.

alexmiller422 avatar alexmiller422 commented on June 9, 2024

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.

harawata avatar harawata commented on June 9, 2024

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.

alexmiller422 avatar alexmiller422 commented on June 9, 2024

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.

alexmiller422 avatar alexmiller422 commented on June 9, 2024

I have raised https://jira.spring.io/browse/SPR-11582 against the Spring Framework.

from spring.

mreiterer avatar mreiterer commented on June 9, 2024

Thanks for the feedback and forwarding the issue to spring!

from spring.

harawata avatar harawata commented on June 9, 2024

Thank you very much for the investigation, @alexmiller422 !
I will watch the issue.

from spring.

philwebb avatar philwebb commented on June 9, 2024

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.

harawata avatar harawata commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.