Issue 1:
Integrating sharding-transaction-base-saga to configure saga. properties file with saga. persistence. enabled = true, and then configuring saga. persistence. ds. content, resulting in SpringBootConfiguration. dataSource () method creating dataSource error subsequently leading to

Java.util.Service Configuration Error: org.apache.shardingsphere.transaction.spi.ShardingTransaction Manager: Provider.shardingsphere.transaction.saga.SagaShardingTransaction Manager can not be instantiated

Issue 2:
Bug Report

Which version of ShardingSphere did you use?

compile group: 'org.apache.shardingsphere', name: 'sharding-jdbc-spring-boot-starter', version: '4.0.0-RC1'

Which project did you use? Sharding-JDBC or Sharding-Proxy?

sharding-jdbc-spring-boot-starter

springboot: 2.1.0

spring-boot-starter-data-jpa:2.1.0

Expected behavior

Start the application normally

Actual behavior

Caused by: java.lang.NullPointerException

Reason analyze (If you can)

myconfig

spring:
data:
redis:
repositories:
enabled: false
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
hibernate:
ddl-auto: update
shardingsphere:
datasource:
names: master,slave
master:
driver-class-name: com.mysql.cj.jdbc.Driver
password: '****'
url: jdbc:mysql://192.168.20.6:3306/***?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
type: com.alibaba.druid.pool.DruidDataSource

slave:
driver-class-name: com.mysql.cj.jdbc.Driver
password: '*****'
url: jdbc:mysql://192.168.20.6:3307/*****?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
type: com.alibaba.druid.pool.DruidDataSource

masterslave:
load-balance-algorithm-type: round_robin
name: ms
master-data-source-name: master
slave-data-source-names: slave

props:
sql:
show: true

the traceback info:

Caused by: java.lang.NullPointerException

at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata.ResultSetReturnedDatabaseMetaData.getActualTableNamePattern(ResultSetReturnedDatabaseMetaData.java:265) ~[sharding-jdbc-core-4.0.0-RC1.jar:4.0.0-RC1]

at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.metadata.ResultSetReturnedDatabaseMetaData.getTables(ResultSetReturnedDatabaseMetaData.java:94) ~[sharding-jdbc-core-4.0.0-RC1.jar:4.0.0-RC1]

at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTables(InformationExtractorJdbcDatabaseMetaDataImpl.java:329) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTablesInformation(DatabaseInformationImpl.java:120) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:65) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:310) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]

at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) ~[spring-orm-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]

analyze

for Sharding-JDBC,i only want to use master-slave pattern,

when i set the ddl-auto = create or create_drop, my application start right, when the

value is update or validate, it will be cause NullPointerException, i followed the source code,

when init MasterSlaveDataSource class, in createCachedDatabaseMetaData() function,

it return new CachedDatabaseMetaData(connection.getMetaData(), dataSourceMap, null);

the third args is null, it named ShardingRule.

the stack info :org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTables()

will invoke ResultSetReturnedDatabaseMetaData.java:94.

because ShardingRule is null, so raise NullPointerException..