java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/resource/Referenceable

30 views
Skip to first unread message

AlliesXposs Xposs

unread,
Dec 26, 2022, 4:23:35 AM12/26/22
to firebird-java
i'm sorry ...
i'm first try use Jaybird 4 and firebird 4
and Android studio Bumblebee


 try {
Class.forName(DriverName);
connection = getConnection(databaseURL, testDB, password);
tv.setText("Connection Successfully.");
} catch (Exception e) {
tv.setText("e.getMessage()");
}

i have error :

;
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:100)
        at java.sql.DriverManager.getConnection(DriverManager.java:569)
        at java.sql.DriverManager.getConnection(DriverManager.java:219)
        at org.firebird.jdbc.MainActivity.onClick(MainActivity.java:36)
        at org.firebird.jdbc.MainActivity.$r8$lambda$4LdStmGa5V_9LynetYhxY4TdnK4(Unknown Source:0)
        at org.firebird.jdbc.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
        at android.view.View.performClick(View.java:6392)
        at android.view.View$PerformClick.run(View.java:25133)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:198)
        at android.app.ActivityThread.main(ActivityThread.java:7055)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:836)
     Caused by: java.lang.ClassNotFoundException: javax.resource.Referenceable
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:100) 
        at java.sql.DriverManager.getConnection(DriverManager.java:569) 
        at java.sql.DriverManager.getConnection(DriverManager.java:219) 
        at org.firebird.jdbc.MainActivity.onClick(MainActivity.java:36) 
        at org.firebird.jdbc.MainActivity.$r8$lambda$4LdStmGa5V_9LynetYhxY4TdnK4(Unknown Source:0) 
        at org.firebird.jdbc.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2) 
        at android.view.View.performClick(View.java:6392) 
        at android.view.View$PerformClick.run(View.java:25133) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:198) 
        at android.app.ActivityThread.main(ActivityThread.java:7055) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:836) 
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/naming/Referenceable;
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:100) 
        at java.sql.DriverManager.getConnection(DriverManager.java:569) 
        at java.sql.DriverManager.getConnection(DriverManager.java:219) 
        at org.firebird.jdbc.MainActivity.onClick(MainActivity.java:36) 
        at org.firebird.jdbc.MainActivity.$r8$lambda$4LdStmGa5V_9LynetYhxY4TdnK4(Unknown Source:0) 
        at org.firebird.jdbc.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2) 
        at android.view.View.performClick(View.java:6392) 
        at android.view.View$PerformClick.run(View.java:25133) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:198) 
        at android.app.ActivityThread.main(ActivityThread.java:7055) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:836) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.naming.Referenceable" on path: DexPathList[[zip file "/data/app/org.firebird.jdbc-tQQvdo4v9Qk4OsrLuB7VBw==/base.apk"],nativeLibraryDirectories=[/data/app/org.firebird.jdbc-tQQvdo4v9Qk4OsrLuB7VBw==/lib/arm64, /system/lib64, /vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:100) 
        at java.sql.DriverManager.getConnection(DriverManager.java:569) 
        at java.sql.DriverManager.getConnection(DriverManager.java:219) 
        at org.firebird.jdbc.MainActivity.onClick(MainActivity.java:36) 
        at org.firebird.jdbc.MainActivity.$r8$lambda$4LdStmGa5V_9LynetYhxY4TdnK4(Unknown Source:0) 
        at org.firebird.jdbc.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2) 
        at android.view.View.performClick(View.java:6392) 
        at android.view.View$PerformClick.run(View.java:25133) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:198) 
        at android.app.ActivityThread.main(ActivityThread.java:7055) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:836) 



any solution?

Thanks

Mark Rotteveel

unread,
Dec 26, 2022, 4:30:42 AM12/26/22
to firebi...@googlegroups.com
On 25-12-2022 21:32, AlliesXposs Xposs wrote:
> i'm sorry ...
> i'm first try use Jaybird 4 and firebird 4
> and Android studio Bumblebee
[..]
> any solution?

Jaybird cannot be used on Android as Jaybird uses classes from the Java
runtime which are not available on Android (although Android uses the
Java language and offers parts of the Java runtime, it is not a complete
Java implementation). For a while there was a fork of Jaybird for
Android, but as I recall the maintainer of that version stopped around
Jaybird 2.2.4.

For security and performance reasons, you shouldn't connect directly to
a database from Android anyway, but instead use a REST API (e.g. written
with Spring Boot) to mediate between your application and the database.

Mark
--
Mark Rotteveel

Hugo Larson

unread,
Dec 26, 2022, 6:32:48 AM12/26/22
to firebi...@googlegroups.com
Hi Mark.

Can you please elaborate on this issue.
How can Spring boot connect directly when JDBC can't?

Merry Christmas.




--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-java+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/firebird-java/f614a928-faab-3663-404c-f306721fb1df%40lawinegevaar.nl.

Mark Rotteveel

unread,
Dec 27, 2022, 5:22:08 AM12/27/22
to firebi...@googlegroups.com
On 26-12-2022 12:32, 'Hugo Larson' via firebird-java wrote:
> Can you please elaborate on this issue.
> How can Spring boot connect directly when JDBC can't?

I'm not proposing to use Spring Boot on Android. The problem is that
Jaybird doesn't work on Android (and that IMHO, connecting directly to a
DB from Android is a bad idea in general). The solution is then to write
a REST service, for example using Spring Boot. Then the Android
application uses HTTP/REST to talk to the REST service, and that REST
service talks to the database.

Mark
--
Mark Rotteveel

Hugo Larson

unread,
Dec 27, 2022, 5:52:56 AM12/27/22
to firebi...@googlegroups.com
There is an Android build of Firebird. I wonder what the use case of it is if one should not connect directly to it.
I'm asking because we are contemplating about a Android POS software with Firebird.

Br,

--
You received this message because you are subscribed to the Google Groups "firebird-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-java+unsub...@googlegroups.com.

Mark Rotteveel

unread,
Dec 27, 2022, 6:10:22 AM12/27/22
to firebi...@googlegroups.com
On 27-12-2022 11:47, 'Hugo Larson' via firebird-java wrote:
> There is an Android build of Firebird. I wonder what the use case of it
> is if one should not connect directly to it.
> I'm asking because we are contemplating about a Android POS software
> with Firebird.

That is for running Firebird directly on your Android, and then most
likely as an embedded database engine. That is different then
establishing a connection to a remote Firebird server.

However, the case remains that Jaybird, out of the box, will not work on
Android.

Mark
--
Mark Rotteveel

NGC 147

unread,
Sep 7, 2023, 4:47:29 AM9/7/23
to firebird-java
Hello. Did you manage to write a REST server that takes data from the database and returns the client to the android? is there any example?

вторник, 27 декабря 2022 г. в 14:10:22 UTC+3, Mark Rotteveel:
Reply all
Reply to author
Forward
0 new messages