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

How to enable mybatis scan after bean post (just when the applicationContext initialized) #52

Open
bwzhang2011 opened this issue Nov 17, 2014 · 1 comment

Comments

@bwzhang2011
Copy link

mybatis provide simple cache integration defined in mybatis mapper xml. but it has some problem that the cache integrated sometimes is not initialized completed while the application context is loading.
if we bring in some @PostConstruct annotation to construct the spring bean it will throw nullpointerException while the cache instance could not be found. so how could I enable the beanpost way for mybatis especially for @mapperscan support. and through some configuration, the mybatis will invoke the initialize operation after the applicationContext completed. I just remembered some article referred such before but I could not know how to invoke that. so hope mybatis team could help me. for the cache instance sometimes is build through spring.

@bwzhang2011
Copy link
Author

@emacarron, would you mind sparing some time to take a look at this ? as some cache implementation is too simple that could not satisfy the actual use cases. so when encounter such problem that the cache instance has not been initialized completely through the container, when calling the mapper with the cache configuration support it will throw null pointer Exception for the cache reference has not been done. I just know where the point but I could not how to hack it just make the cache reference done after the context initialized.

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

No branches or pull requests

1 participant