mmolimar / ksql-jdbc-driver

JDBC driver for Apache Kafka
Apache License 2.0
88 stars 19 forks source link

NPE at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:204) #29

Open Hubbitus opened 3 years ago

Hubbitus commented 3 years ago

Hello.

I've trying use that driver with DBeaver.

At very simple operations it works. But for example on the try discover tables list it gives me the exception:

2020-11-25 15:31:06.940 -                                                                                                                                                                                                                   
java.lang.NullPointerException                                                                                                                                                                                                              
        at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:204)                                                                                                                                                    
        at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:204)                                                                                                                                                               
        at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:35)                                                                                                                                                       
        at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)                                                                                                                                                      
        at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)                                                                                                                                                              
        at com.github.mmolimar.ksql.jdbc.KsqlDatabaseMetaData.getTables(KsqlDatabaseMetaData.scala:501)                                                                                                                                     
        at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCDatabaseMetaDataImpl.getTables(JDBCDatabaseMetaDataImpl.java:1116)                                                                                                                    
        at org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel.prepareTableLoadStatement(GenericMetaModel.java:505)                                                                                                                   
        at org.jkiss.dbeaver.ext.generic.model.TableCache.prepareLookupStatement(TableCache.java:68)                                                                                                                                        
        at org.jkiss.dbeaver.ext.generic.model.TableCache.prepareLookupStatement(TableCache.java:1)                                                                                                                                         
        at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructLookupCache.prepareObjectsStatement(JDBCStructLookupCache.java:137)                                                                                                            
        at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache.loadObjects(JDBCObjectCache.java:105)                                                                                                                                    
        at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache.getAllObjects(JDBCObjectCache.java:73)                                                                                                                                   
        at org.jkiss.dbeaver.ext.generic.model.GenericObjectContainer.getTables(GenericObjectContainer.java:127)                                                                                                                            
        at org.jkiss.dbeaver.ext.generic.model.GenericObjectContainer.getPhysicalTables(GenericObjectContainer.java:111)                                                                                                                    
        at org.jkiss.dbeaver.ext.generic.model.GenericDataSource.getPhysicalTables(GenericDataSource.java:363)                                                                                                                              
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                                                      
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)                                                                                                                                                    
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                                                            
        at java.lang.reflect.Method.invoke(Method.java:498)                                                                                                                                                                                 
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.extractPropertyValue(DBNDatabaseNode.java:871)                                                                                                                                 
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.access$1(DBNDatabaseNode.java:852)                                                                                                                                             
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode$PropertyValueReader.run(DBNDatabaseNode.java:914)                                                                                                                              
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode$PropertyValueReader.run(DBNDatabaseNode.java:1)                                                                                                                                
        at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:168)                                                                                                                                                 
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.loadTreeItems(DBNDatabaseNode.java:538)                                                                                                                                        
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.loadChildren(DBNDatabaseNode.java:428)                                                                                                                                         
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.getChildren(DBNDatabaseNode.java:205)                                                                                                                                          
        at org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.getChildren(DBNDatabaseNode.java:1)                                                                                                                                            
        at org.jkiss.dbeaver.model.navigator.DBNUtils.getNodeChildrenFiltered(DBNUtils.java:70)                                                                                                                                             
        at org.jkiss.dbeaver.ui.navigator.database.load.TreeLoadService.evaluate(TreeLoadService.java:49)                                                                                                                                   
        at org.jkiss.dbeaver.ui.navigator.database.load.TreeLoadService.evaluate(TreeLoadService.java:1)                                                                                                                                    
        at org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:88)                                                                                                                                                                          
        at org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:72)                                                                                                                                                                          
        at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)                                                                                                                                                            
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Hubbitus commented 3 years ago

Sorry, do you need simple reproduction on java? Are you willing pull request with a fix?

mmolimar commented 3 years ago

Hi. Sure! PR are very welcome! (to develop branch pls).