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

Open
#52 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, spring
Domain
backend

Research direction

The issue mentions @MapperScan, @PostConstruct, bean post processing, and applicationContext initialization, but names no files or tests. Start by tracing the @MapperScan and bean lifecycle entry points, then determine the intended initialization phase and how completion could be verified. The issue needs a defined scope and acceptance criteria before implementation can begin.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
2.9k
Forks
2.6k
Avg merge
3d 4m
Merged PRs (30d)
8

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mybatis/spring

All issues in mybatis/spring

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.