Hmz3192 opened a new issue #11917: URL: https://github.com/apache/shardingsphere/issues/11917
## Version 4.0.0 ## Problem In the springboot framework, I need to connect to the database to query the required data in the custom sub database algorithm, but I can't get the instantiated service, applicationcontextservice and componentscan. I can ensure that the configuration is correct. It's normal to instantiate the service with spring annotation or spring context in other normal controllers, However, it cannot be instantiated in the custom sub database algorithm, and the acquisition is always null。 How can I get the spring service in shardingalgorithm? Does shardingsphere have its own context? I have seen shardingcontent. Can I get the service through this? There is no relevant example for reference. ## Result  The context can be instantiated normally when the container is initialized,as follow  When I enter the sub database algorithm, neither the context nor the spring annotation can get the service, which are all null   **For English only**, other languages will not accept. Before asking a question, make sure you have: - Googled your question. - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues). - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview). Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will **close it**. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
