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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   58e912d
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Start application successfully when I use sharding feature with oracle 
database
   
   ### Actual behavior
   
   Metadata throw NullPointerException, and I can't get any exception stack 
info.
   
   <img width="1487" alt="image" 
src="https://user-images.githubusercontent.com/10829171/199689906-6837bd4e-cfdf-4beb-a8f1-3851352b1ebf.png";>
   
   ### Reason analyze (If you can)
   
   At present, when an exception occurs in the 
`dialectSchemaMetaDataLoader#load` method, only SQLException is caught, which 
prevents us from using the loadByDefault method to load metadata again. In 
addition, there are no exceptions other than SQLException recorded in the error 
log, so we need to optimize the exception handling logic.
   
   ```java
       private static Collection<SchemaMetaData> load(final 
SchemaMetaDataLoaderMaterial material) throws SQLException {
           Optional<DialectSchemaMetaDataLoader> dialectSchemaMetaDataLoader = 
DialectSchemaMetaDataLoaderFactory.findInstance(material.getStorageType());
           if (dialectSchemaMetaDataLoader.isPresent()) {
               try {
                   return 
dialectSchemaMetaDataLoader.get().load(material.getDataSource(), 
material.getActualTableNames(), material.getDefaultSchemaName());
               } catch (final SQLException ex) {
                   log.error("Dialect load schema meta data error.", ex);
               }
           }
           return loadByDefault(material);
       }
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


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