severous opened a new issue, #32183:
URL: https://github.com/apache/shardingsphere/issues/32183

   I am getting the error shown below when using a custom data source:
   
   ```bash
   Caused by: java.lang.NullPointerException: Cannot invoke "Object.toString()" 
because the return value of "java.util.Map.get(Object)" is null
        at 
org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnit.<init>(StorageUnit.java:56)
        at 
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration.getStorageUnits(DataSourceProvidedDatabaseConfiguration.java:73)
        at 
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration.<init>(DataSourceProvidedDatabaseConfiguration.java:54)
        at 
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:77)
        at 
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:67)
        at 
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95)
        at 
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:78)
        at 
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:139)
   ```
   <img width="1277" alt="截屏2024-07-18 21 41 27" 
src="https://github.com/user-attachments/assets/87ff2152-b85b-4cf9-ae7c-ae9bb02ec428";>
   
   The error occurs in the following line of code because of standardProps is 
null
   ```java
           Map<String, Object> standardProps = 
dataSourcePoolProperties.getConnectionPropertySynonyms().getStandardProperties();
           String url = standardProps.get("url").toString();
   ```
   These properties are obtained from the DataSourcePoolReflection, which 
obtains them in a reflective manner. However, my custom datasource does not 
have these getter methods! I would like to know what conditions must be 
fulfilled for a custom data source
   
   


-- 
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]

Reply via email to