You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "HouYuSource (via GitHub)" <gi...@apache.org> on 2024/01/05 06:54:21 UTC
Re: [I] java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error [shardingsphere]
HouYuSource commented on issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701#issuecomment-1878215315
> @ted-w-20230331 hi!,can you tell you how did you solve it? I also encountered this kind of problem
You can debug the SQLParserFactory static code,
1. The result of executing this code varies among different threads, and static only executes once, so the first result must be correct;
2. This code should not be executed by an asynchronous thread because the ClassLoader of the asynchronous thread is uncertain, which may cause SPI to obtain an empty implementation class;
3. If it is a SpringBoot application, the current thread's ClassLoader should be 'org.springframework.boot.loader.LaunchedURLClassLoader' to properly initialize.
```
public final class SQLParserFactory {
static {
NewInstanceServiceLoader.register(SQLParserConfiguration.class);
}
// ...
}
```
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org