Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with empty username/password #8

Open
dave-co opened this issue Oct 10, 2017 · 1 comment
Open

NullPointerException with empty username/password #8

dave-co opened this issue Oct 10, 2017 · 1 comment
Labels

Comments

@dave-co
Copy link

dave-co commented Oct 10, 2017

Attempting to connect to a Cassandra instance using SQuirreL 3.8.0 and driver 0.6.4 with an empty username and password results in a null pointer.

Unexpected Error occurred attempting to open an SQL connection.
class java.lang.NullPointerException: null

with detail:

java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:459)
	at java.util.Properties.setProperty(Properties.java:166)
	at com.github.cassandra.jdbc.CassandraDatabaseMetaData.setProperty(CassandraDatabaseMetaData.java:733)
	at com.github.cassandra.jdbc.BaseCassandraConnection.<init>(BaseCassandraConnection.java:55)
	at com.github.cassandra.jdbc.provider.datastax.CassandraConnection.<init>(CassandraConnection.java:58)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at com.github.cassandra.jdbc.CassandraDriver.createConnection(CassandraDriver.java:67)
	at com.github.cassandra.jdbc.CassandraDriver.connect(CassandraDriver.java:111)
	at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

My guess is that an empty username/password is interpreted as being null instead of an empty string, and the Hashtable that backs the Property object does not support nulls.

@zhicwu
Copy link
Owner

zhicwu commented Oct 11, 2017

Thanks for reporting this. I’ll fix it in these two days.

@zhicwu zhicwu added the bug label Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants