JayBird 2.2 embedded

59 views
Skip to first unread message

Steffen Heil

unread,
Jun 17, 2021, 1:45:30 PM6/17/21
to firebird-java
Hi


I know that jaybird 2.2 is outdated, but I need to get a legacy application working (to transfer data, not in production), that is using FBWrappingDataSource.

I have set FIREBIRD to the path of the extracted (but otherwise unchanged) ZIP:

>echo %FIREBIRD%
l:\portable\Firebird-3.0.7.33374-1

I try to use it using AdoptOpenJDK 8 x64:

>..\..\..\jdk8u292-b10\bin\java -Djava.library.path=..\..\..\Jaybird-2.2.15-JDK_1.8 -...
2021-06-17 19:23:06.071 / INFO null - database initialized
java.lang.RuntimeException: Failed to initialize Jaybird native library. This is most likely due to a failure to load the firebird client library.
        at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:106)
        at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31)
...


What am I missing?


Best regards,
   Steffen

Mark Rotteveel

unread,
Jun 18, 2021, 10:00:06 AM6/18/21
to firebi...@googlegroups.com
The error itself means that Jaybird can't find or load jaybird22.dll or
jaybird22_x64.dll, or that the jaybird DLL can't find or load
fbclient.dll. For Jaybird 2.2, you need to ensure that 1) the location
of the jaybird.dll is on the java.library.path, and 2) the location of
fbclient.dll is on the PATH (Jaybird does nothing with the FIREBIRD
environment variable).

If you just need to run the application to transfer data, you may want
to consider using an actual Firebird server instead of using Firebird
Embedded.

Mark
--
Mark Rotteveel

Steffen Heil

unread,
Jun 18, 2021, 10:16:02 AM6/18/21
to firebi...@googlegroups.com
If I leave out the -Djava.library.path=... argument, I get another error:
  java.lang.UnsatisfiedLinkError: no jaybird22_x64 in java.library.path

So I suspect it can load this library. And I have added the Firebird folder to the path, tried both relative and absolute. (I added the root folder that contanis fbclient.dll.)
Still getting:
   java.lang.RuntimeException: Failed to initialize Jaybird native library. This is most likely due to a failure to load the firebird client library.
        at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:106)

Using something that has to be installed is not an option, as I need to create an archive and forward that to someone who is neither willing nor allowed to install software.

Regards,
   Steffen


--
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-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebird-java/c08d03a0-d655-c2b7-3efb-e13ea70ba36e%40lawinegevaar.nl.

Mark Rotteveel

unread,
Jun 18, 2021, 10:30:42 AM6/18/21
to firebi...@googlegroups.com
On 18-06-2021 16:15, Steffen Heil wrote:
> If I leave out the -Djava.library.path=... argument, I get another error:
>   java.lang.UnsatisfiedLinkError: no jaybird22_x64 in java.library.path

So, the problem is not part 1), then it is part 2). Did you use the
64-bit Firebird?

> So I suspect it can load this library. And I have added the Firebird
> folder to the path, tried both relative and absolute. (I added the root
> folder that contanis fbclient.dll.)

Things in PATH always need to be an absolute path as far as I'm aware.

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Jun 18, 2021, 11:01:01 AM6/18/21
to firebi...@googlegroups.com
On 18-06-2021 16:15, Steffen Heil wrote:
> If I leave out the -Djava.library.path=... argument, I get another error:
>   java.lang.UnsatisfiedLinkError: no jaybird22_x64 in java.library.path
>
> So I suspect it can load this library. And I have added the Firebird
> folder to the path, tried both relative and absolute. (I added the root
> folder that contanis fbclient.dll.)
> Still getting:
>    java.lang.RuntimeException: Failed to initialize Jaybird native
> library. This is most likely due to a failure to load the firebird
> client library.
>         at
> org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:106)
>
> Using something that has to be installed is not an option, as I need to
> create an archive and forward that to someone who is neither willing nor
> allowed to install software.

I just tried it myself, and I overlooked something: Jaybird 2.2 for
embedded connections only tries to load fbembed.dll (or libfbembed.so on
Linux). So, for this to work, you need to copy fbclient.dll to a file
named fbembed.dll.

Mark
--
Mark Rotteveel

Steffen Heil

unread,
Jun 18, 2021, 12:18:58 PM6/18/21
to firebi...@googlegroups.com
That did the trick. Thank you very much - again!

--
You received this message because you are subscribed to a topic in the Google Groups "firebird-java" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebird-java/1_5mMzYL9NI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebird-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebird-java/276b70f2-e277-137c-d46d-9477c05f7676%40lawinegevaar.nl.
Reply all
Reply to author
Forward
0 new messages