You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm relatively new to using Kotlin, and right now I am trying to develop an application that establishes a connection with a RethinkDB server that I have created on my network. I was also following this guide: https://rethinkdb.com/blog/alt-jvm-driver/ . Here's the code that I've tried so far:
Basically what I have going on here is that I created a button within the fragment that I'm working in, and that button is supposed to invoke an Asynchronous function that establishes a connection to the RethinkDB server that I have created. I also made sure to import RethinkDB by using import com.rethinkdb.RethinkDB.r
However when I run this in the Android Emulator using a debugger, I get the following error message:
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.example.adm3000, PID: 10176
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: com.rethinkdb.gen.exc.ReqlDriverError: java.security.spec.InvalidKeySpecException: Could not generate secret key
at com.rethinkdb.net.Crypto.pbkdf2(Crypto.java:113)
at com.rethinkdb.net.HandshakeProtocol$WaitingForAuthResponse.nextState(HandshakeProtocol.java:148)
at com.rethinkdb.net.HandshakeProtocol.doHandshake(HandshakeProtocol.java:40)
at com.rethinkdb.net.Connection.connect(Connection.java:118)
at com.rethinkdb.net.Connection$Builder.connect(Connection.java:568)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:40)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:19)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:33)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:31)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.security.spec.InvalidKeySpecException: Could not generate secret key
at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:535)
at com.rethinkdb.net.Crypto.pbkdf2(Crypto.java:109)
at com.rethinkdb.net.HandshakeProtocol$WaitingForAuthResponse.nextState(HandshakeProtocol.java:148)
at com.rethinkdb.net.HandshakeProtocol.doHandshake(HandshakeProtocol.java:40)
at com.rethinkdb.net.Connection.connect(Connection.java:118)
at com.rethinkdb.net.Connection$Builder.connect(Connection.java:568)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:40)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:19)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:33)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:31)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.IllegalArgumentException: password empty
at com.android.org.bouncycastle.jcajce.provider.symmetric.PBEPBKDF2$BasePBKDF2.engineGenerateSecret(PBEPBKDF2.java:237)
at javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:524)
at com.rethinkdb.net.Crypto.pbkdf2(Crypto.java:109)
at com.rethinkdb.net.HandshakeProtocol$WaitingForAuthResponse.nextState(HandshakeProtocol.java:148)
at com.rethinkdb.net.HandshakeProtocol.doHandshake(HandshakeProtocol.java:40)
at com.rethinkdb.net.Connection.connect(Connection.java:118)
at com.rethinkdb.net.Connection$Builder.connect(Connection.java:568)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:40)
at com.example.adm3000.ActivityGPS$onCreate$1$1.invoke(ActivityGPS.kt:19)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:33)
at com.example.adm3000.ActivityGPS$onCreate$doAsync.doInBackground(ActivityGPS.kt:31)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
I tried really hard researching what this 'Could not generate secret key' error is or why it's being thrown, but there's very little documentation regarding this specific error in Android Studio. Would you happen to know why this error is being thrown, and how I can successfully establish a connection to my database using Kotlin?
The text was updated successfully, but these errors were encountered:
Hello!
I'm relatively new to using Kotlin, and right now I am trying to develop an application that establishes a connection with a RethinkDB server that I have created on my network. I was also following this guide: https://rethinkdb.com/blog/alt-jvm-driver/ . Here's the code that I've tried so far:
Basically what I have going on here is that I created a button within the fragment that I'm working in, and that button is supposed to invoke an Asynchronous function that establishes a connection to the RethinkDB server that I have created. I also made sure to import RethinkDB by using
import com.rethinkdb.RethinkDB.r
However when I run this in the Android Emulator using a debugger, I get the following error message:
I tried really hard researching what this 'Could not generate secret key' error is or why it's being thrown, but there's very little documentation regarding this specific error in Android Studio. Would you happen to know why this error is being thrown, and how I can successfully establish a connection to my database using Kotlin?
The text was updated successfully, but these errors were encountered: