1

I'm designing an android app to directly connect to an azure database using the open source jtds driver version 1.2.7. I've successfully connected to an sql server express database, so I know it works. When attempting to connect to the azure database, though, I get an error. Here's the stacktrace:

06-06 17:03:49.881: E/AndroidRuntime(1906): FATAL EXCEPTION: AsyncTask #2
06-06 17:03:49.881: E/AndroidRuntime(1906): java.lang.RuntimeException: An error occured while executing doInBackground()
06-06 17:03:49.881: E/AndroidRuntime(1906):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.lang.Thread.run(Thread.java:856)
06-06 17:03:49.881: E/AndroidRuntime(1906): Caused by: java.lang.NoClassDefFoundError: com.sun.net.ssl.SSLContext
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.ssl.SocketFactoriesSUN$TdsTlsSocketFactory.factory(SocketFactoriesSUN.java:174)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.ssl.SocketFactoriesSUN$TdsTlsSocketFactory.getFactory(SocketFactoriesSUN.java:157)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.ssl.SocketFactoriesSUN$TdsTlsSocketFactory.createSocket(SocketFactoriesSUN.java:86)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.jdbc.SharedSocket.enableEncryption(SharedSocket.java:332)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.jdbc.TdsCore.negotiateSSL(TdsCore.java:554)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:350)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:188)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.sql.DriverManager.getConnection(DriverManager.java:175)
06-06 17:03:49.881: E/AndroidRuntime(1906):     at java.sql.DriverManager.getConnection(DriverManager.java:209)

It looks like the problem is the java.lang.NoClassDefFoundError: com.sun.net.ssl.SSLContext but I have no idea what to do about this. I believe that force encryption is turned on at the database, but I did not set it up and I don't have permission to mess with those settings. Any idea what to do about this error?

4

0 回答 0